3

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!

felix46r
  • 261
  • 1
  • 5
  • 8

3 Answers3

2

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 =
basvdlei
  • 1,326
  • 8
  • 13
  • 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 04 '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 04 '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 04 '12 at 22:14
  • @dsh today works perfectly, problem solved, thanks to all (: – felix46r Aug 05 '12 at 09:54
0

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.

Skaperen
  • 1,094
  • 2
  • 11
  • 23
0

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.

dsh
  • 303
  • 1
  • 6