9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] upas/smtp and gmail
@ 2014-01-23  5:57 Grant Mather
  2014-01-23 10:10 ` erik quanstrom
  2014-01-23 16:59 ` blstuart
  0 siblings, 2 replies; 4+ messages in thread
From: Grant Mather @ 2014-01-23  5:57 UTC (permalink / raw)
  To: 9fans

I'm wondering what exactly I'm doing wrong, I've been trying to send
mail on Plan 9 for some time now, and I'm definitely misunderstanding
something about how upas works. My goal is to send my mail via gmail,
but this has not been working, I've also tried different email account
providers I have, but to no avail. The steps I've taken:

cp /mail/lib/rewrite.gateway /mail/lib/gateway

add an smtp=smtp.gmail.com entry under my ipnet in /lib/ndb/local

changed the last line of /mail/lib/remotemail to read 'exec
/bin/upas/smtp -sa -u mygmailusername@gmail.com -h $fd
tcp!smtp.gmail.com!587 $senter $*'

The farthest I have gotten is getting smtp to issue 220 Ready to Start
TLS, and then it exits, that's running smtp with the -d flag.
/sys/log/smtp reveals a bunch of bad thumbprint x509 lines. I have tried
adding the sha1 hash to /sys/lib/tls/mail, but this has had no effect.

I'm a bit puzzled on the arguments to upas/smtp as well, what is the
value of sender arg supposed to be, and the rcpt-list respectively? How
is the sender option any different than the user provided with the -u
flag?

Any help would be much appreciated!



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] upas/smtp and gmail
  2014-01-23  5:57 [9fans] upas/smtp and gmail Grant Mather
@ 2014-01-23 10:10 ` erik quanstrom
  2014-01-23 16:59 ` blstuart
  1 sibling, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2014-01-23 10:10 UTC (permalink / raw)
  To: 9fans

> The farthest I have gotten is getting smtp to issue 220 Ready to Start
> TLS, and then it exits, that's running smtp with the -d flag.
> /sys/log/smtp reveals a bunch of bad thumbprint x509 lines. I have tried
> adding the sha1 hash to /sys/lib/tls/mail, but this has had no effect.

you might try, as an experiment, commenting out the
	if(!okThumbprint(hash, goodcerts)){
		...
	}
clause to eliminate thumbprint checking as a source of the issue.

one thing that occurs to me is the factotum that smtp has access to
will need this gmail authentication information.  to make this simplier,
smtp can be run by hand from the command line.  secstore(1) with the
-n option can be used in cpurc(8) to load additional keys into the hostowners
factotum on the auth server.

for stepwise debugging, it may be easier to disable /mail/lib/qmail
from running upas/qer and the kickqueue cron job and just run the
queue by hand.  this will (or should, i haven't tried this to make sure)
give the queue access to your factotum.

> I'm a bit puzzled on the arguments to upas/smtp as well, what is the
> value of sender arg supposed to be, and the rcpt-list respectively? How
> is the sender option any different than the user provided with the -u
> flag?

sender is the envelope sender.  in unix mbox format, this is the bit
in the 'From ' line.  the recpt-list is the list of recipients.  this is not
the same as the To: header line.  (as seen in To: undesclosed-recipients:;)

- erik



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] upas/smtp and gmail
  2014-01-23  5:57 [9fans] upas/smtp and gmail Grant Mather
  2014-01-23 10:10 ` erik quanstrom
@ 2014-01-23 16:59 ` blstuart
  2014-01-23 19:54   ` Grant R. Mather
  1 sibling, 1 reply; 4+ messages in thread
From: blstuart @ 2014-01-23 16:59 UTC (permalink / raw)
  To: 9fans

> The farthest I have gotten is getting smtp to issue 220 Ready to Start
> TLS, and then it exits, that's running smtp with the -d flag.
> /sys/log/smtp reveals a bunch of bad thumbprint x509 lines. I have tried
> adding the sha1 hash to /sys/lib/tls/mail, but this has had no effect.

For outgoing, you'll need to add a thumbprint to /sys/lib/tls/smtp.
Your factotum will need a key with:

proto=pass service=smtp server=your-smtp-server user=your-user-name !password=your-password

This message was sent with exactly that setup, though through ATT,
rather than gmail.

BLS




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] upas/smtp and gmail
  2014-01-23 16:59 ` blstuart
@ 2014-01-23 19:54   ` Grant R. Mather
  0 siblings, 0 replies; 4+ messages in thread
From: Grant R. Mather @ 2014-01-23 19:54 UTC (permalink / raw)
  To: 9fans

>> The farthest I have gotten is getting smtp to issue 220 Ready to Start
>> TLS, and then it exits, that's running smtp with the -d flag.
>> /sys/log/smtp reveals a bunch of bad thumbprint x509 lines. I have tried
>> adding the sha1 hash to /sys/lib/tls/mail, but this has had no effect.
>
> For outgoing, you'll need to add a thumbprint to /sys/lib/tls/smtp.
> Your factotum will need a key with:
>
> proto=pass service=smtp server=your-smtp-server user=your-user-name !password=your-password
>
> This message was sent with exactly that setup, though through ATT,
> rather than gmail.
>
> BLS

Thank you for the response, this is exactly what fixed it, I didn't realize that /sys/lib/tls/smtp needed to exist as well. Everything seems to be working now, in fact I just sent this message on Plan 9!

Erik, thank you also for the response, could you also clarify what the purpose of the -u flag is in upas/smtp, as far as I can tell it's not necessary for sending mail via gmail.

Thanks,

Grant




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-23 19:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-23  5:57 [9fans] upas/smtp and gmail Grant Mather
2014-01-23 10:10 ` erik quanstrom
2014-01-23 16:59 ` blstuart
2014-01-23 19:54   ` Grant R. Mather

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).