1

Topic: Centos 6.2 - IP per domain only

MySQL, Centos 6.2, fresh install OS


Hi, first of all I must say that iRedMail is great!

But I have small problem.
I have 3 domains and 3 IPs and I need assign one IP to one domain (model 1:1). IPs I have binded on eth0:1, eth0:2 and eth0:3

Example #1:
1) User info@company1.example.com is logged in SMTP
2) write some letters, choose recipient, write subject
3) and SMTP send mail from IP which is assigned to this domain

Example #2:
1) User info@company2.example.com is logged in SMTP
2) write some letters, choose recipient, write subject
3) and SMTP send mail from IP which is assigned to this domain

and so on..

currently I have binded 3 IPs to the machine but SMTP sends just from first IPs (eth0)

Please help, I am relative new in Linux.

2

Re: Centos 6.2 - IP per domain only

Try this:

1: Edit /etc/postfix/master.cf, clone the smtp service:

# Original one
smtp      unix  -       -       -       -       -       smtp

# Cloned one
smtp_company1      unix  -       -       -       -       -       smtp
        -o smtp_bind_address=[IP_ADDRESS_FOR_COMPANY1]

smtp_company2      unix  -       -       -       -       -       smtp
        -o smtp_bind_address=[IP_ADDRESS_FOR_COMPANY2]

smtp_company3      unix  -       -       -       -       -       smtp
        -o smtp_bind_address=[IP_ADDRESS_FOR_COMPANY3]

Restarting Postfix is required.

2: Update per-domain transport stored in MySQL. For example:

# mysql -uroot -p vmail
mysql> UPDATE domain SET transport='smtp_company1:' WHERE domain='DOMAIN_OF_COMPANY1';
mysql> UPDATE domain SET transport='smtp_company2:' WHERE domain='DOMAIN_OF_COMPANY2';
mysql> UPDATE domain SET transport='smtp_company3:' WHERE domain='DOMAIN_OF_COMPANY3';

Warning: Don't forget the ':' after 'smtp_companyX' in SQL commands. Let me know whether it works for you or not.

If you have iRedAdmin-Pro installed and running, you can manage per-domain transport in domain profile page, under tab "Relay". Screenshot for your reference:

http://www.iredmail.org/images/iredadmin/domain_profile_relay.png

3

Re: Centos 6.2 - IP per domain only

Hi, thanks for the reply.

It's possible test that on local network? Because I have still same problem. My SMTP server does not use the correct domain, he use his machine hostname.

4

Re: Centos 6.2 - IP per domain only

Sorry, i don't quite understand what your issue/question is. sad

5

Re: Centos 6.2 - IP per domain only

Hi!! once again I have to say that is a great product.
We are thinking to implement a similar setup with the above ( we will use commercial version of iredmail ). We are going to host many virtual domains in an mail server with Centos 6.5 - mysql backend. We will have two public IPs and we want to control outgoing mails.we want some virtual domains to send & receive mail through mail.company1.com & some others through mail.company1.com.
Is that possible ??
I will try to reproduce the above setup to a test environment with iredmail open source edition.
I also check this one : http://www.iredmail.org/wiki/index.php? … IP.address