1

Topic: smtp_generic_maps what am I missing?

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.6 OPENLDAP edition.
- Deployed with iRedMail Easy or the downloadable installer? Yes
- Linux/BSD distribution name and version: Ubuntu 14.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi!
   I am in that process of two domains in the same server and I had made a good advance. As soon as I finish it, teste it well and see that it is really working, I'll post here what I did, step by step so others will have the chance to have a solution, too smile

   Now I am stuck at the smtp_generic_maps - it works (kind of).

   I'll try to detail what has been done without too much hustle.

Edited the file /etc/postfix/main.cf and changed the following line:

virtual_mailbox_domains = currentdomain.com.br newdomain.com.br

This way I can add the new domain to the mailboxes aliases in AD using the othermailbox attribute.
When I try to send e-mail to user@currentdomain.com.br or to user@newdomain.com.br both arrive to the same inbox, i can reply or write new mails to user@newdomain.com.br or user@currentdomain.com.br, which is correct. It works both internally and externally (I use an ISP webmail to make the external tests).

Still in main.cf file, added the following line:
smtp_generic_maps = hash:/etc/postfix/generic

Content of /etc/postfix/generic content:
user@currentdomain.com.br   user@newdomain.com.br

then fire up a postmap /etc/postfix/generic to create the database.

The e-mail gets to the destination like user@newdomain.com.br, which is what I expected.

But when I try to reply it, postfix says that the mailbox doesn't exist (user@newdomain.com.br). It happens both if I send the e-mail internally or externally. Even if I try to write a new mail internally to the user@newdomain.com.br it gives me the "Undelivered Mail Returned to Sender" mail.

it looks like as if Postfix is "seeing" the newdomain.com.br as external, but it isn't. I set my DNS to resolve the newdomain.com.br hosts as internal address.

Now, when I disable the smtp_generic_maps everything returns to its normal, but I can't make the mail go out with @newdomain.com.br

I don't know where to look for. What I am missing? Do I have to deactivate something? Any clue will very welcome.

Thank you!

2

Re: smtp_generic_maps what am I missing?

I've found the solution. The option no_address_mappings was not allowing the new domain to work as an alias.

In /etc/postfix/master.cf change the following line from:

-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings

to:

#-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks

In the above example, I've commented out the original command (just in case) and did a new line without the no_address_mappings option.

Now, all my e-mails are sent with the new domain, and I can receive both the old and the new domain. Of course, I'll have to add the new domain address to all my mailboxes, but it is working fine.

If it's OK for you ZhangHuangbin and you approve the solution, I can write some kind of tutorial of how I did it, step by step.

Cheers smile

3

Re: smtp_generic_maps what am I missing?

zuotoski wrote:

If it's OK for you ZhangHuangbin and you approve the solution, I can write some kind of tutorial of how I did it, step by step.

iRedMail will keep original setting.

If you send email to a mailing list with, for example 100 members, your change will cause Postfix to expand mailing list address to 100 members and your system needs to do spam/virus scanning for 100 messages.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

4 (edited by zuotoski 2019-10-08 00:08:21)

Re: smtp_generic_maps what am I missing?

ZhangHuangbin wrote:

iRedMail will keep original setting.

If you send email to a mailing list with, for example 100 members, your change will cause Postfix to expand mailing list address to 100 members and your system needs to do spam/virus scanning for 100 messages.

Sorry, I didn't understand your explanation. I tried to do my best, if it's not right, no problem.
But you could give some direction, too. I know, I am using the free version, i am not demanding, just asking for some help.

I kind of understood, but I guess that for me, the solution that I proposed works. We don't have any mailing list with as many members like your example. But again, if you have any better suggestion, please help me.

P.S.: I won't write any tutorial and going to keep it to myself, anyway.