2

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 no-exist@example-mail.com. So I added the lines below to /etc/postfix/main.cf, and restarted Postfix.

# unknown_local_recipient_reject_code = 550
luser_relay = no-exist@example-mail.com
local_recipient_maps =_

However, when I send a test emails to a random email address such as wetrjwoperw98023423@example-mail.com, 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

<wetrjwoperw98023423@example-mail.co>: user unknown

And this message is also not being forwarded to no-exist@example-mail.com.

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

1

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
heinz@example-mail.com     heinz
bert@example-mail.com      bert 
schwuffi@example-mail.com  schwuffi

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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