GNU bug report logs - #34177
smtpmail.el aborts on transient errors

Previous Next

Package: emacs;

Reported by: Brian Sniffen <bts <at> evenmere.org>

Date: Wed, 23 Jan 2019 12:11:02 UTC

Severity: normal

Tags: fixed, moreinfo, patch

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34177 in the body.
You can then email your comments to 34177 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#34177; Package emacs. (Wed, 23 Jan 2019 12:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brian Sniffen <bts <at> evenmere.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 23 Jan 2019 12:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brian Sniffen <bts <at> evenmere.org>
To: bug-gnu-emacs <at> gnu.org
Subject: smtpmail.el aborts on transient errors
Date: Tue, 22 Jan 2019 23:09:08 -0500
smtpmail.el treats all return codes over 400 as errors, and aborts.  But RFC 821 and successors call the 400-series “transient” errors and suggest retrying immediately.  Some mail servers, including current MS Exchange, use 400-series errors for load limiting.  The user can just repeat C-c C-c until the mail goes through... or Emacs SMTPmail could loop until the server accepts it.

Retrying is a little tricky in the case of multipart commands like LOGIN, but in general it’s safe to loop for seconds on any command.

-- 
Brian Sniffen




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34177; Package emacs. (Tue, 09 Jul 2019 18:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 34177 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Brian Sniffen <bts <at> evenmere.org>
Cc: 34177 <at> debbugs.gnu.org
Subject: Re: bug#34177: smtpmail.el aborts on transient errors
Date: Tue, 09 Jul 2019 20:24:19 +0200
[Message part 1 (text/plain, inline)]
Brian Sniffen <bts <at> evenmere.org> writes:

> smtpmail.el treats all return codes over 400 as errors, and aborts.
> But RFC 821 and successors call the 400-series “transient” errors and
> suggest retrying immediately.  Some mail servers, including current MS
> Exchange, use 400-series errors for load limiting.  The user can just
> repeat C-c C-c until the mail goes through... or Emacs SMTPmail could
> loop until the server accepts it.
>
> Retrying is a little tricky in the case of multipart commands like
> LOGIN, but in general it’s safe to loop for seconds on any command.

This is what RFC 5321 says:

https://tools.ietf.org/html/rfc5321#section-4.2.1

4yz  Transient Negative Completion reply
      The command was not accepted, and the requested action did not
      occur.  However, the error condition is temporary, and the action
      may be requested again.  The sender should return to the beginning
      of the command sequence (if any).  It is difficult to assign a
      meaning to "transient" when two different sites (receiver- and
      sender-SMTP agents) must agree on the interpretation.  Each reply
      in this category might have a different time value, but the SMTP
      client SHOULD try again.  A rule of thumb to determine whether a
      reply fits into the 4yz or the 5yz category (see below) is that
      replies are 4yz if they can be successful if repeated without any
      change in command form or in properties of the sender or receiver
      (that is, the command is repeated identically and the receiver
      does not put up a new implementation).

So, indeed, smtpmail SHOULD try resending when given a 4xx response
code...  but presumably not forever, either.

It's a bit difficult to test, though.  Does the following patch work for
you?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no
[retry.patch (text/x-diff, attachment)]

Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 09 Jul 2019 18:25:03 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 09 Jul 2019 18:25:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34177; Package emacs. (Tue, 09 Jul 2019 18:47:01 GMT) Full text and rfc822 format available.

Message #15 received at 34177 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: bts <at> evenmere.org, 34177 <at> debbugs.gnu.org
Subject: Re: bug#34177: smtpmail.el aborts on transient errors
Date: Tue, 09 Jul 2019 21:45:35 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Tue, 09 Jul 2019 20:24:19 +0200
> Cc: 34177 <at> debbugs.gnu.org
> 
> So, indeed, smtpmail SHOULD try resending when given a 4xx response
> code...  but presumably not forever, either.
> 
> It's a bit difficult to test, though.  Does the following patch work for
> you?

IMO, this should at least say in the echo area that it's retrying,
probably with the number of retries.  Bonus points for doing that from
a separate thread or a timer.  smtpmail locks up Emacs too much
already, when the network is busy.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34177; Package emacs. (Tue, 09 Jul 2019 19:43:02 GMT) Full text and rfc822 format available.

Message #18 received at 34177 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: bts <at> evenmere.org, 34177 <at> debbugs.gnu.org
Subject: Re: bug#34177: smtpmail.el aborts on transient errors
Date: Tue, 09 Jul 2019 21:42:40 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> IMO, this should at least say in the echo area that it's retrying,
> probably with the number of retries.

Yup.  And perhaps there should be a `(sleep-for 1)' in there...

> Bonus points for doing that from a separate thread or a timer.
> smtpmail locks up Emacs too much already, when the network is busy.

Yeah, it'd be very, very nice if the entire thing was asynchronous.  I
vaguely remember somebody talking about trying to make the entire thing
run from a separate thread (in Emacs versions with support for that)?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34177; Package emacs. (Mon, 16 Sep 2019 21:50:01 GMT) Full text and rfc822 format available.

Message #21 received at 34177 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Brian Sniffen <bts <at> evenmere.org>
Cc: 34177 <at> debbugs.gnu.org
Subject: Re: bug#34177: smtpmail.el aborts on transient errors
Date: Mon, 16 Sep 2019 23:49:07 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> It's a bit difficult to test, though.  Does the following patch work for
> you?

I got no response, but I've tried to "manually" step through it, and the
patch seems to do its thing.  It's not asynchronous, though, but it
shouldn't make things worse for the normal case, and rewriting smtpmail
to be asynchronous is a major task.

So I applied the patch to Emacs 27.

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Sep 2019 21:50:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 34177 <at> debbugs.gnu.org and Brian Sniffen <bts <at> evenmere.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Sep 2019 21:50:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34177; Package emacs. (Mon, 16 Sep 2019 23:27:01 GMT) Full text and rfc822 format available.

Message #28 received at 34177 <at> debbugs.gnu.org (full text, mbox):

From: Brian Sniffen <bts <at> me.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 34177 <at> debbugs.gnu.org
Subject: Re: bug#34177: smtpmail.el aborts on transient errors
Date: Mon, 16 Sep 2019 19:17:24 -0400
Oh!  I did write back a little while ago. Let me try now from a different address. It seemed to reduce the problem greatly.  Thank you! At a limit of 20 requests, it was gone. Can this be a customizable constant?

-- 
Brian Sniffen

> On Sep 16, 2019, at 5:49 PM, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> 
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> 
>> It's a bit difficult to test, though.  Does the following patch work for
>> you?
> 
> I got no response, but I've tried to "manually" step through it, and the
> patch seems to do its thing.  It's not asynchronous, though, but it
> shouldn't make things worse for the normal case, and rewriting smtpmail
> to be asynchronous is a major task.
> 
> So I applied the patch to Emacs 27.
> 
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>   bloggy blog: http://lars.ingebrigtsen.no
> 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34177; Package emacs. (Mon, 16 Sep 2019 23:28:02 GMT) Full text and rfc822 format available.

Message #31 received at 34177 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Brian Sniffen <bts <at> me.com>
Cc: 34177 <at> debbugs.gnu.org
Subject: Re: bug#34177: smtpmail.el aborts on transient errors
Date: Tue, 17 Sep 2019 01:27:12 +0200
Brian Sniffen <bts <at> me.com> writes:

> Oh!  I did write back a little while ago. Let me try now from a
> different address. It seemed to reduce the problem greatly.  Thank
> you! At a limit of 20 requests, it was gone. Can this be a
> customizable constant?

Sure; makes sense.

I've now added smtpmail-retries to the trunk.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34177; Package emacs. (Tue, 17 Sep 2019 06:19:01 GMT) Full text and rfc822 format available.

Message #34 received at 34177 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: bts <at> me.com, 34177 <at> debbugs.gnu.org
Subject: Re: bug#34177: smtpmail.el aborts on transient errors
Date: Tue, 17 Sep 2019 09:18:46 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Tue, 17 Sep 2019 01:27:12 +0200
> Cc: 34177 <at> debbugs.gnu.org
> 
> I've now added smtpmail-retries to the trunk.

Please mention it in NEWS.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34177; Package emacs. (Tue, 17 Sep 2019 11:55:01 GMT) Full text and rfc822 format available.

Message #37 received at 34177 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: bts <at> me.com, 34177 <at> debbugs.gnu.org
Subject: Re: bug#34177: smtpmail.el aborts on transient errors
Date: Tue, 17 Sep 2019 13:54:27 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Lars Ingebrigtsen <larsi <at> gnus.org>
>> Date: Tue, 17 Sep 2019 01:27:12 +0200
>> Cc: 34177 <at> debbugs.gnu.org
>> 
>> I've now added smtpmail-retries to the trunk.
>
> Please mention it in NEWS.

I've done so already.  :-)

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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 16 Oct 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 246 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.