mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-31 10:01:22 +01:00
Show send state/errors
This commit is contained in:
@@ -978,7 +978,10 @@ public class ServiceSynchronize extends LifecycleService {
|
||||
Transport itransport = isession.getTransport(ident.starttls ? "smtp" : "smtps");
|
||||
try {
|
||||
// Connect transport
|
||||
db.identity().setIdentityState(ident.id, "connecting");
|
||||
itransport.connect(ident.host, ident.port, ident.user, ident.password);
|
||||
db.identity().setIdentityState(ident.id, "connected");
|
||||
db.identity().setIdentityError(ident.id, null);
|
||||
|
||||
// Send message
|
||||
Address[] to = imessage.getAllRecipients();
|
||||
@@ -1013,8 +1016,15 @@ public class ServiceSynchronize extends LifecycleService {
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
} catch (MessagingException ex) {
|
||||
db.identity().setIdentityError(ident.id, Helper.formatThrowable(ex));
|
||||
throw ex;
|
||||
} finally {
|
||||
itransport.close();
|
||||
try {
|
||||
itransport.close();
|
||||
} finally {
|
||||
db.identity().setIdentityState(ident.id, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user