1 (edited by megalooser@gmail.com 2016-06-01 03:31:00)

Topic: Local delivering and mx record

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: Centos 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue: /var/log/messages
====

Hello,

I have domain example.com and one user user1@example.com on my iRedMail server and have mx record for domain  example.com to other mail server that contain user user2@example.com

When I'm trying to send email to user2@example.com from iRedMail server it only looking for user at local database and fails.

Is it possible to change iRedMail configuration to read mx records if local delivery fails or disable local delivery at all

Thanks

----

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

2

Re: Local delivering and mx record

Try this:

*) Add a new mail user, e.g. catchall@example.com.
*) Update catchall@example.com's relay setting to 'smtp:example.com'.
*) Add a per-domain catch-all account, and set it to 'catchall@example.com'.

For non-existing users, Postfix will send email to catch-all account (it's catchall@example.com in this case), and the relay setting will cause Postfix relays emails to MX record of 'example.com' domain.

3 (edited by megalooser@gmail.com 2016-06-10 19:56:07)

Re: Local delivering and mx record

Thanks a lot for your advice!
I tried this:

*) Added a new mail user and update its transport to smtp:example.com
mysql> select username,transport from mailbox where username='example.com';
+------------------------------------+------------------------+
| username                           | transport                |
+------------------------------------+------------------------+
| catchall@example.com       | smtp:example.com |
+-----------------------------------+-------------------------+

*) Created a new catch-all account for this domain
mysql> select address,goto,domain from alias where address='example.com';
+------------------+------------------------------+------------------+
| address          | goto                             | domain          |
+------------------+------------------------------+------------------+
| example.com | catchall@example.com | example.com |
+------------------+------------------------------+------------------+

When I sent email to user@example.com it sends to mx of example.com but to catchall@example.com (not to user@example.com) What am I doing wrong?

Thanks!

4

Re: Local delivering and mx record

megalooser@gmail.com wrote:

When I sent email to user@example.com it sends to mx of example.com but to catchall@example.com (not to user@example.com) What am I doing wrong?

Oh, if you still want to deliver email to 'user@example.com', it's a little more complex:

You have to create same users on local machine, and set their transports to 'smtp:example.com'.

5

Re: Local delivering and mx record

is catchall account needed in this case?

Is this the only way to solve my problem?

Thanks!

6

Re: Local delivering and mx record

megalooser@gmail.com wrote:

is catchall account needed in this case?

No.

megalooser@gmail.com wrote:

Is this the only way to solve my problem?

Hosting one domain on multiple servers, I'm afraid this is the only way.