all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Gnus, Oauth2, & nnimap-authenticator
@ 2025-01-02  6:36 David Masterson
  2025-01-02 17:16 ` Bob Newell
  2025-01-03 11:10 ` Eric S Fraga
  0 siblings, 2 replies; 12+ messages in thread
From: David Masterson @ 2025-01-02  6:36 UTC (permalink / raw)
  To: help-gnu-emacs

Does anyone have more documentation on setting up OAuth2 and using it
with NNIMAP in Gnus?  New email systems seem to be moving to Oauth2
protocol, but there is very little documentation on how to set it up
(especially for newbies) with Emacs email packages.  Any hints??
-- 
David Masterson



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

* Re: Gnus, Oauth2, & nnimap-authenticator
  2025-01-02  6:36 Gnus, Oauth2, & nnimap-authenticator David Masterson
@ 2025-01-02 17:16 ` Bob Newell
  2025-01-03  3:07   ` David Masterson
  2025-01-03 11:10 ` Eric S Fraga
  1 sibling, 1 reply; 12+ messages in thread
From: Bob Newell @ 2025-01-02 17:16 UTC (permalink / raw)
  To: David Masterson, help-gnu-emacs



On Wed, Jan 1, 2025, at 20:36, David Masterson wrote:
> Does anyone have more documentation on setting up OAuth2 and using it
> with NNIMAP in Gnus?  New email systems seem to be moving to Oauth2
> protocol, but there is very little documentation on how to set it up
> (especially for newbies) with Emacs email packages.  Any hints??

The best way, if you require pure OAuth2, seems to be to hand off to msmtp rather than sending directly from Gnus, although that may trigger significant changes to your Gnus setup.  There is good online material showing how msmtp works with OAuth2.

Of course if your mail system allows for app passwords (you may have to hunt around as the option is often not easy to find) that is easiest, and it's what I do.  I haven't found a major provider that doesn't support app passwords (your mileage may vary).

Bob Newell
Honolulu





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

* Re: Gnus, Oauth2, & nnimap-authenticator
  2025-01-02 17:16 ` Bob Newell
@ 2025-01-03  3:07   ` David Masterson
  0 siblings, 0 replies; 12+ messages in thread
From: David Masterson @ 2025-01-03  3:07 UTC (permalink / raw)
  To: Bob Newell; +Cc: help-gnu-emacs

"Bob Newell" <bobnewell@bobnewell.net> writes:

> On Wed, Jan 1, 2025, at 20:36, David Masterson wrote:
>> Does anyone have more documentation on setting up OAuth2 and using it
>> with NNIMAP in Gnus?  New email systems seem to be moving to Oauth2
>> protocol, but there is very little documentation on how to set it up
>> (especially for newbies) with Emacs email packages.  Any hints??
>
> The best way, if you require pure OAuth2, seems to be to hand off to
> msmtp rather than sending directly from Gnus, although that may
> trigger significant changes to your Gnus setup.  There is good online
> material showing how msmtp works with OAuth2.

Hmm. msmtp would handle sending email, correct?  Does it also handle
getting the email from IMAP?

> Of course if your mail system allows for app passwords (you may have
> to hunt around as the option is often not easy to find) that is
> easiest, and it's what I do.  I haven't found a major provider that
> doesn't support app passwords (your mileage may vary).

Outlook.com was working fine, but seems to have moved to "Modern
Authentication" (which I think has to do with Oauth2).  So I tried a
free email account on Zohomail, but it has a strict DMARC policy which
causes gnu.org to reject it's email, but Zohomail does accept email from
gnu.org.  I've gotten SMTP working via icloud.com, so I'm using Zohomail
for incoming and Icloud for outgoing.  I'm still not sure of expiring
emails on Gnus and Zohomail (which will eventually overload the space if
expiry doesn't work), so I'm looking at other options.

-- 
David Masterson



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

* Re: Gnus, Oauth2, & nnimap-authenticator
  2025-01-02  6:36 Gnus, Oauth2, & nnimap-authenticator David Masterson
  2025-01-02 17:16 ` Bob Newell
@ 2025-01-03 11:10 ` Eric S Fraga
  2025-01-04  7:52   ` David Masterson
  1 sibling, 1 reply; 12+ messages in thread
From: Eric S Fraga @ 2025-01-03 11:10 UTC (permalink / raw)
  To: help-gnu-emacs

