Re: [exim] Regex or sg how

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Craig Jackson
Date:  
À: exim-users
Sujet: Re: [exim] Regex or sg how


-----Original Message-----
From: Phil Pennock [mailto:exim-users@spodhuis.org]
Sent: Monday, December 10, 2007 5:25 PM
To: Craig Jackson
Cc: exim-users@???
Subject: Re: [exim] Regex or sg how

On 2007-12-10 at 16:44 -0600, Craig Jackson wrote:
> Often a ehlo is of the the form server23.mx23.domain.com. I would like


> to record only domain.com from the ehlo into a database. This is what
> I have,


And then you need to deal with UK (example.co.uk, etc, so an extra
level) or US (example.gov.ca.us) and it gets even more hideous.

Exim is geared towards being an MTA with sufficient string handling to
make it flexible; databases are geared towards data manipulation and
storage, even if the former is often overlooked or has been historically
poorly implemented by certain popular free DBs.

Provided that you're using MySQL 5 or newer then you have access to
stored functions. Create one to normalise the domain names, then just
have Exim pass the entire domain via that procedure.

One advantage is that all your other support tools get access to the
exact same logic; when you update your list of "TLDs to go to N levels
for" then every client will benefit. No finding ways to code it in
various different client languages, or having to code it several times
over.

Relevant results found with the help of a search engine:
http://dev.mysql.com/doc/refman/5.0/en/stored-procedure-syntax.html

-Phil
.

Phil,

I have written a Mysql stored procedure to whitelist $recipients, by
parsing that variable. It did not occur to me to use a stored procedure
for this -- looks a lot harder to do.

Thanks.
Craig