1

Topic: Domain based smtp transport

Hello, i am using the free iredmail.
All i want to do this setup transport on domain base for some domains.
Now i need to create a user mailbox and later on set the domain.transport to smtp:[server:25]
But whenever i test with a non existing user i get: Sender address rejected: User unknown in virtual mailbox table
How do i achieve that iredmail does'nt look up the user in the virtual mailbox table but instead just relay *@domain.com to whatever server ?

thanks in advance



==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
====

----

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

2

Re: Domain based smtp transport

Create a catch-all account, forward emails delivered to non-exist account to a real email account (e.g. catchall@domain.ltd). Then set transport to smtp:[server]:25 for catchall@domain.ltd.

You can find tutorials of how to create catch-all account with phpLDAPadmin or MySQL command line here:

- http://www.iredmail.org/wiki/index.php? … /Catch-all
- http://www.iredmail.org/wiki/index.php? … /Catch-all (This works for both MySQL and PostgreSQL backend)

If you have iRedAdmin-Pro installed, you can set catch-all account in domain profile page. Screenshot:

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

Then config per-user transport for catch-all account in user profile page. Screenshot:

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

3

Re: Domain based smtp transport

Hello and thanks for replying.
But i think i didnt explain myself well.

lets say i have mail.domain.com as mailserver.
This is the iredmail server btw ... so now we receive mail destined for xxx.com.
How can i set a transport which relays all mails to an exchange server for example.
i already tried setting transport in domain.transport table in mysql but aslong the user@xxx.com isnt known locally its going to bounce with an error that it doesnt exist in the virtual mail table.
How and where do i need to configure that mails destined for xxx.com is relayed (transported) to an external exchange server without iredmail looking locally for the user to exist.

Thanks alot in advance smile

4

Re: Domain based smtp transport

mfranco wrote:

How do i achieve that iredmail does'nt look up the user in the virtual mailbox table but instead just relay *@domain.com to whatever server ?

Postfix will check existing domains and accounts with below settings in parameter "smtpd_recipient_restrictions" if mail domain is hosted locally:

smtpd_recipient_restrictions =
    ...
    reject_unknown_recipient_domain,
    ...
    reject_unlisted_recipient,
    ...

It's not recommended to remove them.

mfranco wrote:

How and where do i need to configure that mails destined for xxx.com is relayed (transported) to an external exchange server without iredmail looking locally for the user to exist.

To achieve this, please list your domain in Postfix parameter "relay_domains =" instead of hosting it locally. For example:

relay_domains = xxx.com

Then define relay transport in parameter "relay_transport =".

Reference: http://www.postfix.org/postconf.5.html

5

Re: Domain based smtp transport

Thanks for the reply.
I found that when i use domain.transport table in mysql combined with backupmx = 1
that mails will be relayed to external servers just fine as i wished for smile
So now i have the situation that for a defined domain postfix is not going to look into the virtual_user_table.
Saludos