1

Topic: Set Postfix to relay only for users not found or relay outgoing only?

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

Hello and thank you for your time and assistance.  We currently run Exchange 2010 for about 300 users.  We have 1500 people who work outside the office and have various unprofessional emails from gmail, etc.  I've been instructed to set up an email server (paid or unpaid) that would handle these users.  The boss referred me to SmarterMail, but I'm not a fan, once you start adding up the extra fees.

I decided to try iRedMail after reading reviews and feedback.

I successfully set up a server and configured my exchange server to play nicely with iRedMail. I had it set with @fr.muellerreports.com.  Anything not found in the Exchange server gets forwarded to iRedMail by exchange.  Everything works great.  However; the company would like everyone to have the same @muellerreports.com address and isn't thrilled with the @fr I came up with.  This is where I've had difficulties, and where the gnashing of teeth begins.
Actual Issue: Having 2 mail servers using the same domain isn't ideal.  iRedMail won't send to exchange, and instead insists on sending to itself for @muellerreports.com

Actual Question:  Is there a way to get Postfix to only relay mail for unknown users and still accept incoming mail for users it does have in the database?  Alternatively, is there a way to only relay outgoing mail and accept incoming mail as normal?


SMTP Error (550): Failed to add recipient "blawrence@muellerreports.com" (5.1.1 <blawrence@muellerreports.com>: Recipient address rejected: User unknown in virtual mailbox table) 

If I disable the above, it sends but still sends to itself (mailerdeamon).  If I set up an SMTP transport, it sends but doesn't accept incoming mail for muellerreports.com

If there is a feature in iRedAdmin-Pro that can handle this, I'm fine buying the product as well.  I also don't mind installing a product like Webmin if that will do the job, but I also intend to ensure we support the project, as long as I can get this to work.

Thank you again for any feedback and assistance.  If this is something that can be managed via iRedAdmin-Pro, please provide screenshots if possible, so that I can show "the boss" that it can be accomplished but this is what is needed.

----

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

2

Re: Set Postfix to relay only for users not found or relay outgoing only?

*) For outbound relay, try Postfix parameter "relayhost =".
*) For the user unknown issue, maybe you can add a new mail user first, e.g. catchall@, then setup the per-domain catch-all account to catchall@. Set the outbound relay and inbound relay for catchall@.

The latest iRedMail release has Postfix parameter "sender_dependent_relayhost_maps" enabled by default, so you can insert proper value in SQL/LDAP directly.

3

Re: Set Postfix to relay only for users not found or relay outgoing only?

Thank you for your response.  I will give this a try!

4 (edited by blawrence 2017-04-21 17:06:15)

Re: Set Postfix to relay only for users not found or relay outgoing only?

Hello and thank you for your assistance.  I purchased the iredadmin-pro panel to make my life easier.  I set up the catchall but it would not deliver.  I believe something may have changed when I upgraded to pro, because I was previously able to send out to the exchange server with a same domain.


Edit: I was able to get email TO iredmail to work from the exchange server using the information in the following thread:
http://www.iredmail.org/forum/topic1190 … hange.html

I'm still working on outgoing emails TO the exchange server.  It doesn't seem to like the catchall just yet.

I apologize for the editing and for the assistance.  It seems that the catchall doesn't work as expected.  I must not have something configured correctly.  If I add exchangeuser@mydomain.com to the iredmail server and set up the relay for that specific user, it works.  catchall@ does not seem to work.

I am hoping there is an easier way than importing all of my exchange users and modifying their relay settings.  Once again, thank you in advance for your assistance.