summaryrefslogtreecommitdiff
path: root/alot/commands/envelope.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-12-20 09:04:23 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2011-12-20 09:13:33 +0000
commit88c03aa51bc945f708db32906d4e0940f7dbb90f (patch)
tree4c1b70dbad77ef7aae16901799416632630a5628 /alot/commands/envelope.py
parent181b278dcfb02f5906b3536ea6c4463c35534fff (diff)
don't introduce unnecessary spaces
this finalizes issue #135
Diffstat (limited to 'alot/commands/envelope.py')
-rw-r--r--alot/commands/envelope.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index b8cc3557..21b6aa26 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -1,4 +1,5 @@
import os
+import re
import glob
import logging
import email
@@ -198,8 +199,9 @@ class EditCommand(Command):
del self.envelope[key]
for value in vlist:
- # remove newlines in values
- value = value.replace('\n', ' ')
+ # newlines (with surrounding spaces) by spaces in values
+ value = value.strip()
+ value = re.sub('[ \t\r\f\v]*\n[ \t\r\f\v]*', ' ', value)
headertext += '%s: %s\n' % (key, value)
bodytext = self.envelope.body