9front - general discussion about 9front
 help / color / mirror / Atom feed
* fqa8: sending email with gmail
@ 2019-12-18 17:03 telephil9
  2019-12-18 17:29 ` [9front] " Ori Bernstein
  0 siblings, 1 reply; 4+ messages in thread
From: telephil9 @ 2019-12-18 17:03 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

Hi,

Attached is a patch to fqa8 that documents sending mail with gmail.
Thanks to Ori_B and kvik for helping me with the issues I had.

Regards,
Philippe

[-- Attachment #2.1: Type: text/plain, Size: 337 bytes --]

from postmaster@hades:
The following attachment had content that we can't
prove to be harmless.  To avoid possible automatic
execution, we changed the content headers.
The original header was:

	Content-Disposition: attachment; filename=fqa8-send-gmail.patch
	Content-Type: text/plain; charset="US-ASCII"
	Content-Transfer-Encoding: 7bit

[-- Attachment #2.2: fqa8-send-gmail.patch.suspect --]
[-- Type: application/octet-stream, Size: 1611 bytes --]

diff -r c259787f7f92 fqa8.ms
--- a/fqa8.ms	Wed Dec 04 21:18:36 2019 -0500
+++ b/fqa8.ms	Wed Dec 18 12:47:41 2019 +0100
@@ -891,6 +891,67 @@
 .B Note:
 Opening large mailboxes over a slow 9p link will be very slow.
 
+.html - <a name="8.4.1.1.2" />
+.ihtml h5 <h5>
+.SH
+8.4.1.1.2 - Sending mail with gmail
+.R
+.ihtml h5
+
+Add your gmail password to the factotum:
+.P1
+echo 'key proto=pass server=smtp.gmail.com service=smtp \e
+	user=your.username@gmail.com !password=yourpassword' >/mnt/factotum/ctl
+.P2
+
+Configure upas to use gmail as a gateway for outgoing email:
+.P1
+cat /mail/lib/rewrite.gateway >> /mail/lib/rewrite
+.P2
+
+Modify /mail/lib/remotemail to use your gmail account:
+.P1
+#!/bin/rc
+shift
+sender=your.username@gmail.com
+shift
+addr=tcp!smtp.gmail.com!587
+shift
+fd=`{/bin/upas/aliasmail -f $sender}
+switch($fd){
+case *.*
+	;
+case *
+	fd=gmail.com
+}
+exec /bin/upas/smtp -u your.username@gmail.com -a -h $fd $addr $sender $*
+.P2
+
+Now you can try sending an email:
+.P1
+echo hello | mail -s test your.username@gmail.com
+.P2
+
+This will not work the first time as we also need to add a certificate.
+Look into /sys/log/smtp for the following error:
+.P1
+cert for smtp.gmail.com not recognized:
+	sha256=wnu7Uuzq4MlyJHP90+8f2smoh6x3cj0dG5z02jJlX42
+.P2
+
+Add the certificate to your system:
+.P1
+echo 'x509 sha256=wnu7Uuzq4MlyJHP90+8f2smoh6x3cj0dG5z02jJlX42' \e
+	>> /sys/lib/tls/smtp
+.P2
+
+You should now be able to send emails from 9front!
+
+.B Note:
+This configuration does not work for local email delivery.
+
+
+
 .html - <a name="8.4.1.2" />
 .ihtml h4 <h4>
 .SH

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

* Re: [9front] fqa8: sending email with gmail
  2019-12-18 17:03 fqa8: sending email with gmail telephil9
@ 2019-12-18 17:29 ` Ori Bernstein
  2019-12-18 19:28   ` telephil9
  0 siblings, 1 reply; 4+ messages in thread
From: Ori Bernstein @ 2019-12-18 17:29 UTC (permalink / raw)
  To: 9front; +Cc: telephil9

On Wed, 18 Dec 2019 18:03:49 +0100, telephil9@gmail.com wrote:

> Hi,
> 
> Attached is a patch to fqa8 that documents sending mail with gmail.
> Thanks to Ori_B and kvik for helping me with the issues I had.
> 
> Regards,
> Philippe

Thanks for taking the time to fix our docs!

This can still use a bit of polish. Specifically, I think the
section below could be better written:

+Now you can try sending an email:
+.P1
+echo hello | mail -s test your.username@gmail.com
+.P2
+
+This will not work the first time as we also need to add a certificate.
+Look into /sys/log/smtp for the following error:
+.P1
+cert for smtp.gmail.com not recognized:
+	sha256=wnu7Uuzq4MlyJHP90+8f2smoh6x3cj0dG5z02jJlX42
+.P2
+
+Add the certificate to your system:
+.P1
+echo 'x509 sha256=wnu7Uuzq4MlyJHP90+8f2smoh6x3cj0dG5z02jJlX42' \e
+	>> /sys/lib/tls/smtp
+.P2
+
+You should now be able to send emails from 9front!

I think the thing that I dislike most is that 'now you can try
sending an email' reads as though things should work at that
point. Maybe replacing it with 'Now we need to extract the
certificate hash. We can do this by failing to send an email:'

It may also be worth taking a bit of time to figure out and
recommend a setup that works for both gmail and local mail.
Not sure about that.

-- 
    Ori Bernstein


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

