1

I am trying to define wildcard receipts in SendMail, from what I read in this document http://www.sendmail.org/m4/features.html#virtusertable I understand that this would be a correct syntax inside /etc/mail/virtusertable

old+*@domain1.com   root@domain2.com
adrian@domain1.com  root@domain2.com

I would expect first rule to match a receipt like old243523@domain1.com but it doesn't. The second rule works ok so I assume that localdomains and similar things are all configured correctly, but how to match a wildcard like in first rule? Sending to old243523@domain1.com returns the "not such user" error.

Thank you.

adrianTNT
  • 1,007
  • 5
  • 21
  • 41
  • Looks like by supporting wildcard receipts of this form in virtusertable: old+*@domain1.com root@domain2.com sendmail actually accepts emails sent to "old+2342@domain1.com", "old+blabla@domain1.com", etc. So it will NOT accept without the plus: oldblabla@domain1.com – adrianTNT Oct 04 '11 at 11:16

1 Answers1

1

I would expect first rule to match a receipt like old243523@domain1.com but it doesn't

Yes. It doesn't and must not. + sign have special meaning in virtusertable

but how to match a wildcard like in first rule?

Any plussed address, in which + is part of localpart will be matched

If you want transform old*@domain1.com into old+*@domain1.com (for processing later in virtuser) you can use regex map in LOCAL_RULE_0 to rewrite Just tonote - debug sequences of virtusertable lookup using sendmail -d60.5 -bv old123@domain1.com

Lazy Badger
  • 3,067
  • 14
  • 13