1

Topic: multiple ips on same vps ?

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hello

i have a centos 6.6 and i installed iredmail on it

everything is working fine but i was wondering if i can add a second or third ip to the same vps to send mail with ?

does iredmail support multiple ips  ? i don't want ip rotation , i want to be able to choose which ip to send from depending on the smtp server adress i provide

like if i provide ip1 in the smtp server parameter , it should send with ip1
if i provide ip2 it should send with ip2 and so on...

is it possible ? if so how can i do so ?

cheers

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: multiple ips on same vps ?

FYI: http://www.iredmail.org/docs/send.out.e … esses.html

3

Re: multiple ips on same vps ?

i did all the steps but now both my smtps send from the same ip

if i chose the default 188.xxx.xxx.8 it send with 188.xxx.xxx.10

and if i chose the second smtp 188.xxx.xxx.10 it send with 188.xxx.xxx.10

i want to be able to choose every ip as seperate smtp

if i send with 188.xxx.xxx.10 i want the message to be sent with 188.xxx.xxx.10 and not the second one

any idea how i can fix this ?

cheers

4

Re: multiple ips on same vps ?

Please show us your changes.

5

Re: multiple ips on same vps ?

first i updated my postfix to  2.11.6

then i added

sender_dependent_default_transport_maps = pcre:/etc/postfix/sdd_transport.pcre

to the end of /etc/postfix/main.cf

then i created a file /etc/postfix/sdd_transport.pcre with the content

/@mydomaine\.com$/   sample-smtp

(i hope it okey that i don't show my domaine)
then at /etc/postfix/master.cf i've added this to the end of file

sample-smtp     unix -       -       n       -       -       smtp
    -o smtp_bind_address=188.xxx.xxx.10
    -o smtp_helo_name=server2.mydomaine.com
#    -o syslog_name=postfix-example-com

then i restarted my server with

/etc/init.d/postfix restart

6 (edited by kinneyscott5 2017-06-27 07:46:50)

Re: multiple ips on same vps ?

i've noticed on the file that it says

If you have multiple IP addresses available on your iRedMail server, and would like to send from different IP Addresses for different domains, follow the steps below.

i have both ips on the same domaine , is this ok ?


just to clear up

i have 1 domaine name (abc.com) and 2 ip adresses 185.xxx.xxx.8 (server1.abc.com) and 185.xxx.xxx.10 (server2.abc.com)

both ips will be sending from the same domaine

i have a script that calls the smtp with requirement
smtp server :
port:
encryption:
username:
password

i want to be able to select which ip to send from by specifiying the smtp server

if i chose
smtp server : 185.xxx.xxx.8

i want the email to be sent from 185.xxx.xxx.8 with the domaine abc.com

and if i choose
smtp server : 185.xxx.xxx.10
i want the email to be sent from 185.xxx.xxx.10 but with the same domaine abc.com

is this possible ?

hope i cleared it up

cheers

7

Re: multiple ips on same vps ?

Oops, this is a little different, i'm sorry that i misunderstood your first post.

Does this setting in /etc/postfix/main.cf work for you? (Replace IP_1 and IP_2 by the real IP addresses)

transport_maps = randmap:{smtp:[IP_1]:25,smtp:[IP_2]:25}

8

Re: multiple ips on same vps ?

looks like there is already a transport_maps in my /etc/postfix/main.cf

transport_maps =
    proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf
    proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf

so i tried like this

transport_maps =
    proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf
    proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
    randmap:{smtp:188.xxx.xxx.8:25,smtp:188.xxx.xxx.10:25}

and like this

transport_maps =
    proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf
    proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf

transport_maps = randmap:{smtp:188.xxx.xxx.8:25,smtp:188.xxx.xxx.10:25}

but they booth failed when sending "Temporary lookup failure"

side note :

does rand mean random ?? like he will randomly select an ip to send with or will it acheive what i'm looking for ??

thank you

9

Re: multiple ips on same vps ?

Yes, rand means random. FYI:
http://www.postfix.org/DATABASE_README.html#types

If it doesn't work, please show us full original log in Postfix log file.

10

Re: multiple ips on same vps ?

i don't want them to be random , i want every ip to work as it own seperate smtp server

11

Re: multiple ips on same vps ?

Wait a sec, let's go back to the beginning?

You have only ONE domain, 2 IP addresses, but why do you want this setup?

12

Re: multiple ips on same vps ?

yes i have 1 domaine & 2 ips

i want both ips to link to the same domain and be able to send simultaneously without interfuring with each others

i want every ip to work as it own seperate smtp server

like if i choose ip1 in the server name section (or host), i want for ip1 to send mail and if i choose ip2 i want for ip2 to send mail

i don't want them to send mail randomly together or send with one and then change to the other

i hope this makes sense