Warning: I'm a total *nix n00b. I need to get "catch-all" mail setup on OpenBSD. I'm just using the pre-installed mail service. Especially I want mail sent to `abc-123-def-geh@localhost' to redirect to 'user@localhost'. Is there a way using the pre-installed stuff or do I need some other software? If so: any suggestions on light-weight, easily configured software?
If the pre-installed service is Postfix or Sendmail, you should be able to edit the
/etc/mail/aliases file to your liking. It is in the format of:
[alias name]:[existing account]
So, to create the alias you need, you would edit the file to include:
And then, as root, run the
You can also define groups in this way, and more. See
man 5 aliases. Most mail is by default sent to root, so you will probably want to define an alias for root as well.
I installed postfix (wasn't that hard but took a couple of hours), added a "catch-all" alias in /etc/postfix/virtual. Done - ta-daa! ;)
And, I had to kill sendmail before starting postfix to be able to run postfix for smtp as well (required for local catch-all unit tests).