I'm a professional game developer from Wakefield, England, working for TickTock Games.
I'm a married father of five and I am also the director and lead programmer of Retroburn Ltd.
Martin 'Bytrix' Caine
All round web guy, games programmer and musician.
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 dr bott eidos elite force email deliverability eurogamer expo facebook focus fresnel game development game horizon game republic games gaming geoip 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 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 shadow racers sharks shoct skyrifters snds space cadet spam trap star trek steam storage super stock sd1 fr 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 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
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 (
mx4.hotmail.com (
mx3.hotmail.com (
mx.dca.untd.com (
mx.vgs.untd.com (
mx1.hotmail.com (

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 );

$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'
$matches );
  if( isset( 
$matches[1] ) )
$servers[strtolower($matches[1])] += $r['cnt'];

arsort$servers );

$servers as $server => $cnt )
$cnt<100 )
$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:


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:
David / 2015-05-22 13:29:15

I have a PMTA4 and Server with /27, (,, so this all ip in my server as a Additional Ip and main IP of the server is,
So i want to send a first 5000 email only with ip (bind with domain is ; abcd.com) after completing that email,
I want to send a Second email with another Ip is (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
Calver / 2015-09-23 14:24:38
Heres the best service I ever had on PowerMTA set up!!