From 5df7871f11dd694d45aad89f28a680cb46e57c52 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Wed, 10 Oct 2018 15:39:08 +0200 Subject: Improve error notification on failing sendmail --- alot/account.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'alot/account.py') diff --git a/alot/account.py b/alot/account.py index a28519d1..c8f3c09a 100644 --- a/alot/account.py +++ b/alot/account.py @@ -350,7 +350,9 @@ class SendmailAccount(Account): # make sure self.mail is a string out, err, code = await call_cmd_async(cmdlist, stdin=str(mail)) if code != 0: - raise Exception + msg = 'The sendmail command {} returned with code {}{}'.format( + self.cmd, code, ':\n' + err.strip() if err else '.') + raise Exception(msg) except Exception as e: logging.error(str(e)) raise SendingMailFailed(str(e)) -- cgit v1.2.3