Score:1

How to add a catchall address to opensmtpd without disrupting existing aliases

in flag

I have a working OpenSMTPD configuration that I am happy with.

I do not have a virtuser file and I do not reference "domain_mail" or virtual anywhere in my config file, which is here:

table aliases file:/usr/local/etc/mail/aliases

filter check_dyndns phase connect match rdns regex { '.*\.dyn\..*', '.*\.dsl\..*' } \
    disconnect "550 no residential connections"

filter check_rdns phase connect match !rdns \
    disconnect "550 no rDNS"

filter check_fcrdns phase connect match !fcrdns \
    disconnect "550 no FCrDNS"

listen on 100.150.200.135 port 10028 tag DKIM
listen on 100.150.200.135 filter \
    { check_dyndns, check_rdns, check_fcrdns }
    listen on 100.150.200.135 port submission

    action "local_mail" mbox alias <aliases>
    action "relay_dkim" relay host smtp+notls://100.150.200.135:10027
    action "outbound" relay helo mail.example.com

    match tag DKIM for any action "outbound"
    match from any for domain "example.com" action "local_mail"
    match from any auth for any action "outbound"
    match for local action "local_mail"
    match for any action "relay_dkim"

Again, everything works great and I am happy - I just want to add a catchall address so that emails to [email protected] can be directed into a mailbox.

I thought this would be a five minute fix - just add a line like this:

@     catchall

... to my aliases file and be done. BUT, opensmtpd does not allow something simple and convenient like that - you cannot use the '@' catchall in the aliases file even though that would be very simple and safe and help many use-cases.

Instead, it looks like I need to put the '@' rule in a virtusertable and add all of that complexity to my (nice and simple) opensmtpd conf file.

Two hours later I have not succeeded.

I don't understand how to make aliases and virtuals work together and I don't understand why I would rip out all of my working aliases and move them to virtuals but I also can't get the two of them to coexist nicely.

So the question is:

IF ALL I want out of virtual users is just that simple '@' catchall, is it possible to specify just that simple rule, by itself, inside the opensmtpd config file without adding in all of the virtual action/match logic and maintaining a second mapping table in addition to the aliases file I already have ?

Thank you.

Paul avatar
cn flag
I have to admit, I only use OpenSMTPD for sending and relaying, but I'm wondering what is the exact format you use in `aliases` and what error you receive with `@`? I'm pretty sure that should work.
user227963 avatar
in flag
It is my understanding - and I see it repeated elsewhere - that the @ catchall only applies when handling mail for virtual users. I attempted a single '@' then a tab then a local user (following the pattern I use with all of my aliases) and it just gave me 550 Invalid recipient errors.
user227963 avatar
in flag
... and just to add ... I am dying to know why the @ catchall is excluded from the alias file - what is the Very Important Reason that we can't just use '@' in aliases and avoid unnecessary complexity ? It seems like a no-brainer ...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.