summaryrefslogtreecommitdiff
path: root/alot/commands/globals.py
diff options
context:
space:
mode:
authorLucas Hoffmann <l-m-h@web.de>2017-01-24 10:41:10 +0100
committerLucas Hoffmann <l-m-h@web.de>2017-01-25 11:32:58 +0100
commit119d77addb716b4bede63fb59677f585558669c8 (patch)
treeda13c6945478ca2ad1b3782f9cb4ccc2310d9069 /alot/commands/globals.py
parent678211e4103e47ec8af2394da0d33b7a3903a921 (diff)
Use email.utils.formataddr when preparing headers
Diffstat (limited to 'alot/commands/globals.py')
-rw-r--r--alot/commands/globals.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index d05bdfcc..ef085259 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -6,6 +6,7 @@ from __future__ import absolute_import
import argparse
import code
import email
+import email.utils
import glob
import logging
import os
@@ -805,7 +806,7 @@ class ComposeCommand(Command):
accounts = settings.get_accounts()
if len(accounts) == 1:
a = accounts[0]
- fromstring = "%s <%s>" % (a.realname, a.address)
+ fromstring = email.utils.formataddr((a.realname, a.address))
self.envelope.add('From', fromstring)
else:
cmpl = AccountCompleter()