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

..07-Jul-2004-

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

readme.procmail

1Websieve for Procmail setup.
2
3Here's what you need to do to get websieve to generate procmail rules.
4
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.
13
14Create the directory structure where your users recipes will be stored.
15Remember, it must be writeable by the "cyrus" user.
16
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:
19
20Set the following parameters in the corresponding postfix config files:
21
22in main.cf:
23mailbox_transport = procmail
24
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}
28
29
30- change the location of the procmail.cyrus file to your location setup.
31
32Set $useprocmail=1 and in websieve.conf (at the bottom in the supplied copy)
33Also set the other parameters to suit your location.
34
35Note:  IMPORTANT:  Don't forget to set the secret key in the
36X-Customfilters: line to match the one in websieve.conf
37
38Theory of Operation
39
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'
48attribute.
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.
53
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.
57
58
59