How can I configure iredmail to allow sending to a certain external domains only?
by mstjohn1974 from LinuxQuestions.org on (#564FS)
I am not very familiar with iRedMail which uses postfix and an MySQL backend. Here is a snippet out of my main.cf for transport rules:
# Lookup virtual mail accounts
#
transport_maps =
proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf
proxy:mysql:/etc/postfix/mysql/transport_maps_maillist.cf
proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
and all I can find to solve my issue is based on the following:
transport(5) maps are used to redefine how email is routed by postfix.
Add the following line to /etc/postfix/main.cf:
transport_maps = hash:/etc/postfix/transport
Add the new file /etc/postfix/transport with this content:
.example.com :
example.com :
* discard:
Replace example.com with the domain your mailserver should still send mails to. If you don't care about sub-domains then remove the first line.
Don't forget to hash the file after editing it with postmap(1) and reload postfix so that the changes can take effect.
Does someone know how to make this work with iRedMail/Postfix/MySQL?
Thank you


# Lookup virtual mail accounts
#
transport_maps =
proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf
proxy:mysql:/etc/postfix/mysql/transport_maps_maillist.cf
proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
and all I can find to solve my issue is based on the following:
transport(5) maps are used to redefine how email is routed by postfix.
Add the following line to /etc/postfix/main.cf:
transport_maps = hash:/etc/postfix/transport
Add the new file /etc/postfix/transport with this content:
.example.com :
example.com :
* discard:
Replace example.com with the domain your mailserver should still send mails to. If you don't care about sub-domains then remove the first line.
Don't forget to hash the file after editing it with postmap(1) and reload postfix so that the changes can take effect.
Does someone know how to make this work with iRedMail/Postfix/MySQL?
Thank you