From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com ([209.85.221.50]) by ewsd; Wed Dec 18 12:03:55 EST 2019 Received: by mail-wr1-f50.google.com with SMTP id j42so3061655wrj.12 for <9front@9front.org>; Wed, 18 Dec 2019 09:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:date:to:subject:mime-version; bh=HPl7jfMjWrdE5sDymIBG7s1AIKy9FUms0jLVl3xlKOo=; b=AJ5z0En2xYzU/4cdHMF8Zz5gwqeEFgyc4l4AatjgXk5A87KqIiT/wHCwWn0RrnnO/C rS6FCo68VAOeLtd/dYBnrPCC3Sy/6WLM2gaPQtovJS+YXye22BG50Ic6eZEqz9DxoKI3 HAIv92nNkYvwr6FcusVQYhZNNKgD1RRvKWMmQdBd/6Wr/Wct9wYqo43OrYeqgCao52li WXponPbHVIxilv9tfE5hS9qrxAaisdY86BysSYZNBA7oTL74tkRXRfvqwpawy4sjDm9y F6yREThyfPoKE51NzF+Zhs+DuSK+LKexWzI4228UZGpIB3LJlaUcB2zwIqP2NjUnm62V v0RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:to:subject:mime-version; bh=HPl7jfMjWrdE5sDymIBG7s1AIKy9FUms0jLVl3xlKOo=; b=LZMkSyeJ/fRIZu2i3sV/LGK7y7Uvoe0ap2UYcVXMcfFJL3GMVUM/o7wRW+dMbTHs0K 8f2bGYfPU2Rzo9vBqF3HaSzAdA8THDBxih0PoOZh9ms+Ei0v2vF+tchOwwM8exRs9Lx/ TWO3ZAm0IiwFGgnPDxpnaeRb/rqJkHfiB0erqo0vSx0gYngH5pNJYEw5bQ4CUbfnlXb6 hJde/FjpdrLwHPd13Oag76ynplGxMVKpVPcKWemtuGU+3oGaQNMM4tBoihBk1Mif/epT nsIAa99OFAJE5ZC5npQeS/Yq/du354TbhIlpcdWFps6Ute0fC4wlVFYx0WlOnqnjvLFf cCMA== X-Gm-Message-State: APjAAAWTeFPbgrhcwT62JPNBXEf6GlRnJy5RcKJ3eAxI5g7aS0GUbEr3 FTUAa4lcDnl3Hfm7VXCy56Ih2ghl X-Google-Smtp-Source: APXvYqx9I/XiDSt241HvLouVp6MkzOkyBcg/iypcAJzejnZ9kUd4Mo29//NJQLALm2Clj6tMg0pyXw== X-Received: by 2002:adf:f2d0:: with SMTP id d16mr4167128wrp.314.1576688631493; Wed, 18 Dec 2019 09:03:51 -0800 (PST) Return-Path: Received: from hades (lfbn-idf1-1-352-97.w86-195.abo.wanadoo.fr. [86.195.7.97]) by smtp.gmail.com with ESMTPSA id k8sm3285817wrl.3.2019.12.18.09.03.50 for <9front@9front.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Dec 2019 09:03:50 -0800 (PST) From: telephil9@gmail.com X-Google-Original-From: pme@gmail.com Message-ID: Date: Wed, 18 Dec 2019 18:03:49 +0100 To: 9front@9front.org Subject: fqa8: sending email with gmail MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-mnchafknykjqsfnpybmhylpqvh" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: secure RESTful realtime-java-scale full-stack descriptor core database This is a multi-part message in MIME format. --upas-mnchafknykjqsfnpybmhylpqvh Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit 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 --upas-mnchafknykjqsfnpybmhylpqvh Content-Type: multipart/mixed; boundary="upas-syvcxmkllclyekyqkiniwpxryv" Content-Disposition: inline This is a multi-part message in MIME format. --upas-syvcxmkllclyekyqkiniwpxryv Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit 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 --upas-syvcxmkllclyekyqkiniwpxryv Content-Type: application/octet-stream Content-Disposition: attachment; filename="fqa8-send-gmail.patch.suspect" 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 - +.ihtml 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 - .ihtml h4

.SH --upas-syvcxmkllclyekyqkiniwpxryv--