I'm running raspbian so I think a some things are different, another difference is that I only want to accept addresses to my domain.
The solution was:
- Create the file
/etc/postfix/virtual
with the content:/.*@example.com/ spamuser
- Add the following line in file
/etc/postfix/main.cf
:virtual_alias_maps = regexp:/etc/postfix/virtual
- Activate the virtual file:
postmap /etc/postfix/virtual
- The solution in serverfault suggested to use
virtual_alias_maps = pcre:/etc/postfix/virtual
, with this line I was having the following warning:
Apparently my install was expecting regexp instead of pcre. To find out the capabilities of your install you can run the commanderror: warning: pcre:/etc/postfix/virtual is unavailable. unsupported dictionary type: pcre.
postconf -m
- To check the status of the service run
service postfix status
, you will also get a tail of the log, was useful to see configuration errors.