X-Git-Url: https://git.madduck.net/code/mailplate.git/blobdiff_plain/08674f5191c95221b9e3a3d348913d1b2e916d17..ba56a1d6aecd2ea6a374db7061265f042333390f:/mailplate diff --git a/mailplate b/mailplate index 4b03c05..c7a02b9 100755 --- a/mailplate +++ b/mailplate @@ -86,6 +86,7 @@ HELPER_SLOT_TRAILER = ')' # character ending a helper slot STD_HEADERS = ('From', 'To', 'Cc', 'Bcc', 'Subject', 'Reply-To', 'In-Reply-To') KEEP_HEADERS = { 'KEEP_FROM_HEADER' : STD_HEADERS[:1] , 'KEEP_STD_HEADERS' : STD_HEADERS[1:] + , 'KEEP_ALL_HEADERS' : STD_HEADERS } SIG_DELIM='\n-- \n' @@ -414,10 +415,14 @@ for line in templ: l = line[:-1] if len(l) == 0: payload = '' # end of headers - elif l[0] == KEEP_SLOT_LEADER and KEEP_HEADERS.has_key(l[1:]): - # found predefined header slot keyword - for header in KEEP_HEADERS[l[1:]]: - headers[header.lower()] = (header, _keep_header) + elif l[0] == KEEP_SLOT_LEADER: + if KEEP_HEADERS.has_key(l[1:]): + # found predefined header slot keyword + for header in KEEP_HEADERS[l[1:]]: + headers[header.lower()] = (header, _keep_header) + else: + err('unknown header slot ' + l + ' found') + sys.exit(posix.EX_CONFIG) else: header, content = l.split(':', 1) content = content.strip() @@ -495,3 +500,4 @@ if options.edit: sys.exit(posix.EX_USAGE) os.execlp('sensible-editor', 'sensible-editor', outfname) +