unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used
@ 2018-02-04 14:01 Rainer Orth
  2018-04-15 17:24 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Rainer Orth @ 2018-02-04 14:01 UTC (permalink / raw)
  To: 30347

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

I've long been dealing with the following problem: I'm using GNU Emacs
(current 26.0.91, but the problem has existed for a long time before
that) and Gnus to send mail.  The relaying MTA uses greylisting when
receiving mail for local accounts without authentication, but
smtpmail.el cannot deal with the resulting temporary SMTP codes.  I'd
expect that it would retry with authentication, but doesn't.

I've used the following snippet to fix this.  Perhaps this (or something
similar) can be used to fix this issue?

Thanks.
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: smtpmail.el.patch --]
[-- Type: text/x-patch, Size: 534 bytes --]

--- -	2018-02-04 01:21:02.374212479 +0000
+++ /tmp/smtpmail.el	2018-02-04 01:20:44.340497887 +0000
@@ -838,8 +838,9 @@
 		 ((and auth-mechanisms
 		       (not ask-for-password)
 		       (integerp (car result))
-		       (>= (car result) 550)
-		       (<= (car result) 554))
+		       (or (and (>= (car result) 550)
+				(<= (car result) 554))
+			   (eq (car result) 450)))
 		  ;; We got a "550 relay not permitted" (or the like),
 		  ;; and the server accepts credentials, so we try
 		  ;; again, but ask for a password first.

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

* bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used
  2018-02-04 14:01 bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used Rainer Orth
@ 2018-04-15 17:24 ` Lars Ingebrigtsen
  2018-04-16 14:58   ` Robert Pluim
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-15 17:24 UTC (permalink / raw)
  To: Rainer Orth; +Cc: 30347

Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> I've long been dealing with the following problem: I'm using GNU Emacs
> (current 26.0.91, but the problem has existed for a long time before
> that) and Gnus to send mail.  The relaying MTA uses greylisting when
> receiving mail for local accounts without authentication, but
> smtpmail.el cannot deal with the resulting temporary SMTP codes.  I'd
> expect that it would retry with authentication, but doesn't.
>
> I've used the following snippet to fix this.  Perhaps this (or something
> similar) can be used to fix this issue?

Hm...  Well, the SMTP error message you're getting is "450, Requested
mail action not taken: mailbox unavailable."?  Retrying with a password
seems a bit odd in that instance.  On the other hand, if this is the
common way for SMTP servers to say that "we're greylisting; log in
first" then it would be OK anyway.

But is it?  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used
  2018-04-15 17:24 ` Lars Ingebrigtsen
@ 2018-04-16 14:58   ` Robert Pluim
  2018-04-16 18:45     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Pluim @ 2018-04-16 14:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 30347, Rainer Orth

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
>> I've long been dealing with the following problem: I'm using GNU Emacs
>> (current 26.0.91, but the problem has existed for a long time before
>> that) and Gnus to send mail.  The relaying MTA uses greylisting when
>> receiving mail for local accounts without authentication, but
>> smtpmail.el cannot deal with the resulting temporary SMTP codes.  I'd
>> expect that it would retry with authentication, but doesn't.
>>
>> I've used the following snippet to fix this.  Perhaps this (or something
>> similar) can be used to fix this issue?
>
> Hm...  Well, the SMTP error message you're getting is "450, Requested
> mail action not taken: mailbox unavailable."?  Retrying with a password
> seems a bit odd in that instance.  On the other hand, if this is the
> common way for SMTP servers to say that "we're greylisting; log in
> first" then it would be OK anyway.
>
> But is it?  :-)

Itʼs one of the ways. Some return 451 instead. Some 421. Itʼs all very
fuzzy :-)

Oh, and thereʼs an official 'authentication is required' code whose
value escapes me for the moment.

BTW, if emacs has credentials for the connection itʼs making, would it
not make sense to attempt authentication before delivery?

Robert





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

* bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used
  2018-04-16 14:58   ` Robert Pluim
@ 2018-04-16 18:45     ` Lars Ingebrigtsen
  2018-04-17 10:33       ` Robert Pluim
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-16 18:45 UTC (permalink / raw)
  To: Rainer Orth; +Cc: 30347

Robert Pluim <rpluim@gmail.com> writes:

> Itʼs one of the ways. Some return 451 instead. Some 421. Itʼs all very
> fuzzy :-)
>
> Oh, and thereʼs an official 'authentication is required' code whose
> value escapes me for the moment.

Yeah, smtpmail just uses the "relay not permitted" codes to guess that
it's supposed to try again, which aren't exactly official, either.  So
adding 450/451/421, too, probably won't break anything.

> BTW, if emacs has credentials for the connection itʼs making, would it
> not make sense to attempt authentication before delivery?

You'd think so...  But this might lead to some annoyances in that people
have password-protected their password store, and will now be prompted
for that password even if the SMTP server doesn't require a password.

If you see what I mean.  :-)

So I'm not sure that change would be welcomed by everybody.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used
  2018-04-16 18:45     ` Lars Ingebrigtsen
