procmail
[Top] [All Lists]

Procmail on Pair Networks - Writing Custom Filters

2010-02-26 09:38:16
Hi,

 

I use Pair Networks (www.pair.com) as my webhosting company.

 

Pair uses a web-based GUI to help with the configuration of the mail system.
Pair tell me they use Procmail. Via the Email Management GUI, basic
'forward' and 'auto-responder' 'recipes' can be configured - this is very
easy to do and I have set-up a number of these.

 

For one particular purpose, I want to validate incoming [To:] addresses to
confirm that they conform to a certain syntax before either being delivered
to a local mailbox or bounced.

 

Within the Email Management GUI Pair provide something they call a 'filter'
recipe. Pair's support tell me that these 'filters' can be written in
Python, PHP, Java (in fact, any language available to me on the server).
Unfortunately, Pair provide no further documentation. I have no idea what
fields would be passed to my script, the API nor how I can affect the flow
of mail.

 

Searching Procmail's documentation appears to use the word 'filter' in a
more specific manner; referring to files with contents such as this:

 

:0

* ^Subject:.*\<testing

.testing/

 

The Pair interface uses the following when describing the 'Filter recipe':

 

=========

_Create Filter_

 

Recipient E-mail Address: _an(_dot_)email(_dot_)address(_at_)mydomain(_dot_)com_

 

Recipe Type: Filter

 

In the E-Mail Filter command below, enter the command that should filter
e-mail sent to an(_dot_)email(_dot_)address(_at_)mydomain(_dot_)com(_dot_) The 
command will be
interpreted using the sh shell. If you do not provide an absolute path to
the program, the system will assume the filtering program lives in your Home
directory (/usr/home/#my_username#).

=========

 

I'm not a Linux man and I'm confused. I have no idea how to craft my script
such that it interfaces appropriately to filter (validate) my incoming mail
or control the flow of that mail.

 

I'd be very grateful if someone would point in towards some documentation
that might help or give me some pointers. I'm happy to write my 'filter'
script in PHP, Python or Java. If I had a preference at all, it would
probably be PHP.

 

With kind regards,

 

Ken

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