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.

when i send mail into my root@mydomain.com address, this works.

but when i send mail into another inexistent user mail address (like sdfsdfdsf@mydomain.com) this reject the e-mail:

Recipient address rejected: User unknown in local recipient table (state 13).

How can i accept all mails (and redirect the 'unknown addresses' into root@mydomain.com)?

Thanks!

share|improve this question
    
I don't know postfix at all, but maybe there is a way you can set *@mydomain.com as that user's address? –  SpacemanSpiff Aug 4 '12 at 14:45
add comment

3 Answers

up vote 1 down vote accepted

Checkout the config parameter user_relay to set the catchall user. And to not block non-existing users local_recipient_maps must me empty. So in your case:

luser_relay = root@mydomain.com
local_recipient_maps =
share|improve this answer
    
hmmm, this works, but only works sometimes :S if i send mail into dfdfsdff@mydomain.com works but i send mail into d9f9sdf8s9df89sdf89sdf8@mydomain.com doesn't works, how can it works arbitrarily? –  felix46r Aug 4 '12 at 15:00
    
The error that the server returned is: 550 550 sorry, no mailbox here by that name (#5.1.1) (state 13). but this only occurs randomly –  felix46r Aug 4 '12 at 15:13
2  
@felix46r If it seems to randomly fail, then you probably have something else affecting it. What are the log messages when it fails? Did you reload postfix after changing the configuration? If not then some smtpd processes may still be working with the old config. –  dsh Aug 4 '12 at 22:14
    
@dsh today works perfectly, problem solved, thanks to all (: –  felix46r Aug 5 '12 at 9:54
add comment

You might try the virtual_alias_maps answer (shows as 4th answer for me) from postfix - how do you redirect all emails to one user, eg *@example.com → user@example.com

I had and solved this problem many years ago but do not have a copy of what I did. But the above sure looks like it.

share|improve this answer
add comment

That is called a "catch-all" address.

http://www.postfix.org/ADDRESS_REWRITING_README.html#luser_relay

Local catch-all address

When the local(8) delivery agent finds that a message recipient does not exist, the message is normally returned to the sender ("user unknown"). Sometimes it is desirable to forward mail for non-existing recipients to another machine. For this purpose you can specify an alternative destination with the luser_relay configuration parameter.

share|improve this answer
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.