I have different forwarding needs for different domains, which all point to my mail-server:
user1@example.com foo@example.org
user2@example.com bar@example.net
@example.com mylocalaccount
This all works... However, some of these users wish to use the +-notation to give different vendors different addresses, such as user1
+vendor@example.com
. And this part is not working -- all such e-mails end up delivered to the catchall mylocalaccount
instead of being forwarded properly.
How do I make user+foo@example.com
be forwarded to the same destination as user@example.com
?
I tried adding entries like
user1+*@example.com foo+%2@example.org
but that didn't fix the problem...
Here are the debug-traces:
Without the detail:
% sendmail -d60.5 -bv g@example.com
map_lookup(dequote, me, %0=me) => NOT FOUND (0)
map_lookup(dequote, g, %0=g) => NOT FOUND (0)
map_lookup(virtuser, g@example.com, %0=g@example.com, %1=g) => gexample@example.net (0)
... works.
With the detail:
% sendmail -d60.5 -bv g+meow@example.com
map_lookup(dequote, me, %0=me) => NOT FOUND (0)
map_lookup(dequote, g+meow, %0=g+meow) => NOT FOUND (0)
map_lookup(virtuser, g+meow@example.com, %0=g+meow@example.com, %1=g+meow) => NOT FOUND (0)
map_lookup(virtuser, @example.com, %0=@example.com, %1=g+meow) => me (0)
map_lookup(dequote, me, %0=me) => NOT FOUND (0)
map_lookup(user, me, %0=me) => me<> (0)
g+meow@example.com... deliverable: mailer local, user me
... does not work -- comes to the catch-all local account "me".
If you want to virtusertable to redirect with +detail preserved then try:
Debug procedure
As root execute
sendmail -d60.5 -bv user1+x@example.net
.It should trace map lookups including virtusertable map lookups.
Try
sendmail -d21.12 -d60.5 -bv user1+x@example.net
if +detail is stripped before virtusertable lookups.user1+detail@example.com
by default should make sendmail look for the following virtusertable enries:user+@example.com (plus present but detail empty) conducts lookups 1+3+4+6+7
user@example.com (no +detail present) condutcs lookups 4+7
It seems that
+
is missing inOperatorChars
in yoursendmail.cf
. It makesR
lines insedmail.cf
see one tokenuser+detail
instead of three tokensuser
+
detail
.sendmail.cf
generated fromsendmail.mc
should set OperatorChars to.:%@!^/[]+
by default accoding to the bat book. It may be changed in mc file by definingconfOPERATORS
.Check what is reported by
grep OperatorChars /etc/mail/sendmail.cf