procmail
[Top] [All Lists]

Re: How to?

1997-05-15 14:38:00

Thank you, that worked, too.

And 2 more questions:

====

If a condition is met I'm sending the message to a certain address,
but I want the message to be the same as the original. But the
Return-Path gets changed to <daemon(_at_)localhost> since sendmail runs as
the user "daemon". Filtering the message with:

(FROM=`formail -rt -xTo:`)

  | formail  -I "Return-Path: $FROM" | /usr/lib/sendmail $address

doesn't help. Is there any other way?

(Currently it gets:     Return-Path: <daemon(_at_)localhost>)
(I want it to be:       Return-Path: <orginal-sender(_at_)original-hostname>)
=====

And my last question:

If I have a mailing list:

        test: :include: /home/mlist/test

And if I replace it with: 

        test: | " /usr/local/bin/procmail -m rcfile /home/mlist/test"

I can send mail to everybody in the /home/mlist/test file from within
the rcfile:

         |/usr/lib/sendmail `cat /home/mlist/test`

Is there a more efficient way? If I had 1000 users would that still
work?


Thanks again.


-Erdem Ozsaruhan
NSF Postmaster


Philip Guenther writes:
Pass in the alias involved on procmail's command line, then check $1
to
see what the envelope recipient was:

testacct:     "|/usr/local/bin/procmail -m /home/testuser/rc1
testacct
testacct2:    "|/usr/local/bin/procmail -m /home/testuser/rc1
testacct2


      TO = $1

      :0
      * TO ?? ^^testacct^^
      { # do testacct stuff
      }

      :0
      * TO ?? ^^testacct2^^
      { # do testacct2 stuff
      }


This even works correctly if testacct is subscribed to a mailing
list, or
is sent a Bcc:.

Philip Guenther

Erdem Ozsaruhan <eozsaruh(_at_)nsf(_dot_)gov> writes:
One more question:

I want to be able to use that rc file from /etc/aliases. Something
like:

testacct:    | "/usr/local/bin/procmail -m /home/testuser/rc1"

Instead of checking the Subject with:

    * ^Subject:.*TEST1*

I want to check the To field with:

    * ^TOtestacct

But when I call procmail like that from the /etc/aliases file,
procmail fails to check the To: field. How can I pass the To: field to
procmail? ( | "/usr/local/bin/procmail -m /home/testuser/rc1 -d testacct"
didn't work.)

I need to check the To: field, because that rc file (rc1) is going to
be used by more than one address.




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