I know this may be weird, but hear me out. I've set up our sendmail with
a ruleset that basically looks in the password file and if the user that
is being sent To: is not in the passwd file then it passes the mail onto
procmail (instead of returning it as bounced mail). Why? Well because I
want to capture all the users that are numbers (for example
2345345(_at_)whatever(_dot_)com) and pass them to a program. This is no
problem, I've
got it working, this is what I am using for a /etc/procmailrc:
:0
* ^To:[ ]*[0-9]
{
:0
|/usr/local/bin/program
}
:0
The problem now is if I mail to a user who doesn't exist on the system and
who ISN'T a number I get a procmail boo-boo, for example:
From MAILER-DAEAMON(_at_)test(_dot_)com Wed Sep 11 10:25:31 1996
Date: Thu, 12 Sep 1996 02:14:19 +0900
From: Mail Delivery Subsystem <MAILER-DAEMON(_at_)test(_dot_)com>
To: micah(_at_)smmedia(_dot_)com
Subject: Returned mail: Can't create output: Error 0
The original message was received at Thu, 12 Sep 1996 02:14:18 +0900
from micah(_at_)smmedia(_dot_)com [207.66.144.3]
----- The following addresses had delivery problems -----
<smmit(_at_)test(_dot_)com> (unrecoverable error)
----- Transcript of session follows -----
procmail: [1324] Thu Sep 12 02:14:19 1996
procmail: Assigning "PMDIR=/var/log/procmail"
procmail: Assigning "LOGFILE=/var/log/procmail/log"
procmail: Opening "/var/log/procmail/log"
550 <smmit(_at_)test(_dot_)com>... Can't create output: Error 0
----- Original message follows -----
[ Part 2: "Included Message" ]
Date: Wed, 11 Sep 1996 10:15:29 -0700 (PDT)
From: Micah Anderson <micah(_at_)smmedia(_dot_)com>
To: smmit(_at_)test(_dot_)com
Subject: test
test
Its an ugly returned message... What I want to do is generate the User
Unknown Mailer-DAEMON message and return that... any ideas?
Thanks,
Micah