Re: getaddr confusion

Sam Varshavchik <[email protected]> Wed, 20 Apr 2016 19:20:51 -0400
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
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)

------------------------------------------------------------------------------
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

_______________________________________________
Courier-maildrop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAABAgAGBQJXGA7TAAoJEGs6Yr4nnb8lr40QAKu/3GxlZO8UXn6o4So5Da7d
gJsWeRd2qTEXrUvvcf4w+Anbgiq+skqvHkJ6WPNgadyy94vZ03guhpdrdYdGtWAu
WG5OtQFH//Ql64V2vxO9gArnBg+a5cfdPBKzSLdIC+cQZYZSHIkxVTdqR66nBrBs
KP3Gtkjd+mWVZX1k6n7/UPeSHFpxaeafxvxrof2m0+A2+7R/FNlkN1nDQGu03lm4
1CyiKCH9oVqDnrMJ/6DZx8CG4YQ9qMMcentbS9j4was4RD3TCVi/aKWlk/PpveQm
BERAxf+Bp3gEOx2fX1HUbiLeuAEbknNMFGdATCsbsQLK9KH+jlFZsZOkTfsCe+sA
su8Z8uHob9mnQSlEhkcwivGrH+SCQZADplodKQfoyvn1JwMJF/27QsnBeSSn78Wf
zV0c+oIERu/wuzbras0NokLYywCLU7LB9VwUpsH/GKbKJBH6ZYdDnMfO8pF+EGsB
XjJKizZjL/0aSjuNLF9w60ByruY75Gx6AYxjCauJowoAygJHX2vD1dgbs69whiZP
iNyBh3Y1wPEFjeI3hc1dfvedckA4/xmHUDETefeoZgK3peHkuiUZ9HJVcaR9+7tj
YjxP5snEAWiP6yVHapL+IKlcaQdCahO2ipBjkxGGrN7sLT9aEli56X66x3ofPSAp
gLgrSv+S+k6K6G/R3lje
=TJlp
-----END PGP SIGNATURE-----