Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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 4 '11 at 11:16
add comment

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.