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 -- ## List details at http://lists.exim.org/mailman/listinfo/exim-users ## Exim details at http://www.exim.org/ ## Please use the Wiki with this list - http://wiki.exim.org/
