~sircmpwn/aerc2#319: 
outgoing: add oauth authentication method

My organisation uses gmail and does not allow one to enable 2FA which is required for app passwords; could oauth be implemented for outgoing mail too?

Status
RESOLVED IMPLEMENTED
Submitter
~tmplt
Assigned to
No-one
Submitted
11 months ago
Updated
2 months ago
Labels
feature smtp

~tmplt 11 months ago

An alternative would be to support msmtp as an outgoing messenger, which supports oauth (together with getmail-gmail-xoauth-tokens).

~labrat 11 months ago

msmtp already works, man aerc-sendmail

Also you can probably hack up a script and plug it into outgoing-cred-cmd that does the token exchange

~tmplt 11 months ago

On Sat Nov 16, 2019 at 10:37 AM ~labrat wrote:

msmtp already works, man aerc-sendmail Would that be just outgoing = /path/to/msmtp? I'm getting a confusing EOF error without the mail being sent. I tried using the below script as outgoing to see what aerc actually calls the executable with (in case I need to write some wrapper), but there is no ~/{options,stdin} after the mail has been "sent". Am I missing something?

# sendmail-dummy.sh, with +x
echo -- "$@" > ~/options
while IFS= read -r line
do
    echo "$line" >> ~/stdin
done < /dev/stdin

~labrat 11 months ago

On Sat, Nov 16, 2019 at 01:46:50PM -0000, ~tmplt wrote:

Would that be just outgoing = /path/to/msmtp?

Well, depends on what you want to do. I've set mine to outgoing = /bin/msmtp --read-envelope-from

Am I missing something?

Probably

~tmplt 11 months ago

On Sun Nov 17, 2019 at 9:21 AM ~labrat wrote:

I've set mine to outgoing = /bin/msmtp --read-envelope-from

That does it, thanks.

Ning Shi 2 months ago · edit

I have the same problem and I'm trying to solve it by specifying outgoing-cred-cmd to a script that retrieves the access token. The outgoing is correctly set with the access token, but I keep getting authentication failure when sending emails. The final outgoing looks like "smtp://me%40example.com:VERY_LONG_TOKEN@smtp.gmail.com:587". I have smtp-starttls = yes. Any guidance on how I should debug this?

Thanks,

Ning

~labrat 2 months ago

apply this patch https://lists.sr.ht/~sircmpwn/aerc/patches/10813 and give feedback if that works please

Ning Shi 2 months ago · edit

On Mon Aug 10, 2020 at 11:55 PM EDT, ~labrat wrote:

apply this patch https://lists.sr.ht/~sircmpwn/aerc/patches/10813 and give feedback if that works please

This patch works perfectly with gmail. Thank you!

~labrat REPORTED IMPLEMENTED 2 months ago

Register here or Log in to comment, or comment via email.