"Mxsmanic" <[EMAIL PROTECTED]> writes:

| What do I have to do to make a simple Perl script filter incoming mail for a
| mailbox?  I wrote a script that just reads standard input and writes it to
| standard output, then put it in my home directory, then changes
| /etc/mail/aliases to point to it, like this:
| 
| mymail:    "|/usr/home/mymail/perlfilter"

I know that seems like the way it should work . . . but it's not.  What that
does is just pipe the message to your script---and at that point, sendmail is
done.  The output from your script went into the bit bucket.

What you're going to have to do is open up a sendmail process.  You can do
something like this in your Perl script, though:

        open( MAIL, "| /usr/sbin/sendmail" );
        print MAIL $headers;
        print MAIL $body;
        close MAIL;

Your headers will have to have all the relevant information, and be separated
from the body with a blank line.

Good luck with that.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to