Hi,

I was just messing around with the perlfilter and I got it to work with
the Debian/woody package. I am currently testing with debian 3.0/stable
because that is what my mailserver runs, so the debian package version
of courier I'm using is 0.37.3-2.3

Here are the changes to make perlfilters function properly with the
deb's.

First, the perlfilter-wrapper.pl has to be installed properly. It's not
a documentation file and is in the wrong place:

  mv /usr/share/doc/courier-mta/examples/perlfilter-wrapper.pl \
     /usr/lib/courier/

In /usr/sbin/filterctl, change the following two variable definitions to
what is shown here so that it can properly control the courierfilter
process:

  localstatedir="/var/run/courier"
  pidfile="${localstatedir}/courierfilter.pid"

Then do the following as the perlfilter and mta are running as user
'daemon'. (Make the directories now if they do not exist, and if they do
and you're having problems with filters, make sure the socket files are
owned by daemon:daemon)

  mkdir /var/lib/courier/filters
  mkdir /var/lib/courier/allfilters
  chown -R daemon:daemon /var/lib/courier/filters
  chown -R daemon:daemon /var/lib/courier/allfilters

For configuration, /etc/courier/filters/perlfilter contains the path to
the example script as in the docs. I have placed it in
/etc/courier/filters/, and /etc/courier/filters/perlfilter-mode is set
to 'all'. I have not experimented with non-mandatory filters on the
Debian package version of courier yet.

-- /etc/courier/filters/perlfilter -------------------
/etc/courier/filters/perlfilter-example.pl
------------------------------------------------------

-- /etc/courier/filters/perlfilter-mode --------------
all
------------------------------------------------------

Finally to start all you should have to do at this point is:

  filterctl start perlfilter

To check it's running do a `ps auxw` and look for perlfilter processes
running as user 'daemon'

Three final notes:

I believe there is a bug in the perlfilter-example.pl that comes with
the current debian package. Perl sometimes chokes on eval'ing it with
the error, "perlfilter: eval error: Too many arguments for
Embed::etc::courier::filters::perlfilter_2dexample_2epl::filterdata at
(eval 2) line 45, near "$line)"/To..." This error may be fixed in a
newer version of perlfilter, perlfilter-wrapper.pl or
perlfilter-example.pl - I have not tracked it down, as this is only the
example filter.

Also, it does not appear that `courierfilter restart` command causes the
filter system to be restarted. `courierfilter stop; courierfilter start`
works.

Finally, it's unclear whose job it is to remove the socket files in
/var/lib/courier/filters and /var/lib/courier/allfilters .. I would
think that `filterctl stop <filter>` should remove them, but it does not
in the current Debian package. If you intend to stop filtering with
perlfilter then you must remove the socket file or else you will get the
'Mail filters temporarily unavailable' message and users will be unable
to send mail.

John Laur

-----Original Message-----
From: Hilko Bengen [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 20, 2003 2:00 PM
To: John Laur
Subject: Re: perlfilter, courier, amavis-ng

"John Laur" <[EMAIL PROTECTED]> writes:

> I was wondering if you had made any progress with debian's courier
> and perlfilters or amavis-ng and courier. I started trying to get
> amavis-ng and perlfilter to play nice on Debian yesterday and am
> hitting all the same problems you seem to have hit --- the
> perlfilter process dying, etc.

No, but I haven't tried in quite some time. What version (of Debian
and Courier) are you using?

-Hilko



-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to