Discussion:
[maildropl] getaddr confusion
Neil Romig
2016-04-20 12:03:28 UTC
Permalink
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" <***@somewhere.co.uk>

But it will work with:

From: "Some One" <***@somewhere.co.uk>

I guess the hyphen is causing trouble - is this a bug or am I failing
to understand?

Regards,

Neil.
ed
2016-04-20 13:01:54 UTC
Permalink
Post by Neil Romig
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.
--
Best regards,
Ed http://www.s5h.net/
Neil Romig
2016-04-20 13:52:31 UTC
Permalink
Post by ed
Post by Neil Romig
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.
Sam Varshavchik
2016-04-20 23:20:51 UTC
Permalink
Post by Neil Romig
if( /^From:\s*(.*)/:h )
{
FRM=getaddr($MATCH1)
}
I have added log "$FRM" to the .mailfilter file to investigate, and it
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:


***@somewhere.co.uk

Date: Wed Apr 20 16:48:34 2016
From: "Someone - Mailbox" <***@somewhere.co.uk>
Subj: tst
File: ./Maildir/.
(81)
Neil Romig
2016-04-21 06:48:43 UTC
Permalink
Post by Sam Varshavchik
Post by Neil Romig
if( /^From:\s*(.*)/:h )
{
FRM=getaddr($MATCH1)
}
I have added log "$FRM" to the .mailfilter file to investigate, and it
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"
Date: Wed Apr 20 16:48:34 2016
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: ***@mydomain.co.uk
Return-Path: <***@somewhere.co.uk>
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 <***@mydomain.co.uk>; 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 <***@mydomain.co.uk>;
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: <
***@dschl72.ds.somewhere.co.uk>
In-Reply-To: <
***@DS2CHL182.ds2.somewhere.co.uk>
Thread-Topic: Temporary Traffic Order - (TTRO1615372)
thread-index: AdGa4NfryBcuR1pISQCm6MH8pKix2AAP3XbA
From: "SomeOne - Mailbox" <***@somewhere.co.uk>
To: ***@mydomain.co.uk

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.
Neil Romig
2016-04-22 08:49:47 UTC
Permalink
Post by Neil Romig
Post by Sam Varshavchik
Post by Neil Romig
if( /^From:\s*(.*)/:h )
{
FRM=getaddr($MATCH1)
}
I have added log "$FRM" to the .mailfilter file to investigate, and it
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"
Date: Wed Apr 20 16:48:34 2016
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
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
Received: from mr2.somewhere.co.uk ([127.0.0.1])
by localhost (mr2.somewhere.co.uk [127.0.0.1]) (amavisd-new, port 10024)
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
Thread-Topic: Temporary Traffic Order - (TTRO1615372)
thread-index: AdGa4NfryBcuR1pISQCm6MH8pKix2AAP3XbA
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.
As a follow-up, I have had another instance of getaddr failing - it extracted 'tapmagi' from 'tapmagic faucet <***@tapmagic.ie>'

Something is not working properly, though where the problem lies I cannot guess!

Neil.
ed
2016-04-22 11:38:03 UTC
Permalink
Post by Neil Romig
As a follow-up, I have had another instance of getaddr failing - it
Something is not working properly, though where the problem lies I cannot guess!
Do you have the original mail, and if so, can you reproduce the problem
by catting it to /usr/lib/sendmail -***@yourdomain
***@yourdomain?

Ed
Neil Romig
2016-04-22 12:16:15 UTC
Permalink
Post by ed
Post by Neil Romig
As a follow-up, I have had another instance of getaddr failing - it
Something is not working properly, though where the problem lies I cannot guess!
Do you have the original mail, and if so, can you reproduce the problem
Ed
The issue is repeatable using sendmail - though this time around nothing is matched.
Now I am looking closely at the issue, I have several other messages that also fail to produce the expected matching.
I have logged both $MATCH1 and getaddr($MATCH1) for the catted message and nothing appears in the logfile where I would expect the address (or at least something).
Since it is not a sensitive message I have put it below (only changing my private email address) so you can try it if you wish.

