I'm a professional game developer from Wakefield, England, working as a senior programmer for Rebellion North.
I'm a married father of five and I a also sometimes do Retroburn stuff.
Martin 'Bytrix' Caine
Father. C++ Games Programmer. Cyclist. Guitarist.
emailfacebooktwittermessengersteamxboxliveretroburn
Tags
2013 3d alphalabs amazon apple archivirtual asynchronous battlefield bad company 2 ben 10 bepu beta blackmagic design blog blue marble bootcamp borderlands bsp calibration charity charvel childsplay comments competition content tracker counter-strike crash csgo css3 cycling dear esther deferred deus ex develop conference direct x discipline documentation doom 3 bfg dpi dr bott eidos elite force email deliverability eurogamer expo facebook focus fresnel game development game horizon game republic gamedev games gaming geoip girls make games global offensive grid guitar half-life 2 hawken hd7 hobbyist htc humble indie bundle imac indie indie trials indietrials intensity pro ip-countryside iron man 3 jamulus rift jquery kids kinect launch conference left 4 dead live lost mac mac osx manchester manhacks mass effect 2 matrox maya minecraft mirrors edge montreal morrowind movies museum of the microstar music mxo2 mini mysql nausea network networking nokia normal mapping obj oculus rift omnitrix ouya pedal for pounds php physics playstation suite port25 portal portal 2 positron posters powermta project aedra project euler promotion properties proton pulse ps vita ps4 psn racer reddit rendering retroburn game studios reviews rift racer riftracer roadkill roller coaster sdl2 shadow racers sharks shoct skyrifters snds space cadet spam trap star trek steam stencyl storage super stock sd1 fr superhot team fortress 2 tesselating tesselation texture editor thunderbird thunderclap ticktock games tiga track builder track bulder trials tv twitter uk ultimatrix usergroup vequencer video vireio visual assist visual studio vorpx voucher vr vr cinema war thunder warren web willow windows 8 windows 8.1 windows phone 7 workbench wp7 wp7dev xbla xblig xblig network xbox xbox live indie games xna xnaukug xperia play zombies on the holodeck
Archive
Links
Web
XNA
Games
Email Deliverability
Tuesday, June 28th 2011 / Blog

Improving PowerMTA Domain Macros - Part One

If you've ever seen DSNs saying 'temporarily deferred' or 'too many recipients' it's likely you're sending too many emails to a particular MX server or ISP. You should make use of PowerMTA's backoff mode if you see these errors to slow down your sending speeds to a point which the ISP is willing to accept.

A problem arises however when multiple domains are hitting the same ISP or MX servers. In general, most domains are configured individually within PowerMTA using <domain> and <virtual-mta> directives, now what we want to do is group all domains that belong to a certain ISP, or those which use the same MX servers (and get delivered via the same mail system).

This is where Domain Macros come in, they're pretty easy to understand but for them to work as optimally as possible you want to make sure you get every last domain in the macro.

Here's an example macro for hotmail:

domain-macro hotmail hotmail.com, live.com, msn.com

Using a <domain $hotmail> block in our config will apply specific settings to the three domains listed in the hotmail macro, grouped under the $hotmail name.

Now we all know there are many more domains and TLDs that hotmail use, the question is how can we identify them?

The way I chose to do this was using my own accounting data. Using the dsnMta field we have the name of the MX server which handled a particular transaction. The following is a small excerpt of my accounting data showing the dsnMta field:

mx1.bt.mail.yahoo.com (195.50.106.142)
mx4.hotmail.com (65.55.92.152)
mx3.hotmail.com (65.55.37.72)
mx.dca.untd.com (64.136.44.37)
mx.vgs.untd.com (64.136.52.37)
mx1.hotmail.com (65.54.188.110)

By grabbing the entire list of MX server names, then extracting the domain parts (eg: hotmail.com, yahoo.com, untd.com) we can build a top level list of receiving servers and networks (assuming all MX servers ending in the same domain name serve the same system, which may not always be the case).

The PHP script below is the one I use to identify each of these domains from the dsnMta field. Note that I have my PowerMTA accounting data stored in a MySQL database but you can do the same with a shell script using the common GNU tools:


<?
// dsnmta.php | PowerMTA dsnMta grouping script (using MySQL)
// Written by Martin Caine, 2011-06-28 (martin@martincaine.com)       
// ------------------------------------------------------------------ //

$link mysql_connect'#host#''#root#''#pass#' );

$sql 'SELECT `dsnMta`, COUNT( * ) AS cnt
                FROM `#database#`.`#table#`
                GROUP BY `dsnMTA`
                ORDER BY `cnt` DESC'
;
$q mysql_query$sql );

while( 
$r mysql_fetch_assoc$q ) )
{
    
$p preg_match'/([a-z0-9\-]+\.(com\.[a-z]{2}|net\.[a-z]{2}|[a-z]{2}\.[a-z]{2}|[a-z]{2}|[a-z]{3})) /i'
                                     
$r['dsnMta'],
                                     
$matches );
    if( isset( 
$matches[1] ) )
    {
        
$servers[strtolower($matches[1])] += $r['cnt'];
    }
}

arsort$servers );

foreach( 
$servers as $server => $cnt )
{
    if( 
$cnt<100 )
    {
        break;
    }
    echo 
$server.'<br />';
}

mysql_close$link );
?>


The script will output a simplified list of the domain parts extracted from the data held in the dsnMta field. This is ordered with the most common domain appearing first, so the domains towards the top of the list are the ones you should be looking in to. These MX servers sometimes handle mail for domains which you just wouldn't expect and running these tests will help us identify and group them. Here is an excerpt of the output given when I run this script through a sample of my own accounting data:

yahoo.com
hotmail.com
google.com
untd.com
att.net
comcast.net
yahoodns.net
prodigy.net
aol.com
bigpond.com
earthlink.net
tiscali.co.uk
psmtp.com
rr.com
tesco.net
onet.pl
optusnet.com.au
freeserve.com
optonline.net
messagelabs.com
verizon.net
mimecast.com
fsmail.net
dodo.com.au
btconnect.com

Next we move on to actually identifying domains which are using each of these groups of MX servers to handle their mail.

We begin that process in Part Two of the series.

If you found this post helpful please leave a comment below:
 
Comments
David / 2015-05-22 13:29:15
Hello,

I have a PMTA4 and Server with /27, (192.168.10.1, 192.168.10.2, 192.168.10.3.....30) so this all ip in my server as a Additional Ip and main IP of the server is

192.168.10.0,
So i want to send a first 5000 email only with ip 192.168.10.9 (bind with domain is ; abcd.com) after completing that email,
I want to send a Second email with another Ip is 192.168.10.16 (bind with domain is ; Pqrs.com) after completing that email...
doing So on with all individual IP's ......

so i need a 30 smtp with 30ip and 30 domain in PMTA.

How can i do that with my Powermta4.

if you want PM me via mail : davidfannylove@gmail.com
Skype : david.fanny8
Thank's
Calver / 2015-09-23 14:24:38
Heres the best service I ever had on PowerMTA set up!!
https://contacthd.com/discussion/5/are-you-looking-for-power-mta-pmta-setup
2