diff options
| author | Lars Ingebrigtsen | 2019-09-17 01:26:43 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-09-17 01:26:43 +0200 |
| commit | 3a6b5e6ad0173dfe164640e8a09bf465f78836cb (patch) | |
| tree | 457442f4cb840d7c556e68246d29ce8529775246 | |
| parent | 90ddad804a34b70af7d849f1fdd1f069a3c30f54 (diff) | |
| download | emacs-3a6b5e6ad0173dfe164640e8a09bf465f78836cb.tar.gz emacs-3a6b5e6ad0173dfe164640e8a09bf465f78836cb.zip | |
Add a new variable smtpmail-retries
* doc/misc/smtpmail.texi (Server workarounds): Mention it (bug#34177).
* lisp/mail/smtpmail.el (smtpmail-retries): New variable.
(smtpmail-via-smtp): Use it.
| -rw-r--r-- | doc/misc/smtpmail.texi | 7 | ||||
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/mail/smtpmail.el | 9 |
3 files changed, 17 insertions, 2 deletions
diff --git a/doc/misc/smtpmail.texi b/doc/misc/smtpmail.texi index b2fc90a337a..7fa7b24e162 100644 --- a/doc/misc/smtpmail.texi +++ b/doc/misc/smtpmail.texi | |||
| @@ -372,6 +372,13 @@ implement support for common requirements. | |||
| 372 | 372 | ||
| 373 | @table @code | 373 | @table @code |
| 374 | 374 | ||
| 375 | @item smtpmail-retries | ||
| 376 | @vindex smtpmail-retries | ||
| 377 | An SMTP server may return an error code saying that there's a | ||
| 378 | transient error (a @samp{4xx} code). In that case, smtpmail will try | ||
| 379 | to resend the message automatically, and the number of times it tries | ||
| 380 | before giving up is determined by this variable, which defaults to 10. | ||
| 381 | |||
| 375 | @item smtpmail-local-domain | 382 | @item smtpmail-local-domain |
| 376 | @vindex smtpmail-local-domain | 383 | @vindex smtpmail-local-domain |
| 377 | The variable @code{smtpmail-local-domain} controls the hostname sent | 384 | The variable @code{smtpmail-local-domain} controls the hostname sent |
| @@ -1164,7 +1164,8 @@ attempt when communicating with the SMTP server(s), the | |||
| 1164 | 1164 | ||
| 1165 | --- | 1165 | --- |
| 1166 | *** smtpmail will now try resending mail when getting a transient 4xx | 1166 | *** smtpmail will now try resending mail when getting a transient 4xx |
| 1167 | error message from the SMTP server. | 1167 | error message from the SMTP server. The new 'smtpmail-retries' |
| 1168 | variable says how many times to retry. | ||
| 1168 | 1169 | ||
| 1169 | ** Footnote mode | 1170 | ** Footnote mode |
| 1170 | 1171 | ||
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 57913c1f0f0..802c9ba788d 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el | |||
| @@ -165,6 +165,13 @@ attempt." | |||
| 165 | :type '(choice regexp (const :tag "None" nil)) | 165 | :type '(choice regexp (const :tag "None" nil)) |
| 166 | :version "27.1") | 166 | :version "27.1") |
| 167 | 167 | ||
| 168 | (defcustom smtpmail-retries 10 | ||
| 169 | "The number of times smtpmail will retry sending when getting transient errors. | ||
| 170 | These are errors with a code of 4xx from the SMTP server, which | ||
| 171 | mean \"try again\"." | ||
| 172 | :type 'integer | ||
| 173 | :version "27.1") | ||
| 174 | |||
| 168 | ;; End of customizable variables. | 175 | ;; End of customizable variables. |
| 169 | 176 | ||
| 170 | 177 | ||
| @@ -823,7 +830,7 @@ Returns an error if the server cannot be contacted." | |||
| 823 | ) | 830 | ) |
| 824 | ((and (numberp (car result)) | 831 | ((and (numberp (car result)) |
| 825 | (<= 400 (car result) 499) | 832 | (<= 400 (car result) 499) |
| 826 | (< send-attempts 10)) | 833 | (< send-attempts smtpmail-retries)) |
| 827 | (message "Got transient error code %s when sending; retrying attempt %d..." | 834 | (message "Got transient error code %s when sending; retrying attempt %d..." |
| 828 | (car result) send-attempts) | 835 | (car result) send-attempts) |
| 829 | ;; Retry on getting a transient 4xx code; see | 836 | ;; Retry on getting a transient 4xx code; see |