Return-Path: <***@tapmagic.ie>
Received: from mail-ig0-f173.google.com ([::ffff:209.85.213.173])
(TLS: TLSv1/SSLv3,128bits,AES128-GCM-SHA256)
by pinnacle with ESMTPS; Thu, 21 Apr 2016 08:51:32 +0100
id 0000000001C002A5.0000000057188684.00003D8C
Received: by mail-ig0-f173.google.com with SMTP id f1so150268553igr.1
for <***@xxxxxxxxxxxxxxx.co.uk>; Thu, 21 Apr 2016 00:51:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=tapmagic-ie.20150623.gappssmtp.com; s=20150623;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to;
bh=8GwcUrgVXcSvbH9Yn04IH7khPyzzzTWUnbh5JhaaDgQ=;
b=pLj489vySIyro2b5FzkzEfHiEAIk78vX4qlhIAtmm3yO//JkjGIUm+Z0Vc5Ia+N7dt
jDx1d9ka72QGCbPFS6llxr4rJPfgLvewBCtrTQW2+YfH50ljVFp/5uB4idrp0Rc+nuEF
LJ/broErbJ8ozAtdFtCkT1ptBq1y9m1649WlP+jnfWgofUSvFj4Pa2C4QZHMVDb7KR3/
nvry51w594hmWSiLikw1JxAjSjxt8c2fBnkQiwFSNS76w0baBy6qbIm2pXrxIi3q7ZcR
Ei7J6Vg1FggfWh5pH741em6bGauWXofPlzXzCPURi50KTLDt5IUQlJFb58pcyKkhaHik
jBcQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:mime-version:in-reply-to:references:date
:message-id:subject:from:to;
bh=8GwcUrgVXcSvbH9Yn04IH7khPyzzzTWUnbh5JhaaDgQ=;
b=fKnLsNiEkqEXTQpegLSMEiIPO3C2XFJ/UA6UOqBtTMCjrBzCw2HQLGx4kROj5WBvId
N6R5D3cfaj6+mkJsX1dAj3DWS+3hNVjtaqiLGmFRWvgIEy65OyIflSHvjXfWZqLXHdK0
hCnHk1jrcvIS91YWCCWg1SpLjQHq1LnWoz2ypXYvTJwJ6qt9dfNP70hP2lqW9JasZ1kW
ynW8iHj8p99HZi8c4/MVpnA/SJtSQzvW+sXY2lOCjWFtWUPbQRZHBbWVn8kaIgmwcQOh
aEyJGsmeDCck0bGD5V2TfFxWELC6Cr9RsipZtXOnleKcqTffuukdLoepaU4fjnG+cttj
GmUQ==
X-Gm-Message-State: AOPr4FW+CDmR0rfgfF1hq0iUPsZ/5JoqyRVXSaiOZBYmVfl2Uba6eBB5lb0+5Z8MLof96BRNHVKk01HH9YdBEg==
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="=_pinnacle-15756-1461225092-0001-2"
X-Received: by 10.50.109.138 with SMTP id hs10mr1909809igb.76.1461225090911;
Thu, 21 Apr 2016 00:51:30 -0700 (PDT)
Received: by 10.64.78.69 with HTTP; Thu, 21 Apr 2016 00:51:30 -0700 (PDT)
X-Originating-IP: [86.41.187.118]
In-Reply-To: <***@xxxxxxxxxxxxxxx.co.uk>
References: <***@xxxxxxxxxxxxxxx.co.uk>
<CAACS93DF16xe8RGEnk+tNBOCaJpMua4p3Zn-***@mail.gmail.com>
<***@xxxxxxxxxxxxxxx.co.uk>
Date: Thu, 21 Apr 2016 08:51:30 +0100
Message-ID: <CAACS93DMGNc+s8EcDsTVpV+ANcFJCebhi=***@mail.gmail.com>
Subject: Re: D8 Tap
From: tapmagic faucet <***@tapmagic.ie>
To: Neil Romig <***@xxxxxxxxxxxxxxx.co.uk>

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-15756-1461225092-0001-2
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Hi Neil,

