Re: getaddr confusion
Neil Romig <[email protected]> Wed, 20 Apr 2016 14:52:31 +0100
| Newsgroups | gmane.mail.maildrop |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2016-04-20 at 14:01 +0100, ed wrote:
> On Wed, Apr 20, 2016 at 01:03:28PM +0100, Neil Romig wrote:
> > I am using getaddr in .mailfilter to extract addresses:
> >
> > if( /^From:\s*(.*)/:h )
> > {
> > FRM=getaddr($MATCH1)
> > }
> > ...
> > I guess the hyphen is causing trouble - is this a bug or am I
> > failing
> > to understand?
>
> May I ask which MTA are you using? Personally, I have found the
> following works ok and doesn't require parsing the (arguably) more
> complex From: header.
>
> import RECIPIENT
> import SENDER
> logfile "/home/username/maildrop.log"
> log "$SENDER $RECIPIENT storing in inbox"
>
> The benefit here is that the MTA should set SENDER and RECIPIENT
> environments which maildrop can then read and use in the log
> statement.
>
> Been using this for many years without problem.
>
I am using a standard Courier install on Debian 8 to provide all my
needs. It is presently only one email source that is giving me trouble,
though I cannot see anything wrong in the mail message, but it is the
only one with both double quotes and a hyphen in the comment between
From: and the <address>. Other messages with hyphens and without quotes
are extracted properly...
I have tried $SENDER but it picks up Return-Path: so I will have to
check which messages have different Return-Path: and From: and why!
Neil.
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z