small config.pl change

Michael Chaney mdchaney at MICHAELCHANEY.COM
Thu May 9 22:09:52 IST 2002


For config.pl:
358a359
>     s/^\*\.//; # and a "*." at the beginning of line
360c361
<     s/\s.*$//g; # Just use the first word
---
>     s/^([a-z0-9\-]+(?:\.[a-z0-9\-]+)+).*$/\1/i; # Just use the first domain

When using Exim, it's common to have a local domain map file, with
entries such as this:

*.michaelchaney.com:michaelchaney.com

So that if someone sends to mdchaney at mail.michaelchaney.com, I still get
it.  That file is also my only list of domain names, and I don't want to
have to duplicate the data.

The above minor changes to config.pl will strip off any leading "*.",
and then grab only the first domain name on the line.  The old code just
cuts off the first space and everything after it; this code accomplishes
the same thing in the opposite manner, which is to simply grab the first
valid domain name on the line.  However, this is far more generalized
because it only looks for the first character which isn't valid in a
domain name (actually, it also does some minor validation of the domain
name, too).

Michael
--
Michael Darrin Chaney
mdchaney at michaelchaney.com
http://www.michaelchaney.com/



More information about the MailScanner mailing list