If you are trying to work with Outlook, davmail
(https://davmail.sourceforge.net/) works well as an intermediary between
gnus and Outlook.

-- 
Eric S Fraga via gnus (Emacs 31.0.50 2024-12-17) on Debian 12.8




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

* Re: Gnus, Oauth2, & nnimap-authenticator
  2025-01-03 11:10 ` Eric S Fraga
@ 2025-01-04  7:52   ` David Masterson
  2025-01-04  9:29     ` Björn Bidar
                       ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: David Masterson @ 2025-01-04  7:52 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: help-gnu-emacs

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> If you are trying to work with Outlook, davmail
> (https://davmail.sourceforge.net/) works well as an intermediary
> between gnus and Outlook.

I tried, but I had trouble figuring out Davmail -- the docs are
confusing for a newbie.  Do you have a simplified Davmail properties
file for Gnus<->Outlook you could share along with the Gnus & SMTP setup
in Emacs?  I work better copying from others. ;)

Thanks
-- 
David Masterson



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

* Re: Gnus, Oauth2, & nnimap-authenticator
  2025-01-04  7:52   ` David Masterson
@ 2025-01-04  9:29     ` Björn Bidar
       [not found]     ` <87msg753m4.fsf@>
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Björn Bidar @ 2025-01-04  9:29 UTC (permalink / raw)
  To: David Masterson; +Cc: Eric S Fraga, help-gnu-emacs


When you use Davmail with Gnus then Davmail handles OAuth but not Gnus.
You simply use your user with password and username like you always do.



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

* Re: Gnus, Oauth2, & nnimap-authenticator
       [not found]     ` <87msg753m4.fsf@>
@ 2025-01-06  0:08       ` David Masterson
  0 siblings, 0 replies; 12+ messages in thread
From: David Masterson @ 2025-01-06  0:08 UTC (permalink / raw)
  To: Björn Bidar; +Cc: Eric S Fraga, help-gnu-emacs

Björn Bidar <bjorn.bidar@thaodan.de> writes:

> When you use Davmail with Gnus then Davmail handles OAuth but not Gnus.
> You simply use your user with password and username like you always do.

Mostly understood.  My questions are:

+ how to configure Davmail to talk to Outlook.com with "Modern Auth"? 
+ how to test that the configuration works?
+ how to connect Gnus to Davmail (this I think I know)?
* what logs can I setup to check everything works?

-- 
David Masterson



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

* Re: Gnus, Oauth2, & nnimap-authenticator
  2025-01-04  7:52   ` David Masterson
  2025-01-04  9:29     ` Björn Bidar
       [not found]     ` <87msg753m4.fsf@>
@ 2025-01-06  8:16     ` Fraga, Eric
  2025-01-06  8:19     ` Fraga, Eric
  2025-01-06 16:13     ` Leo Butler
  4 siblings, 0 replies; 12+ messages in thread
From: Fraga, Eric @ 2025-01-06  8:16 UTC (permalink / raw)
  To: David Masterson; +Cc: help-gnu-emacs@gnu.org

Response below/inline for email David Masterson wrote:
> (original email sent  3 Jan 2025 at 23:52)
> 
> I tried, but I had trouble figuring out Davmail -- the docs are
> confusing for a newbie.  Do you have a simplified Davmail properties
> file for Gnus<->Outlook you could share along with the Gnus & SMTP
> setup in Emacs?  I work better copying from others. ;)

Davmail comes with some example configurations, one of them for Exchange
(aka Outlook).  Specifically, for Outlook, the "davmail.properties"
config file will have this entry:

davmail.url=https://outlook.office365.com/ews/exchange.asmx

Then, in my .gnus.e file, I have

--8<---------------cut here---------------start------------->8---
(setq mail-sources (list 
                    (list 'pop
                          :server "localhost"
                          :user "ucecesf@ucl.ac.uk"
                          :port 1110)
                    ))
--8<---------------cut here---------------end--------------->8---

which tells gnus to access the POP server at port 1110 which is where
davmail uses to serve the emails it gets from Outlook.  

I use (list ...) for reasons not related to Outlook; the above is just
one part of my configuration.

If you want IMAP, the port number will be different and you will
probably wish to define an entry in gnus-secondary-select-methods
instead of mail-sources (but I do not have an example for this
unfortunately).  I prefer POP so that I can manage the emails myself.  I
am not concerned with sharing an IMAP server over multiple devices.

HTH,
eric

-- 
Eric S Fraga via gnus (Emacs 31.0.50 2024-12-17) on Debian 12.8


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

* Re: Gnus, Oauth2, & nnimap-authenticator
  2025-01-04  7:52   ` David Masterson
                       ` (2 preceding siblings ...)
  2025-01-06  8:16     ` Fraga, Eric
@ 2025-01-06  8:19     ` Fraga, Eric
  2025-01-06 16:13     ` Leo Butler
  4 siblings, 0 replies; 12+ messages in thread
From: Fraga, Eric @ 2025-01-06  8:19 UTC (permalink / raw)
  To: David Masterson; +Cc: help-gnu-emacs@gnu.org

Forgot to add that, in my .authinfo file, I have three entries which
look like this:

machine localhost login OUTLOOKACCOUNT password PASSWORD

the other two entries have localhost replaced by "davmail" and
"outlook.office350.com".  I do not know which of these is actually
required.

-- 
Eric S Fraga via gnus (Emacs 31.0.50 2024-12-17) on Debian 12.8


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

* Re: Gnus, Oauth2, & nnimap-authenticator
  2025-01-04  7:52   ` David Masterson
                       ` (3 preceding siblings ...)
  2025-01-06  8:19     ` Fraga, Eric
