1

Topic: force mail to goto public internet or other workaround?

Morning all.  I originally setup this server for a 'real' mail server for a few subdomains and things are working great.  Now our older server that get's used for just outbound mail has died, and I want to use this box for that purpose as well.  Basically when there are errors on the websites, the server (running cold fusion) will generate a message and go out as well as other website functions (lost password, etc.).

The problem is 1st the server names were not there so I was getting "Mailbox does not exist" errors, so to test, I added one or two and things worked.  The users got their requested password, thanks for registering, etc at any of their email domains (@gmail.com, etc.)

The issue now is that the error messages goto the admins at our domain (ex. admin@mydomain.com) but the problem is that I added the @domain.com to iRedAdmin as a domain so that step 1 would be resolved and that the server could send to the users.  Our real mail is hosted at google enterprise, but when the server say's send this error to admin@mydomain.com, the server says (in plain terms), "oh, I have that domain here, so I will just deliver".  I see the postfix error admin@mydomain.com does not exist.

What i want is for ALL mail to go out to the public, so when a message from a local webserver goes to the iRedMail server and says this is for admin@mydomain.com, it doens't look local but rather sends it out so it can be properly delivered to google, OR the better of the 2 options would be to just allow mail to be relayed from a specific IP.  I tried adding the IP to the mynetworks line in the main.cf, but when I submit I get "Sender address rejected: User unknown in virtual mailbox table".

I would prefer to be able to send mail to that mail server from anyone (from a specific IP) without that mailbox does not exist.  So what's the best route to address this?

==== Provide basic information to help troubleshoot ====
- iRedMail version: v0.1.4 (MySQL)   
- Linux/BSD distribution name and version: Ubuntu 10.04LTS
- Any related log? Log is helpful for troubleshooting.
====

2

Re: force mail to goto public internet or other workaround?

So, you want to direct all emails sent to admin@mydomain.com to Google Apps?

Try this:
- Add addition transport map in Postfix:

transport_maps = hash:/etc/postfix/transport, ...[ORIGINAL_SETTINGS_HERE]...

- Edit /etc/postfix/transport, relay mails to admin@mydomain.com to Google Apps:

admin@mydomain.com smtp:[aspmx.l.google.com]:25

- Run postman and restart Postfix

# postmap hash:/etc/postfix/transport
# /etc/init.d/postfix restart

3

Re: force mail to goto public internet or other workaround?

Worked perfect. 

The only other questions regarding this are;
1. does there have to be a local account on that box to forward?
2. can I wildcard that?  Since that box is not hosting the @realdomain mail, can I in that transport file say *@realdomain ?

Thanks so much for the perfect reply.

4

Re: force mail to goto public internet or other workaround?

1) You don't need a local account, use a mail alias is ok too.
2) Wildcard. Reference: http://www.postfix.org/transport.5.html