From: martin f. krafft Date: Sun, 7 Oct 2007 15:06:39 +0000 (+0100) Subject: error on encounter of an unknown header slot X-Git-Tag: mailplate-0.1~6 X-Git-Url: https://git.madduck.net/code/mailplate.git/commitdiff_plain/e53817196aa481ca2f29d1eae9c3ac9e7ed52531 error on encounter of an unknown header slot --- diff --git a/mailplate b/mailplate index 0cceef1..c7a02b9 100755 --- a/mailplate +++ b/mailplate @@ -415,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()