3

I am setting up Postfix + Devecot with my own domain example-mail.com.

I need to forward all the incoming emails which email addresses are not existing in the server to [email protected]. So I added the lines below to /etc/postfix/main.cf, and restarted Postfix.

# unknown_local_recipient_reject_code = 550
luser_relay = [email protected]
local_recipient_maps =_

However, when I send a test emails to a random email address such as [email protected], I am still getting the auto-reply message:

This is the mail system at host example-mail.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<[email protected]>: user unknown

And this message is also not being forwarded to [email protected].

Does any one know what may be causing the issue on this? And how I can fix this?

1 Answer 1

2

You maybe don't want to forward those mails (send them to an external address), but collect them in a catchall mailbox.

To set up a catchall mailbox in postfix

Check if you are using virtual mapping in your /etc/postfix/main.cf

virtual_alias_maps = hash:/etc/postfix/virtual

If yes, modify your virtual alias table in /etc/postfix/virtual

# local usersuser
[email protected]     heinz
[email protected]      bert 
[email protected]  schwuffi

# catch-all 
@example-mail.com          no-exist

Then activate both by postmap /etc/postfix/virtual && postfix reload.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .