[Mimedefang] Enumerate Email Address parts

David F. Skoll dfs at roaringpenguin.com
Wed Feb 3 09:31:36 EST 2010


Joseph Brennan wrote:

> There is of course "more than one way to do it", but here's one:
> my ($localpart,$domainpart) = split('@',$Sender);

/me waits for D. Stussy to point out the 100+ ways that can go wrong...

But seriously, that's going to work fine in practice.  I'd tweak it
just a tiny bit:

my ($localpart, $domainpart) = split(/@/, $Sender, 2);

and also... be sure to check that $domainpart is defined.  Depending
on your Sendmail setup, Sendmail may accept:

   MAIL FROM:<user>

as valid.

Regards,

DAvid.



More information about the MIMEDefang mailing list