@ 2018-04-17 10:33       ` Robert Pluim
  2018-04-17 12:45         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Pluim @ 2018-04-17 10:33 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 30347, Rainer Orth

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Robert Pluim <rpluim@gmail.com> writes:
>
>> Itʼs one of the ways. Some return 451 instead. Some 421. Itʼs all very
>> fuzzy :-)
>>
>> Oh, and thereʼs an official 'authentication is required' code whose
>> value escapes me for the moment.
>
> Yeah, smtpmail just uses the "relay not permitted" codes to guess that
> it's supposed to try again, which aren't exactly official, either.  So
> adding 450/451/421, too, probably won't break anything.
>

OK

>> BTW, if emacs has credentials for the connection itʼs making, would it
>> not make sense to attempt authentication before delivery?
>
> You'd think so...  But this might lead to some annoyances in that people
> have password-protected their password store, and will now be prompted
> for that password even if the SMTP server doesn't require a password.
>
> If you see what I mean.  :-)
>

Iʼm not sure I follow: the user has a matching machine in authinfo or
wherever they keep their passwords, and the SMTP server advertizes
AUTH support. Why would we not attempt authentication?

> So I'm not sure that change would be welcomed by everybody.

Thatʼs true. What we have now works for me :-)





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

* bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used
  2018-04-17 10:33       ` Robert Pluim
@ 2018-04-17 12:45         ` Lars Ingebrigtsen
  2018-04-17 16:14           ` Robert Pluim
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-17 12:45 UTC (permalink / raw)
  To: Rainer Orth; +Cc: 30347

Robert Pluim <rpluim@gmail.com> writes:

> Iʼm not sure I follow: the user has a matching machine in authinfo or
> wherever they keep their passwords, and the SMTP server advertizes
> AUTH support. Why would we not attempt authentication?

Because Emacs doesn't know that the user has a password entry in
~/.authinfo.gpg until the user has type the password.  (If the user is
using password-protected ~/.authinfo files without a password agent,
that is.)

Since most SMTP is still unauthorised, "opportunistic" password sending
may not be welcome.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used
  2018-04-17 12:45         ` Lars Ingebrigtsen
@ 2018-04-17 16:14           ` Robert Pluim
  2020-09-07 20:49             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Pluim @ 2018-04-17 16:14 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 30347, Rainer Orth

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Robert Pluim <rpluim@gmail.com> writes:
>
>> Iʼm not sure I follow: the user has a matching machine in authinfo or
>> wherever they keep their passwords, and the SMTP server advertizes
>> AUTH support. Why would we not attempt authentication?
>
> Because Emacs doesn't know that the user has a password entry in
> ~/.authinfo.gpg until the user has type the password.  (If the user is
> using password-protected ~/.authinfo files without a password agent,
> that is.)
>

Ah, people who like typing passwords all the time. I see your point, though.

> Since most SMTP is still unauthorised, "opportunistic" password sending
> may not be welcome.

True, unfortunately, much like SMTP/TLS is sadly underused.





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

* bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used
  2018-04-17 16:14           ` Robert Pluim
@ 2020-09-07 20:49             ` Lars Ingebrigtsen
  2020-09-08  9:59               ` Robert Pluim
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-07 20:49 UTC (permalink / raw)
  To: 30347, Rainer Orth

Robert Pluim <rpluim@gmail.com> writes:

>> Because Emacs doesn't know that the user has a password entry in
>> ~/.authinfo.gpg until the user has type the password.  (If the user is
>> using password-protected ~/.authinfo files without a password agent,
>> that is.)
>
> Ah, people who like typing passwords all the time. I see your point, though.

So I think this isn't something we should try to automate -- the user
will just have to specify that the SMTP connection uses a password.  (I
think that's pretty common for mail user agents.)  So I'm closing this
bug report as a "wontfix".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used
  2020-09-07 20:49             ` Lars Ingebrigtsen
@ 2020-09-08  9:59               ` Robert Pluim
  2020-09-08 10:02                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Pluim @ 2020-09-08  9:59 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 30347, Rainer Orth

>>>>> On Mon, 07 Sep 2020 22:49:24 +0200, Lars Ingebrigtsen <larsi@gnus.org> said:

    Lars> Robert Pluim <rpluim@gmail.com> writes:
    >>> Because Emacs doesn't know that the user has a password entry in
    >>> ~/.authinfo.gpg until the user has type the password.  (If the user is
    >>> using password-protected ~/.authinfo files without a password agent,
    >>> that is.)
    >> 
    >> Ah, people who like typing passwords all the time. I see your point, though.

    Lars> So I think this isn't something we should try to automate -- the user
    Lars> will just have to specify that the SMTP connection uses a password.  (I
    Lars> think that's pretty common for mail user agents.)  So I'm closing this
    Lars> bug report as a "wontfix".

Didnʼt some bloke add smtpmail-servers-requiring-authorization just
for this kind of use-case?

Robert





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

* bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used
  2020-09-08  9:59               ` Robert Pluim
@ 2020-09-08 10:02                 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-08 10:02 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 30347, Rainer Orth

Robert Pluim <rpluim@gmail.com> writes:

> Didnʼt some bloke add smtpmail-servers-requiring-authorization just
> for this kind of use-case?

http://www.quickmeme.com/img/0d/0d00166e7e67eeeb51eab67da8be3a0a0fdad3579811b4b8b0430c13b045d440.jpg

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2020-09-08 10:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-04 14:01 bug#30347: smtpmail.el doesn't retry with authentication when greylisting is used Rainer Orth
2018-04-15 17:24 ` Lars Ingebrigtsen
2018-04-16 14:58   ` Robert Pluim
2018-04-16 18:45     ` Lars Ingebrigtsen
2018-04-17 10:33       ` Robert Pluim
2018-04-17 12:45         ` Lars Ingebrigtsen
2018-04-17 16:14           ` Robert Pluim
2020-09-07 20:49             ` Lars Ingebrigtsen
2020-09-08  9:59               ` Robert Pluim
2020-09-08 10:02                 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).