]> git.eshelyaron.com Git - emacs.git/commitdiff
Add a new variable smtpmail-retries
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 16 Sep 2019 23:26:43 +0000 (01:26 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 16 Sep 2019 23:26:43 +0000 (01:26 +0200)
* doc/misc/smtpmail.texi (Server workarounds): Mention it (bug#34177).

* lisp/mail/smtpmail.el (smtpmail-retries): New variable.
(smtpmail-via-smtp): Use it.

doc/misc/smtpmail.texi
etc/NEWS
lisp/mail/smtpmail.el

index b2fc90a337a86aa9cdd8883cf1c62c03b3d4a6e5..7fa7b24e162d80d364adbd7162bb09c29a788b05 100644 (file)
@@ -372,6 +372,13 @@ implement support for common requirements.
 
 @table @code
 
+@item smtpmail-retries
+@vindex smtpmail-retries
+An SMTP server may return an error code saying that there's a
+transient error (a @samp{4xx} code).  In that case, smtpmail will try
+to resend the message automatically, and the number of times it tries
+before giving up is determined by this variable, which defaults to 10.
+
 @item smtpmail-local-domain
 @vindex smtpmail-local-domain
   The variable @code{smtpmail-local-domain} controls the hostname sent
index adb2b642ba913ef65269c980a25429322a5772fa..33a7d12b7ef787ded7809b7b1d5cefcf07082d6f 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1164,7 +1164,8 @@ attempt when communicating with the SMTP server(s), the
 
 ---
 *** smtpmail will now try resending mail when getting a transient 4xx
-error message from the SMTP server.
+error message from the SMTP server.  The new 'smtpmail-retries'
+variable says how many times to retry.
 
 ** Footnote mode
 
index 57913c1f0f03cf6a7dead36b742d278ea3d67daf..802c9ba788d1f2d1612b9feb38ba74ec426c3b54 100644 (file)
@@ -165,6 +165,13 @@ attempt."
   :type '(choice regexp (const :tag "None" nil))
   :version "27.1")
 
+(defcustom smtpmail-retries 10
+  "The number of times smtpmail will retry sending when getting transient errors.
+These are errors with a code of 4xx from the SMTP server, which
+mean \"try again\"."
+  :type 'integer
+  :version "27.1")
+
 ;; End of customizable variables.
 
 
@@ -823,7 +830,7 @@ Returns an error if the server cannot be contacted."
                )
                ((and (numberp (car result))
                      (<= 400 (car result) 499)
-                     (< send-attempts 10))
+                     (< send-attempts smtpmail-retries))
                 (message "Got transient error code %s when sending; retrying attempt %d..."
                          (car result) send-attempts)
                 ;; Retry on getting a transient 4xx code; see