@ 2025-01-06 16:13     ` Leo Butler
  2025-01-06 16:31       ` Fraga, Eric
  4 siblings, 1 reply; 12+ messages in thread
From: Leo Butler @ 2025-01-06 16:13 UTC (permalink / raw)
  To: David Masterson; +Cc: Eric S Fraga, help-gnu-emacs@gnu.org

On Fri, Jan 03 2025, David Masterson <dsmasterson@icloud.com> wrote:

> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> If you are trying to work with Outlook, davmail
>> (https://davmail.sourceforge.net/) works well as an intermediary
>> between gnus and Outlook.
>
> I tried, but I had trouble figuring out Davmail -- the docs are
> confusing for a newbie.  Do you have a simplified Davmail properties
> file for Gnus<->Outlook you could share along with the Gnus & SMTP setup
> in Emacs?  I work better copying from others. ;)
>
> Thanks

Hi David,
I had to make a similar adaptation in 2022. I kept notes, including how
to configure davmail and Gnus, which are here:

https://net124.reltub.ca/~leobutler/oauth2/notes-on-oauth2.html

Note that I am using imap, which is quite slow, while Eric Fraga has
reported that the speed with pop3 is tolerable.

HTH,
Leo


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

* Re: Gnus, Oauth2, & nnimap-authenticator
  2025-01-06 16:13     ` Leo Butler
@ 2025-01-06 16:31       ` Fraga, Eric
  2025-01-06 17:39         ` Leo Butler
  0 siblings, 1 reply; 12+ messages in thread
From: Fraga, Eric @ 2025-01-06 16:31 UTC (permalink / raw)
  To: Leo Butler; +Cc: David Masterson, help-gnu-emacs@gnu.org

Response below/inline for email Leo Butler wrote:
> (original email sent  6 Jan 2025 at 16:13)
> 
> I had to make a similar adaptation in 2022. I kept notes, including how
> to configure davmail and Gnus, which are here:

That's an excellent set of notes!  Thank you.  From memory, I did pretty
much the same (except for pop versus imap).

> Note that I am using imap, which is quite slow, while Eric Fraga has
> reported that the speed with pop3 is tolerable.

Just to confirm: pop access (from memory) seems about the same as it was
without davmail, preceding the need for multi-factor authentication.  I
never did try imap.  But speed was never the goal: being able to access
my email at all (from gnus) was the actual aim.

Thanks again,
eric

-- 
Eric S Fraga via gnus (Emacs 31.0.50 2025-01-06) on Debian 12.8


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

* Re: Gnus, Oauth2, & nnimap-authenticator
  2025-01-06 16:31       ` Fraga, Eric
@ 2025-01-06 17:39         ` Leo Butler
  0 siblings, 0 replies; 12+ messages in thread
From: Leo Butler @ 2025-01-06 17:39 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: David Masterson, help-gnu-emacs@gnu.org

On Mon, Jan 06 2025, "Fraga, Eric" <e.fraga@ucl.ac.uk> wrote:

> Response below/inline for email Leo Butler wrote:
>> (original email sent  6 Jan 2025 at 16:13)
>> 
>> I had to make a similar adaptation in 2022. I kept notes, including how
>> to configure davmail and Gnus, which are here:
>
> That's an excellent set of notes!  Thank you.  From memory, I did pretty
> much the same (except for pop versus imap).
>
>> Note that I am using imap, which is quite slow, while Eric Fraga has
>> reported that the speed with pop3 is tolerable.
>
> Just to confirm: pop access (from memory) seems about the same as it was
> without davmail, preceding the need for multi-factor authentication.  I
> never did try imap.  But speed was never the goal: being able to access
> my email at all (from gnus) was the actual aim.

Hi Eric,

Re: speed.

I used Gnus+Exchange+imap for ~5 years before having to deal with
oauth2. Exchange was always slow (gmail seemed 2-5 times faster). With
the one fiddle I mention in my notes, imap access via davmail was about
the same speed as before the change-over--which confirms your
impression.

I did fail to mention one thing in the notes: emails that I save are
saved back on the Exchange server. That is for purely historical
reasons.

Best regards,
Leo



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

end of thread, other threads:[~2025-01-06 17:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-02  6:36 Gnus, Oauth2, & nnimap-authenticator David Masterson
2025-01-02 17:16 ` Bob Newell
2025-01-03  3:07   ` David Masterson
2025-01-03 11:10 ` Eric S Fraga
2025-01-04  7:52   ` David Masterson
2025-01-04  9:29     ` Björn Bidar
     [not found]     ` <87msg753m4.fsf@>
2025-01-06  0:08       ` David Masterson
2025-01-06  8:16     ` Fraga, Eric
2025-01-06  8:19     ` Fraga, Eric
2025-01-06 16:13     ` Leo Butler
2025-01-06 16:31       ` Fraga, Eric
2025-01-06 17:39         ` Leo Butler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.