procmail
[Top] [All Lists]

Re: procmail Digest, Vol 94, Issue 21

2010-11-26 11:43:49
On 26-11-2010 12:06, Emmanuel Buamah wrote:
Thank you so much for your reply. I have to explain in detail what I am actually targeting. I am new to prpcmail, but in the current mail server (MDaemon)
The way the content filter work is like this:

If the To header contains support(_at_)domain(_dot_)com then a program is run. This program will query the company's database to see if the sender is a client or not. If is a client, the script will then tag the subject with the account manager's id and return a particular exitcode.

Now the content filter will now check the exitcode of the program and use the new subject to deliver the mail. If a different exit code is return by the program, then a different action is taken which is to delete the message and not allow it pass through.

This is the same thing I want to do.

Right now, the procmail is able to run the script and the script too is able to query the database and tag the subject header, but how to feed this back to procmail and procmail too should check the exit code and take the necessary actions on it.

Attach is the script I worked on. Unfortunatly, I don't have the procmailrc on this pc so I can't send it right now.

I will also go through what you sent and try to work some thing out though am confuse.

First off, the perl script you attached doesn't do what you describe above.

Sean showed you a number of ways to look at exit codes.

But you can do what you want without exit codes by using inserted headers instead. Since you are going to be manipulating the message extensively in the called perl script, just call it as a filter from procmail and add a specific header according to what you want procmail to do when the perl script finishes.

Your perl script should read the message on STDIN and write the new message to STDOUT and that way procmail will have all the information it needs.

Rich
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

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