1

Topic: Route mail for second domain to via internal network

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0
- Deployed with iRedMail Easy or the downloadable installer? downloadable
- Linux/BSD distribution name and version: Ubuntu 18.04.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

We have 2 domains, 1 currently on Exchange, the other on iRedMail.  The mail from iRedMail uses a relay (the firewall) for all mail.  I would like mail between the two internal domains to go directly.  My iRedmail address is 10.66.10.23.  My second domain example.com is on 10.66.10.13.
I see there is a file in /etc/postfix/mysql which is transport_maps_domain.cf  Its contents are:

hosts       = 127.0.0.1:3306
user        = vmail
password    = sFzw12R0wNDdjr61AKswT9noLCQ51S
dbname      = vmail
query       = SELECT sender_bcc_user.bcc_address FROM sender_bcc_user,domain WHERE sender_bcc_user.username='%s' AND sender_bcc_user.domain='%d' AND sender_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND sender_bcc_user.active=1

Is this the file I need to edit to have mail traffic from iRedMail to the example.com domain?
If so, what is the syntax, or do I need to  create a mysql db entry?

Your advice appreciated.

regards, Bob

----

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

2

Re: Route mail for second domain to via internal network

- You copied wrong content for "transport_maps_domain.cf". smile
- For external mail domain names, you'd better set its transport in file /etc/postfix/transport.

3

Re: Route mail for second domain to via internal network

Thanks
Yes, I made an error on the last line.  It should have read:
query       = SELECT transport FROM domain WHERE domain='%s' AND active=1

I'd appreciate details of what should be the content of the transport file.  The Postfix documentation is unclear for me in my case, where I will have a relay host for all mail except a mail domain on another server on the same subnet.

Thanks

4

Re: Route mail for second domain to via internal network

Postfix document is here: http://www.postfix.org/transport.5.html