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:
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