procmail
[Top] [All Lists]

Re: getting sendmail & procmail to use + addressing for virtual domains

2002-07-26 15:30:48
Sean,

Thanks very much for your quick & sane advice -- I'll probably use it.
(As to why I don't simply deactivate the account & start sending bounces
right now ... I'd just rather not, for reasons that aren't really
important.)

I'm still curious how the recipe given at 
http://www.sendmail.org/faq/section3.html#3.29
is supposed to work. ISTM the point of it is to redirect mail for a virtual
user of some virtual domain, let's say it's 'bob(_at_)domain(_dot_)com', to the
_real_ user account 'domuser' -- but with the original recipient's
username tacked on with plus-addressing. Thus they recommend adding

    @domain.com domuser+%1

to the virtusertable file and putting the following recipes into
/home/domuser/.procmailrc:

DOMAIN=domain.com
ENV_TO=$1

:0f
* ENV_TO ?? .
| formail -i "X-Envelope-To: "$ENV_TO(_at_)$DOMAIN

:0fE
| formail -i "X-Envelope-To: UNKNOWN"

I had assumed (apparently incorrectly) that $1 must contain the portion
of the recipient following the + sign. I still don't see how this recipe
makes any sense otherwise. And I'm pretty confused about why 
-- at least for me -- $1 never contains anything; if, as you say,
sendmail passes the account name to procmail, why am I not getting
'charlie' in the ENV_TO variable?

Not to be too much of a bother, but is there any chance you could
explain where I've gone off-track?

Anyway, thanks again for your help!

Best,
Charlie

On Fri, 26 Jul 2002 14:56:35 -0700
PSE-L(_at_)mail(_dot_)professional(_dot_)org (Professional Software 
Engineering) wrote:

At 14:10 2002-07-26 -0700, Charles Hornberger did say:
one of them -- my old charlie(_at_)tabloid(_dot_)net address -- has been 
completely
inundated with spam, and I'd like to stop using it ... but I don't
necessarily want to start sending bounces right away. I'd prefer to
generate an auto-reply to any messages that arrive at the
charlie(_at_)tabloid(_dot_)net address, telling people (nicely) that unless 
they're
sending me spam, they should use my other address
(charlie(_at_)nothingspecial(_dot_)com).

Why "ease" anyone into it?  Those whom you _actually_ communicate with 
should catch on quick enough, and the sooner they switch to your new 
address, the sooner you're not accepting spam at the abused address.  So, 
why not just create a bounce via virtusertable:

charlie(_at_)tabloid(_dot_)net     ERROR: 550 SPAM not accepted here, see 
<http://blah....> for updated contact information.


This way, you're refusing the message right at the addresssing phase, 
rather than accepting the whole darned thing (that includes the volumes of 
spam that you're closing the account because of), *AND* you're not 
providing the email address in the clear - either via an autoreply (which 
MIGHT go to a spammer, though generally will just bounce), or via the 
bounce text (which you could list the address instead of a URL if you 
wanted to).  People interested in still emailing you could click on the URL 
and get info (and perhaps that nice explanation you want to provide them 
with).  Mailing lists to which you might be subscribed should eventually 
purge the address (though, if you're subscribed to anything, YOU should 
take the initiative and unsub).

Total technical investment: tweak to virtusertable entry, and a simple 
webpage.

(It might be worth noting at this point that I don't actually log in
over POP3 to the 'charlie' account, since that account has shell access
to the server and I don't like sending such passwords in the clear;
instead, the last line in my .procmailrc file forwards all messages for
charlie to a mail-only account on the same machine.)

I can think of several alternate approaches, but this is workable for you...

looking for. It seems like procmail just isn't getting passed the '+'
part of the recipient address ... either that or it's storing it
somewhere other than in $1.

The recipient _address_ isn't passed on the commandline to the LDA.  The 
"address" which the LDA is provided with is the user _account_ (which 
plussing doesn't apply to).

Since you obviously administer the server, if the above suggestion of 
setting it to BOUNCE with a specific message isn't workable, then how about 
you try setting up an alias:

[virtusertable]
charlie(_at_)tabloid(_dot_)net     charlie_xx

[aliases]
charlie_xx      charlie, "|/usr/local/bin/procmail -m 
/etc/procmailrcs/charlie_bounce.rc charlie(_at_)tabloid(_dot_)net"


this way, the mail still arrives at your mailbox (and is filtered 
normally), and *SEPARATE FROM THAT*, a copy is delivered to an rcfile that 
handles your autoreply advisory, and as an argument to that, is being 
passed the address which the alias is tied to (if you wanted to use the 
script to handle more than one such notification condition).

When at some point, you want to send just the notification but not deliver 
the messages to a user, you would strip charlie from the list of 
recipients.  Alternatley, you'd remove both entries, and/or change the 
virtusertable one to a bounce message similar to the one I describe above.

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

-- 
Charles Hornberger <charlie(_at_)nothingspecial(_dot_)com>
1650 N. Alvarado St.
Los Angeles, CA 90026
tel 213 483 0517
fax 509 461 7508

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>