Added SMTP DSN

This commit is contained in:
M66B 2020-09-05 15:52:28 +02:00
parent b1794c6086
commit 532930b710
2 changed files with 11 additions and 0 deletions

View File

@ -263,6 +263,11 @@ public class EmailService implements AutoCloseable {
properties.put("mail.mime.allowutf8", Boolean.toString(value));
}
// https://tools.ietf.org/html/rfc3461
void setDsnNotify(String what) {
properties.put("mail." + protocol + ".dsn.notify", what);
}
void setListener(StoreListener listener) {
this.listener = listener;
}

View File

@ -584,6 +584,12 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
iservice.setUseIp(ident.use_ip, ident.ehlo);
iservice.setUnicode(ident.unicode);
if (message.receipt_request != null && message.receipt_request) {
int receipt_type = prefs.getInt("receipt_type", 2);
if (receipt_type == 1 || receipt_type == 2) // Delivery receipt
iservice.setDsnNotify("SUCCESS,FAILURE,DELAY");
}
// Connect transport
db.identity().setIdentityState(ident.id, "connecting");
iservice.connect(ident);