[Mimedefang] MIMEDefang Notification

Jon Rowlan jon.rowlan at sads.com
Tue Dec 9 14:06:54 EST 2014

Hi all,

In a post back in 2011 Larry Starr referred to using 


to verify email addresses ahead.


in this he has this line:

if( $relaydomains{$domain} =~ /^smtp:\[(.+)\]/){

This reads a the value of a hash, it essentially takes the square
bracketed mailertable entry to interpret the server to contact to check
for a valid user.

This works fine for 1 destination server but in some environments there
may be a number of servers available to authenticate against, an MS
Exchange network for example may have multiple Hub Transport servers.

I wanted to extend this to include multiple MX which are defined thus:

Domain.com      esmtp:[]:[]

And I thought that I had correctly figured the regex required would be:


By taking out the escaped close square bracket then the match should be
for a string that begins


With an undetermined number of any characters on the end.

Then the plan was to split based upon the colon character.

I have been unable to get this to work and trying to use DB_File in the
way I would normally treat hash tables and disk files keeps telling me
that my code is not blessed .... which I wold have thought is something
that I would hear about in church!

Has anyone managed to extend this excellent logic, which works perfectly
for single MX, to allow for multiple MX ?

Many thanks all,


More information about the MIMEDefang mailing list