Improved SMTP error message

pull/191/head
M66B 4 years ago
parent 9c77f3ea43
commit 41825ec2d6

@ -41,6 +41,8 @@ import androidx.core.content.ContextCompat;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import com.sun.mail.smtp.SMTPSendFailedException;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
@ -628,6 +630,18 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
} catch (MessagingException ex) { } catch (MessagingException ex) {
Log.e(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) if (sid != null)
db.message().deleteMessage(sid); db.message().deleteMessage(sid);

Loading…
Cancel
Save