mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 14:26:30 +03:00
Process Permanent and Transient SMTP errors
This commit is contained in:
committed by
holger krekel
parent
4b6963122b
commit
840e321dd9
14
src/job.rs
14
src/job.rs
@@ -207,6 +207,20 @@ impl Job {
|
||||
res = Status::RetryNow;
|
||||
}
|
||||
}
|
||||
|
||||
match err {
|
||||
async_smtp::smtp::error::Error::Permanent(_) => {
|
||||
res = Status::Finished(Err(format_err!("Permanent SMTP error: {}", err)))
|
||||
}
|
||||
async_smtp::smtp::error::Error::Transient(_) => {
|
||||
// We got a 4xx response from SMTP server.
|
||||
// Do not retry right now, wait until the error resolves on the server
|
||||
// side.
|
||||
res = Status::RetryLater;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
// this clears last_success info
|
||||
smtp.disconnect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user