* Re: [9front] fqa8: sending email with gmail
  2019-12-18 17:29 ` [9front] " Ori Bernstein
@ 2019-12-18 19:28   ` telephil9
  2019-12-19  3:17     ` sl
  0 siblings, 1 reply; 4+ messages in thread
From: telephil9 @ 2019-12-18 19:28 UTC (permalink / raw)
  To: ori, 9front, telephil9

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

Hi Ori,

Thanks for the feedback. Here is an amended version of the patch.

Regarding your last point, I'll try to look into it in the upcoming weeks.

Regards,
Philippe

[-- Attachment #2: Type: message/rfc822, Size: 4856 bytes --]

From: Ori Bernstein <ori@eigenstate.org>
To: 9front@9front.org
Cc: telephil9@gmail.com
Subject: Re: [9front] fqa8: sending email with gmail
Date: Wed, 18 Dec 2019 09:29:01 -0800
Message-ID: <20191218092901.9361ffc8c97b08207cd3babe@eigenstate.org>

On Wed, 18 Dec 2019 18:03:49 +0100, telephil9@gmail.com wrote:

> Hi,
> 
> Attached is a patch to fqa8 that documents sending mail with gmail.
> Thanks to Ori_B and kvik for helping me with the issues I had.
> 
> Regards,
> Philippe

Thanks for taking the time to fix our docs!

This can still use a bit of polish. Specifically, I think the
section below could be better written:

+Now you can try sending an email:
+.P1
+echo hello | mail -s test your.username@gmail.com
+.P2
+
+This will not work the first time as we also need to add a certificate.
+Look into /sys/log/smtp for the following error:
+.P1
+cert for smtp.gmail.com not recognized:
+	sha256=wnu7Uuzq4MlyJHP90+8f2smoh6x3cj0dG5z02jJlX42
+.P2
+
+Add the certificate to your system:
+.P1
+echo 'x509 sha256=wnu7Uuzq4MlyJHP90+8f2smoh6x3cj0dG5z02jJlX42' \e
+	>> /sys/lib/tls/smtp
+.P2
+
+You should now be able to send emails from 9front!

I think the thing that I dislike most is that 'now you can try
sending an email' reads as though things should work at that
point. Maybe replacing it with 'Now we need to extract the
certificate hash. We can do this by failing to send an email:'

It may also be worth taking a bit of time to figure out and
recommend a setup that works for both gmail and local mail.
Not sure about that.

-- 
    Ori Bernstein

[-- Attachment #3.1: Type: text/plain, Size: 337 bytes --]

from postmaster@hades:
The following attachment had content that we can't
prove to be harmless.  To avoid possible automatic
execution, we changed the content headers.
The original header was:

	Content-Disposition: attachment; filename=fqa8-send-gmail.patch
	Content-Type: text/plain; charset="US-ASCII"
	Content-Transfer-Encoding: 7bit

[-- Attachment #3.2: fqa8-send-gmail.patch.suspect --]
[-- Type: application/octet-stream, Size: 1659 bytes --]

diff -r c259787f7f92 fqa8.ms
--- a/fqa8.ms	Wed Dec 04 21:18:36 2019 -0500
+++ b/fqa8.ms	Wed Dec 18 20:21:19 2019 +0100
@@ -891,6 +891,67 @@
 .B Note:
 Opening large mailboxes over a slow 9p link will be very slow.
 
+.html - <a name="8.4.1.1.2" />
+.ihtml h5 <h5>
+.SH
+8.4.1.1.2 - Sending mail with gmail
+.R
+.ihtml h5
+
+Add your gmail password to the factotum:
+.P1
+echo 'key proto=pass server=smtp.gmail.com service=smtp \e
+	user=your.username@gmail.com !password=yourpassword' >/mnt/factotum/ctl
+.P2
+
+Configure upas to use gmail as a gateway for outgoing email:
+.P1
+cat /mail/lib/rewrite.gateway >> /mail/lib/rewrite
+.P2
+
+Modify /mail/lib/remotemail to use your gmail account:
+.P1
+#!/bin/rc
+shift
+sender=your.username@gmail.com
+shift
+addr=tcp!smtp.gmail.com!587
+shift
+fd=`{/bin/upas/aliasmail -f $sender}
+switch($fd){
+case *.*
+	;
+case *
+	fd=gmail.com
+}
+exec /bin/upas/smtp -u your.username@gmail.com -a -h $fd $addr $sender $*
+.P2
+
+A last step is needed, retrieving the certificate hash. This can be done
+by trying to send an email and then looking for the hash in the error logs:
+.P1
+echo hello | mail -s test your.username@gmail.com
+.P2
+
+Then look into /sys/log/smtp for the following error:
+.P1
+cert for smtp.gmail.com not recognized:
+	sha256=wnu7Uuzq4MlyJHP90+8f2smoh6x3cj0dG5z02jJlX42
+.P2
+
+Add the certificate to your system:
+.P1
+echo 'x509 sha256=wnu7Uuzq4MlyJHP90+8f2smoh6x3cj0dG5z02jJlX42' \e
+	>> /sys/lib/tls/smtp
+.P2
+
+You should now be able to send emails from 9front!
+
+.B Note:
+This configuration does not work for local email delivery.
+
+
+
 .html - <a name="8.4.1.2" />
 .ihtml h4 <h4>
 .SH

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

* Re: [9front] fqa8: sending email with gmail
  2019-12-18 19:28   ` telephil9
@ 2019-12-19  3:17     ` sl
  0 siblings, 0 replies; 4+ messages in thread
From: sl @ 2019-12-19  3:17 UTC (permalink / raw)
  To: 9front

i've added this section to the fqa with some minor tweaks.

thanks, Philippe!

sl


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

end of thread, other threads:[~2019-12-19  3:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 17:03 fqa8: sending email with gmail telephil9
2019-12-18 17:29 ` [9front] " Ori Bernstein
2019-12-18 19:28   ` telephil9
2019-12-19  3:17     ` sl

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).