Q. How do I setup cacth-all email accounts under Postfix MTA? For example if an email send to me@domain.com, info@you.com and sales@you.com, should be sent to the same email address.

This is useful if anyone of user mistypes an email address when they send it to me, or just guesses at a valid email address, then they will likely get an error message from my server such as user / email mail box does not exist. So I wish to set up a “catch all” address

A. Mapping is done using /etc/postfix/virtual file.
# vi /etc/postfix/virtual
Append code as follows, replacing domain and emailusername with actual values:
@yourdomain.com emailusername

Save and close the file. Run following command:
# postmap /etc/postfix/virtual

Also make sure you have following line in /etc/postfix/main.cf file:
virtual_alias_maps = hash:/etc/postfix/virtual

If you just added above, line reload postfix:
# service postfix reload

Caution: if you set up a catch-all email address, you will likely receive more unsolicited (spam) email.

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

14 comments… add one
  • omer Jan 13, 2014 @ 16:19

    Thank you brother. İt’s so good.

  • Apoorva Sep 9, 2015 @ 8:56

    i want to do email id mapping under one domain.

    for example : xyz@shine.com & abc@shine.com are two email id’s.
    i want to map both of them under sky@shine.com.

    as if anybody sends email on sky@shine.com,it shoud go to both xyz@shine.com & abc@shine.com.

  • Mihai Dec 10, 2015 @ 20:49

    Hello, How can I redirect only or non-existent mailboxes on the server? if I have other maiboxes from the same domain, I dont want the catchall to be applied….
    and…
    How can I silent redirect and in the same time to send back a bounce message?

    Thank you!

    • jo66 Mar 10, 2016 @ 19:18

      +1

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.