Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed postfix+dovecot+mysql. Everything works fine. But I need to do one specific thing:

If a user doesn't exist (e.g. idontexist@mydomain.tld), then the message needs to be forwarded to google apps. I need to the forward original message (like it was send to g-apps directly), not forward it to some bin@g-apps.

Can somene point me to the solution?

share|improve this question
    
Are you going to serve in such way local users (i.e. mydomain.tld is in your 'mydestination' in main.cf) or virtual users? –  Vadym S. Khondar Mar 28 '12 at 12:26
    
Only virtual users. –  DominikM Mar 28 '12 at 12:28
    
And what do you mean under 'send to g-apps directly'? Forward original email to specific email address? –  Vadym S. Khondar Mar 28 '12 at 12:42
2  
Do not accept mail you cannot deliver. –  adaptr Mar 28 '12 at 13:10
    
Do the MX records for mydomain.tld point to the postfix server or Google? –  adamo Mar 29 '12 at 8:18
add comment

2 Answers

up vote 0 down vote accepted

DISCLAIMER: I take no responsibility for the undeliverable bounce messages that will get stuck in your mailqueue as a result of this. adaptr's comment is correct; you should only accept mail you can deliver. Ideally, you should check against the google-apps domain to see if a recipient is valid. If at all possible, do that.

You can use a Perl Compatible Regular Expression's table using TEXT SUBSTITUTION as your last virtual alias map.

share|improve this answer
add comment

You can setup catch-all account in your virtual_alias_maps file.

But this would open a hole for lots of spam.

See http://www.postfix.org/VIRTUAL_README.html#virtual_alias for details.

share|improve this answer
    
I know about catch-all account. I have one now, but it can be (as far as i know) used only to redirect to specific mail address => Mail originally to bar@mydomain.tld is redirected and send to redirect@another-domain.tld. But what i want is redirect it to google apps account like there is no postfix and redirection. Thank you –  DominikM Mar 28 '12 at 13:23
    
What do you mean under 'redirect to google apps account'? –  Vadym S. Khondar Mar 28 '12 at 13:54
    
Customer has google apps on his domain and uses it for e-mails. Now he want to use his server (postfix, etc...) as mail server, but only for specific accounts and the users not listed in virtual users on his server should be "redirected" (as i described befeore) to google apps, which he uses now. Is it possible to do this? Thanks. –  DominikM Mar 28 '12 at 14:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.