mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
Implement immediate failing for x.1.1 and x.1.2 status codes too.
This commit is contained in:
21
src/job.rs
21
src/job.rs
@@ -291,13 +291,20 @@ impl Job {
|
|||||||
// We got a transient 4xx response from SMTP server.
|
// We got a transient 4xx response from SMTP server.
|
||||||
// Give some time until the server-side error maybe goes away.
|
// Give some time until the server-side error maybe goes away.
|
||||||
|
|
||||||
|
if let Some(first_word) = response.first_word() {
|
||||||
if response.first_word() == Some("4.1.2") {
|
if first_word.ends_with(".1.1")
|
||||||
// Sometimes we receive the 4.1.2 error, which stays for "Bad destination system address"
|
|| first_word.ends_with(".1.2")
|
||||||
// or more simple, the domain doesn't exist or is invalid. This should be a permanent error
|
|| first_word.ends_with(".1.3")
|
||||||
// and fail immediatly.
|
{
|
||||||
info!(context, "Smtp-job #{} is a transient \"bad destination\" error. Lets let it fail immediatly.", self.job_id);
|
// Sometimes we receive transient errors that should be permanent.
|
||||||
Status::Finished(Err(format_err!("Permanent SMTP error: {}", err)))
|
// Any extended smtp status codes like x.1.1, x.1.2 or x.1.3 that we
|
||||||
|
// receive as a transient error are misconfigurations of the smtp server.
|
||||||
|
// See https://tools.ietf.org/html/rfc3463#section-3.2
|
||||||
|
info!(context, "Smtp-job #{} Received extended status code {} for a transient error. This looks like a misconfigured smtp server, let's fail immediatly", self.job_id, first_word);
|
||||||
|
Status::Finished(Err(format_err!("Permanent SMTP error: {}", err)))
|
||||||
|
} else {
|
||||||
|
Status::RetryLater
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Status::RetryLater
|
Status::RetryLater
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user