Please note, that I have only tried this once, and it worked with my system under the test conditions at that time. There is no guarantee that it will work under real life situations.
I'm not going to go into the full details of the sendmail configuration file, you can find out about that from the many sendmail howtos available.
What you need are these (in /etc/mail/sendmail.mc):
FEATURE(`genericstable', `hash -o /etc/mail/genericstable') FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable')
Then, in /etc/mail/genericstable (no .db), add this:
@localhost.localdomain realuser+%1@yourisp.com
In /etc/mail/virtusertable (no .db), add this:
realuser+*@yourisp.com %2@localhost.localdomain
replace localhost.localdomain with the name of your local mail server.
now, in /etc/mail/, either run make (if you have a makefile in there), or do:
% makemap hash genericstable.db < genericstable % makemap hash virtusertable.db < virtusertable
Restart sendmail.
Now, I'm assuming that you're using fetchmail to get mail from your ISP's account. In that case, you could set up fetchmail to use multidrop, but that is very complicated, and prone to mail loops and undelivered mail. Instead, I'd suggest telling fetchmail to forward mail to procmail (both running as root), or let sendmail use procmail as the default mailer.
Then, have procmail decide who the mail should go to.
If you use sendmail to call procmail, then you can check $1 in the procmailrc file to find out what was passed after the + sign, so you can have a rule like this:
:0 To: realuser+$1 !$1@localhost.localdomain
You'll have to try these things and tweak around a bit to see what works, but when you do get it working right, post your procedure to the group.
I'm sure there are other solutions, and products that make it much easier to do this thing, but the basic problems I see with trying to serve many users with a single mailbox, is that if mail is addressed to two users (eg: tellis+philip@vsnl.net and tellis+santosh@vsnl.net), there will only be one mail in the mailbox. I have no idea what sendmail will do with the addresses, and how you will sort them. Also, if the address is in the bcc field, then forget it. You'll have to write a separate rule for the Cc: field.
One last thing. When you get this working, tell you users to set their email address as localuser@localhost.localdomain, and to tell everyone outside the company that their address is realuser+localuser@yourisp.com
Hope this helps. I really really hope.
Philip