Dec 062010

This time i’ll show you how to randomize your smtp outbound’s IP addresses. This can be done via transport map. But, since ordinary Postfix lookup tables store information as (key, value) pairs. it will provide static value only. we need someting that can manipulate the value (right hand side) of a lookup table. In order to answer random transport value.

first come to mind was tcp_tables, tcp_tables lookup table gives some flexibility for us to execute our tiny perl script that will randomizing transport. that’s the basic idea.

Ok, here’s the first part, create perl script call, anyway this script only provide answer in “catch-all” manner. so it will randomized, all outgoing mail.

# cd /etc/postfix
# vi
#!/usr/bin/perl -w
# author: Hari Hendaryanto <hari.h -at->

use strict;
use warnings;
use Sys::Syslog qw(:DEFAULT setlogsock);

# our transports array, we will define this in as transport services

our @array = (

# Initalize and open syslog.

# Autoflush standard output.
select STDOUT; $|++;

while (<>) {
        # randomizing transports array
        my $random_smtp = int(rand(scalar(@array)));
        if (/^get\s(.+)$/i) {
                print "200 $array[$random_smtp]\n";
                syslog("info","Using: %s Transport Service", $random_smtp);

	print "200 smtp:";

Continue reading »

Dec 032010

Postfix implements the header_checks as built-in content inspection classes while receiving mail. Usually the best performance is obtained with pcre (Perl Compatible Regular Expression) tables or slower regexp (POSIX regular expressions). Googling on the net, i’ve found tiny perl script that can queries to,, ( Sahil Tandon wrote it, based on  João Gouveia perl script, i think..)

first download the script

# cd /etc/postfix
# wget

Rename and make it executable

# mv
# chmod 755

Edit add this two lines inet  n       n       n       -       0      spawn
user=nobody argv=/etc/postfix/

Make preliminary test, to ensure sih really spawned and answering our queries

# postfix reload
# telnet 2526

Continue reading »