1

Topic: Trying to relay some mails via Transport Maps

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2
- Deployed with iRedMail Easy or the downloadable installer? Downloadable installer
- Linux/BSD distribution name and version: Debian 9.12
- 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.
====

Hello,

I have two iRedmail servers, one with mailboxes which is in a host company and its MX backup on Azure.
Currently, I am having some troubles to send emails to some clients because of the first host company.
I would like to use the one on Azure as a mailrelay only for some specific recipients, I saw it's possible to do that via Postfix transport maps as explained here.


Here is my issue :

When I enable the transport maps, I can relay some recipients through the server on Azure as expected but I cannot receive any emails anymore in my mailboxes.

The error received by the sender :

Diagnostic information for administrators:
Generating server: mail.abcdef.be
johndoe@abcdef.be
Remote Server returned '554 5.1.1 < #5.1.1 X-Postfix; unknown user: "johndoe">'

My config files :

/etc/postfix/main.cf

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

/etc/postfix/transport

abcdef.be    local
cnn.com      relay:[mxbkp.abcdef.be]:587
*           smtp

Could you please help me to know why I cannot receive emails anymore when my transport maps are configured ?


Thanks in advance

----

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

2

Re: Trying to relay some mails via Transport Maps

- You do not need that tutorial, please revert the changes in Postfix.
- Instead, please login to iRedAdmin-Pro, go to user profile page, click tab "Relay", then set the relay server here.

3 (edited by Sébastien Noel 2021-04-30 21:04:16)

Re: Trying to relay some mails via Transport Maps

Thanks for your answer.

I don't try to relay outbound emails from a specific mailbox.
I would like to relay only emails to a specific recipient domain (for example toto.com).

Inbound emails ---> iRedmail server ---> outbound emails
                                  |
                                  |
                                /  \
                    IF recipient is @toto.com
                    THEN relay to the mailrelay server
                    ELSE uses the normal way

4

Re: Trying to relay some mails via Transport Maps

You need to add custom transport map in this case, iRedAPD doesn't support this yet.
FYI: http://www.postfix.org/transport.5.html