Re: getaddr confusion

Neil Romig <[email protected]> Thu, 21 Apr 2016 07:48:43 +0100
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
On Wed, 2016-04-20 at 19:20 -0400, Sam Varshavchik wrote:
> Neil Romig writes:
> 
> > I am using getaddr in .mailfilter to extract addresses:
> > 
> > if( /^From:\s*(.*)/:h )
> > {
> >  FRM=getaddr($MATCH1)
> > }
> > 
> > I have added log "$FRM" to the .mailfilter file to investigate, and
> > it
> > fails to extract the address from lines like this:
> > 
> > From: "Someone - Mailbox" <[email protected]>
> > 
> > But it will work with:
> > 
> > From: "Some One" <[email protected]>
> > 
> > I guess the hyphen is causing trouble - is this a bug or am I
> > failing
> > to understand?
> 
> Works for me.
> 
> logfile "mail.log"
> if( /^From:\s*(.*)/:h )
> {
>  FRM=getaddr($MATCH1)
> }
> 
> log "$FRM"
> 
> Results in:
> 
> 
> [email protected]
> 
> Date: Wed Apr 20 16:48:34 2016
> From: "Someone - Mailbox" <[email protected]>
> Subj: tst
> File: ./Maildir/.                                                    
>       
> (81)
> 
> 

I have had another email from this source which was filtered correctly
having picked up the From: as expected. I cannot see any obvious
difference in header structure between the one that failed and the next
that worked. Not sure what to do now other than keep an eye on
things.The header structure is (I have obfuscated as necessary):

Delivered-To: [email protected]
Return-Path: <[email protected]>
Received: from mr2.somewhere.co.uk ([::ffff:159.15.129.82])
  (TLS: TLSv1/SSLv3,256bits,DHE-RSA-AES256-GCM-SHA384)
  by pinnacle with ESMTPS; Wed, 20 Apr 2016 17:19:25 +0100
  id 0000000001C0005D.000000005717AC0D.00001B6A
Received: from localhost (localhost [127.0.0.1])
        by mr2.somwhere.co.uk (Postfix) with ESMTP id 359C914944
        for <[email protected]>; Wed, 20 Apr 2016 17:19:25 +0100
(BST)
Received: from mr2.somewhere.co.uk ([127.0.0.1])
        by localhost (mr2.somewhere.co.uk [127.0.0.1]) (amavisd-new,
port 10024)
        with ESMTP id TInqldd79Xay for <[email protected]>;
        Wed, 20 Apr 2016 17:19:24 +0100 (BST)
Received: by smtp.somewhere.co.uk (Postfix, from userid 1006)
        id B8C3A7E8049; Wed, 20 Apr 2016 17:19:03 +0100 (BST)
Received: by smtpgcsx.somewhere.co.uk (Postfix, from userid 1000)
        id B387024198A; Wed, 20 Apr 2016 17:19:02 +0100 (BST)
Received: from mail pickup service by somewhere.co.uk with Microsoft
SMTPSVC;
         Wed, 20 Apr 2016 17:19:02 +0100
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=_pinnacle-7018-1461169166
-0001-2"
Content-class: urn:content-classes:message
Subject: FW: Temporary Traffic Order - (TTRO1615372)
Date: Wed, 20 Apr 2016 17:19:01 +0100
Message-ID: <
8321DFDBEFCCAE43ABE02AB515CD7B5603080AD7@dschl72.ds.somewhere.co.uk>
In-Reply-To: <
C8C0AB20EFF2314E95D27D55605EF6643B5050F4@DS2CHL182.ds2.somewhere.co.uk>
Thread-Topic: Temporary Traffic Order - (TTRO1615372)
thread-index: AdGa4NfryBcuR1pISQCm6MH8pKix2AAP3XbA
From: "SomeOne - Mailbox" <[email protected]>
To: [email protected]

This is a MIME-formatted message.  If you see this text it means that
your
E-mail software does not support MIME-formatted messages.

--=_pinnacle-7018-1461169166-0001-2
Content-Type: multipart/alternative; boundary="=_pinnacle-7018
-1461169166-0001-3"


Unless you can see any obvious problems in the header I guess I will
have to wait and see if it happens again?

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