1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 17:57:16 +00:00

Improved SMTP error message

This commit is contained in:
M66B 2021-01-12 11:59:45 +01:00
parent 9c77f3ea43
commit 41825ec2d6

View file

@ -41,6 +41,8 @@ import androidx.core.content.ContextCompat;
import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager;
import com.sun.mail.smtp.SMTPSendFailedException;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@ -628,6 +630,18 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
} catch (MessagingException ex) {
Log.e(ex);
if (ex instanceof SMTPSendFailedException) {
SMTPSendFailedException sem = (SMTPSendFailedException) ex;
ex = new SMTPSendFailedException(
sem.getCommand(),
sem.getReturnCode(),
getString(R.string.title_service_auth, sem.getMessage()),
sem.getNextException(),
sem.getValidSentAddresses(),
sem.getValidUnsentAddresses(),
sem.getInvalidAddresses());
}
if (sid != null)
db.message().deleteMessage(sid);