procmail
[Top] [All Lists]

getting sendmail & procmail to use + addressing for virtual domains

2002-07-26 14:15:55
Hi,

I'm new to procmail and am having a bit of trouble getting sendmail and
procmail to cooperate (at least I think that's what's going wrong).

The problem I'm trying to solve is this: I have a couple of different
email addresses for virtual domains that are all hosted on the same
server (charlie(_at_)tabloid(_dot_)net and 
charlie(_at_)nothingspecial(_dot_)com are two of
them). They all go to my user account 'charlie' on the server. However,
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).

(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.)

My hope was that I could use a variation on the recipe given at
http://www.sendmail.org/faq/section3.html#3.29 to identify and
auto-respond to any messages that arrived via tabloid.net.

So I added the following line to sendmail's virtusertable file:

    charlie(_at_)tabloid(_dot_)net           charlie+tabloid

then rebuilt the virtusertable.db file and hupped sendmail. Next, I
added the following to my .procmailrc file:

     ENV_TO=$1
     DOMAIN=tabloid.net

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

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

(The full .procmailrc file is shown at the end of this message.)

The problem is that the first condition ("* ENV_TO ?? .") is never
satisfied, and I can't figure out why. Every time I send a message to
charlie(_at_)tabloid(_dot_)net, it comes through with the X-Envelope-To: header 
set
to "UNKNOWN".

I've even tried sending messages to charlie+test(_at_)tabloid(_dot_)net and
charlie+test(_at_)nothingspecial(_dot_)com, but I still don't see the behavior 
I'm
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 virtusertable entry for
charlie(_at_)nothingspecial(_dot_)com just points to 'charlie' -- no
plus-addressing or anything weird.)

The logs for procmail look pretty much like you'd expect; here's what
happened when I sent a test message (subject: test #1) to
charlie+test(_at_)nothingspecial(_dot_)com:

     procmail: [1507] Fri Jul 26 13:18:18 2002
     procmail: Assigning "ENV_TO="
     procmail: Assigning "DOMAIN=tabloid.net"
     procmail: No match on "."
     procmail: Executing "formail,-i,X-Envelope-To: UNKNOWN"
     procmail: Executing "spamc"
     procmail: [1507] Fri Jul 26 13:18:19 2002
     procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail -oi clhmail"
     procmail: Notified comsat: "charlie@:/usr/sbin/sendmail -oi clhmail"
     From charlie(_at_)nothingspecial(_dot_)com  Fri Jul 26 13:18:18 2002
      Subject: test #1
       Folder: /usr/sbin/sendmail -oi clhmail 899
     procmail: [1507] Fri Jul 26 13:18:19 2002
     procmail: Executing "/usr/sbin/sendmail,-oi,clhmail"

And here's the resulting message:

     Return-Path: <charlie(_at_)hedrick(_dot_)k4azl(_dot_)net>
     Received: (from charlie(_at_)localhost)
      by hedrick.k4azl.net (8.11.2/8.11.0) id g6QKIJB01513 for clhmail;
      Fri, 26 Jul 2002 13:18:19 -0700
     Received: from mail.dslextreme.com (mail.dslextreme.com [66.51.205.14])
      by hedrick.k4azl.net (8.11.2/8.11.0)
      with SMTP id g6QKIIY01505 for 
<charlie+test(_at_)nothingspecial(_dot_)com>;
      Fri, 26 Jul 2002 13:18:18 -0700
     Received: (qmail 4151 invoked from network);
      26 Jul 2002 20:19:38 -0000
     Received: from adsl-66-218-51-253.dslextreme.com (HELO ?192.168.0.5?) 
(66.218.51.253)
      by mail.dslextreme.com
      with SMTP;
      26 Jul 2002 20:19:38 -0000
     Date: Fri, 26 Jul 2002 13:25:09 -0700
     From: Charles Hornberger <charlie(_at_)nothingspecial(_dot_)com>
     To: charlie+test(_at_)nothingspecial(_dot_)com
     Subject: test #1
     Message-Id: 
<20020726132444(_dot_)3162(_dot_)CHARLIE(_at_)nothingspecial(_dot_)com>
     MIME-Version: 1.0
     Content-Type: text/plain; charset="US-ASCII"
     Content-Transfer-Encoding: 7bit
     X-Mailer: Becky! ver. 2.05.04
     X-Envelope-To: UNKNOWN
     X-Spam-Status: No, hits=0.0 required=9.0 tests= version=2.01
     X-UIDL: JMd!!NSI"!?6W"!aH,"!

     testing...

Any suggestions would be greatly appreciated.

Best,
Charlie

P.S. My full .procmailrc follows:

LOGFILE=/tmp/charlie.procmail.log
VERBOSE=ON
ENV_TO=$1
DOMAIN=tabloid.net

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

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

:0fw
      #| /usr/bin/spamassassin -P
      | spamc

      :0e
      {
        EXITCODE=$?
      }
:0
!clhmail

-- 
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>