I dont have exact measurements at hand just now but im sure its approx 13"
from base of sink to top of spout it has a standard 15 mm shaft for fitting
.

Regards Shauna
Post by ed
Shauna,
Thanks, could you also tell me the overall height of the D8 & D7 and
whether they come ready to connect to 15mm pipes?
Regards,
Neil.
Hi Neil,
Yes Model D8 will fit standard sink and give you a choice of both hot and
cold water.
Regards Shauna
Hi,
I am looking at your D8 tap to replace a Galaxy Aqua 3XL water heater &
cold tap combination. We do not need cold water at the sink, so I would
just like to be sure the D8 will fit into the single hole in the washroom
sink which currently is fitted with a standard cold water tap.
Regards,
Neil Romig.
--=_pinnacle-15756-1461225092-0001-2
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Neil,<div><br></div><div>I dont have exact measurements=
at hand just now but im sure its approx 13&quot; from base of sink to top =
of spout it has a standard 15 mm shaft for fitting .=C2=A0</div><div><br></=
div><div>Regards Shauna</div></div><div class=3D"gmail_extra"><br><div clas=
s=3D"gmail_quote">On Wed, Apr 20, 2016 at 10:34 AM, Neil Romig <span dir=3D=
"ltr">&lt;<a href=3D"mailto:***@xxxxxxxxxxxxxxx.co.uk" target=3D"_blank">=
***@xxxxxxxxxxxxxxx.co.uk</a>&gt;</span> wrote:<br><blockquote class=3D"g=
mail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div><div>Shauna,</div><div><br></div><div>Thanks, could you also =
tell me the overall height of the D8 &amp; D7 and whether they come ready t=
o connect to 15mm pipes?</div><div><br></div><div>Regards,</div><div><br></=
div><div>Neil.</div><div><div class=3D"h5"><div><br></div><div>On Wed, 2016=
-04-20 at 10:19 +0100, tapmagic faucet wrote:</div><blockquote type=3D"cite=
"><div dir=3D"ltr">Hi Neil,<div><br></div><div>Yes Model D8 will fit standa=
rd sink and give you a choice of both hot and cold water.</div><div><br></d=
iv><div>Regards Shauna</div></div><div class=3D"gmail_extra"><br><div class=
=3D"gmail_quote">On Wed, Apr 20, 2016 at 10:15 AM, Neil Romig <span dir=3D"=
ltr">&lt;<a href=3D"mailto:***@xxxxxxxxxxxxxxx.co.uk" target=3D"_blank">a=
***@xxxxxxxxxxxxxx.co.uk</a>&gt;</span> wrote:<br><blockquote type=3D"cit=
e"><div><div>Hi,</div><div><br></div><div>I am looking at your D8 tap to re=
place a Galaxy Aqua 3XL water heater &amp; cold tap combination. We do not =
need cold water at the sink, so I would just like to be sure the D8 will fi=
t into the single hole in the washroom sink which currently is fitted with =
a standard cold water tap.</div><div><br></div><div>Regards,</div><div><br>=
</div><div>Neil Romig.<br></blockquote></div><br></div>
</div><br></div>

--=_pinnacle-15756-1461225092-0001-2--

Neil.
Neil Romig
2016-05-17 09:14:14 UTC
Permalink
Post by Neil Romig
Post by ed
Post by Neil Romig
As a follow-up, I have had another instance of getaddr failing - it
Something is not working properly, though where the problem lies I cannot guess!
Do you have the original mail, and if so, can you reproduce the problem
Ed
The issue is repeatable using sendmail - though this time around nothing is matched.
Now I am looking closely at the issue, I have several other messages that also fail to produce the expected matching.
I have logged both $MATCH1 and getaddr($MATCH1) for the catted message and nothing appears in the logfile where I would expect the address (or at least something).
Since it is not a sensitive message I have put it below (only changing my private email address) so you can try it if you wish.
Received: from mail-ig0-f173.google.com ([::ffff:209.85.213.173])
(TLS: TLSv1/SSLv3,128bits,AES128-GCM-SHA256)
All quiet on the reply front...

am I the only one having problems with maildrop filtering?

Neil.

Loading...