• Home
  • History
  • Annotate
  • current directory
Name Date Size #Lines LOC


filter.pl.ldapH A D07-Jul-20046.7 KiB

procmail.cyrusH A D07-Jul-20041.3 KiB

readme.procmailH A D07-Jul-20042.4 KiB


1Websieve for Procmail setup.
3Here's what you need to do to get websieve to generate procmail rules.
5Copy filter.pl, auth.pl and procmail.cyrus (from the procmail subdirectory)
6to a directory of your choice.
7modify filter.pl's parameters to reflect your local settings as well as
8the location of your auth.pl, and user directory structure to store
9your user procmail rules.  Don't forget to also set the adminuid and
10adminpass of an LDAP user that has read access to the 'matchingrules'
11LDAP attribute of all users.
12You can copy "procmail.cyrus" to /etc.
14Create the directory structure where your users recipes will be stored.
15Remember, it must be writeable by the "cyrus" user.
17Setup your MTA to deliver to procmail.  This will vary if you're using
18sendmail or other MTA.  I use postfix so I'll describe that setup:
20Set the following parameters in the corresponding postfix config files:
22in main.cf:
23mailbox_transport = procmail
25in master.cf:
26procmail  unix	-	n	n	-	-	pipe
27     flags=R user=cyrus argv=/usr/bin/procmail -p /etc/procmail.cyrus CYUSER=${user} EXTENSION=${extension} RECIP=${recipient}
30- change the location of the procmail.cyrus file to your location setup.
32Set $useprocmail=1 and in websieve.conf (at the bottom in the supplied copy)
33Also set the other parameters to suit your location.
35Note:  IMPORTANT:  Don't forget to set the secret key in the
36X-Customfilters: line to match the one in websieve.conf
38Theory of Operation
40- when a rule is created and saved, the pseudo rulesets are saved into
41the users 'matchingrules' LDAP attribute.
42- an email is sent to the 'cyrus' user containing the user id of the user,
43and a secret key to identify the server.
44- the email is passed through the procmail.cyrus rc file and is caught by
45the first rule for the 'cyrus' user.  Upon a match it pipes the email to
46the "filter.pl" program which extracts the uid and then connects to the
47LDAP server, and extracts the pseudo code from the user's 'matchingrules'
49- filter.pl then converts the pseudo code to an actual procmail recipe
50file, creates the users vacation messages, reply files if needed in the
51common recipe directory.  This filter only runs when a user submits
52a change to his rules.
54- any emails received go through the procmail.cyrus recipe file which then
55looks for a matching user recipe file and if found processes that users
56recipes or simply calls deliver to send the mail to the user's inbox.