I think I am getting close to a setup I like for using TMDA with fetchmail.
My ISP sets an X-Original-To header (they use Postfix) when they deliver mail,
so I would use RECIPIENT_HEADER instead of environment variables for recipient
and extension.
However, once my local fetchmail gets through with it, the message has two of
them:
>From [EMAIL PROTECTED] Sun Jun 15 23:54:34 2003
Return-Path: <[EMAIL PROTECTED]>
X-Original-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: from localhost (localhost [127.0.0.1])
by chaos.obstruction.com (Postfix) with ESMTP id BBC6C5C55
for <[EMAIL PROTECTED]>; Sun, 15 Jun 2003 23:54:34 -0400 (EDT)
X-Original-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
So, my question and possible suggestion: is there any reason not to use the
last occurrence of the RECIPIENT_HEADER line, rather than the first? The
change would be something like this:
--- tmda-rfilter 2003/06/15 01:44:14 1.1
+++ tmda-rfilter 2003/06/16 05:31:59
@@ -177,7 +177,7 @@
# Use Defaults.RECIPIENT_HEADER instead if set.
recipient_header = None
if Defaults.RECIPIENT_HEADER:
- recipient_header = parseaddr(msgin.get(Defaults.RECIPIENT_HEADER))[1]
+ recipient_header = parseaddr(msgin.get_all(Defaults.RECIPIENT_HEADER)[-1])[1]
envelope_recipient = (recipient_header or os.environ.get('RECIPIENT'))
if envelope_recipient == None:
raise Errors.MissingEnvironmentVariable('RECIPIENT')
Is there anything that would break because of this change?
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users