If you wanted to send emails to users but did not want to receive any replies to the email, you would need to setup a no-reply@domain.com email account. These kind of email ids are useful when sending emails containing forgotten passwords or activation code. Below are the steps for creating such account in Postfix.
1. Identify the file containing alias for Postfix
First, make sure the following line in the ALIAS DATABASE section of the /etc/postfix/main.cf is NOT commented out:
alias_maps = hash:/etc/aliases
2. Create an alias that redirects messages to /dev/null
Edit /etc/aliases and add following entry
devnull: /dev/null
3. Create a virtual email id
Edit /etc/postfix/virtual and add following entry
no-reply@domain.com devnull
4. refresh postfix alias and postfix cache
Execute following commands. (You may require root privileges)
> newaliases
> postfix reload
1. Identify the file containing alias for Postfix
First, make sure the following line in the ALIAS DATABASE section of the /etc/postfix/main.cf is NOT commented out:
alias_maps = hash:/etc/aliases
2. Create an alias that redirects messages to /dev/null
Edit /etc/aliases and add following entry
devnull: /dev/null
3. Create a virtual email id
Edit /etc/postfix/virtual and add following entry
no-reply@domain.com devnull
4. refresh postfix alias and postfix cache
Execute following commands. (You may require root privileges)
> newaliases
> postfix reload
Comments
How do I make it work for the postfix relay on MX server?
Thanks in advance.
You will also need to set up, in /etc/postfix/main.cf:
virtual_alias_maps = hash:/etc/postfix/virtual
And remember to run postmap /etc/postfix/virtual, once you entered the aliases on the file.
no-reply@domain.com devnull@localhost
in my relay only postfix setup. Thanks, great resource.
virtual_alias_maps = hash:/etc/postfix/virtual
And also run:
postmap virtual
Thanks a lot.