cvs commit: hints postfix+spamassassin+razor.txt

timothy at linuxfromscratch.org timothy at linuxfromscratch.org
Wed Jan 15 21:20:07 PST 2003


timothy     03/01/16 00:20:07

  Modified:    .        postfix+spamassassin+razor.txt
  Log:
  Software upgrade and integrated a perl daemon.
  
  Revision  Changes    Path
  1.3       +20 -43    hints/postfix+spamassassin+razor.txt
  
  Index: postfix+spamassassin+razor.txt
  ===================================================================
  RCS file: /home/cvsroot/hints/postfix+spamassassin+razor.txt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- postfix+spamassassin+razor.txt	5 Apr 2002 17:43:12 -0000	1.2
  +++ postfix+spamassassin+razor.txt	16 Jan 2003 05:20:07 -0000	1.3
  @@ -9,11 +9,17 @@
   
   HINT
   
  -Version 1.1 - April 5th, 2002
  +Version 1.2 - January 15th, 2003
   
   Changelog:
  -1.1		- Added bugfix for the
  -		/usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/PerMsgStatus.pm file
  +
  +1.2	- Updated for latest software versions
  +	- Using perl daemon for increased performance rather than start the
  +	  entire perl program for every incoming email.
  +	- Removed the spamassassin bug fix from version 1.1
  +
  +1.1	- Added bugfix for the
  +	  /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/PerMsgStatus.pm file
   
   The main reason I've set it up at linuxfromscratch.org at the SMTP level is
   to do a spam check before spam hits the mailinglists. Spam is then delivered
  @@ -28,31 +34,9 @@
   Spamassassin:	http://www.spamassassin.org
   Razor:		http://razor.sourceforge.net
   
  -The current Razor version at the time of writing this hint is version 1.20.
  -However, there's a problem with Spamassassin and Razor 1.20. Get Razor-1.19
  -for best results, or try out the Spamassassin CVS version (there was a bug
  -in Razor-1.19 that resulted into a workaround added to Spamasassin. This
  -bug in Razor was fixed in razor-1.20 which now breaks the spamassassin
  -workaround. Spamassassin-CVS is updated again, but not official new release
  -is out there).
  -
   Read the docs, install it. It's all very straightforward. I'll just deal
   with setting it up to work in Postfix.
   
  -If you installed Spamassassin-2.11 you need to fix the
  -/usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/PerMsgStatus.pm file. It
  -contains a minor bug that makes the Razor check fail in the majority of the
  -cases (it forgets to add a newline between the header and body so Razor
  -doens't always compute the right SHA because of it).
  -
  -Edit the file, go to line 443 which looks like this:
  -
  -	return join ("", $self->{msg}->get_all_headers(),
  -
  -Add "\n", to it, so the line looks like:
  -
  -	return join ("", $self->{msg}->get_all_headers(), "\n",
  -
   Let's continue with setting up postfix. The postfix distribution comes
   with the README_FILES/FILTER_README file you want to read through. It
   gives some background information on how the filtering works in Postfix
  @@ -74,10 +58,10 @@
   Create the filter script that postfix will be running for every email that
   comes in:
   
  -cat /home/postfixfilter/postfixfilter << "EOF"
  +cat /usr/bin/postfixfilter << "EOF"
   #!/bin/bash
   
  -/usr/bin/spamassassin -P | /usr/sbin/sendmail -i "$@"
  +/usr/bin/spamc | /usr/sbin/sendmail -i "$@"
   
   exit $?
   EOF
  @@ -86,10 +70,13 @@
   as root or something.
   
   What does it do? Postfix dumps an email to /usr/bin/postfixfilter. We
  -intercept it and dump to spamassassin. We tell spamassassin to write to
  -stdout (the -P option) and then pipe stdout to sendmail's stdin which
  -re-inserts the email into postfix for continued deliverly. Then exit with
  -whatever sendmail's return value was.
  +intercept it and dump to spamc. Spamc connects to the spamd daemon and will
  +run the spam checking tests, then pipe the rewritten email (now including
  +the spam result headers) to sendmail for continued delivery. It then exits
  +with whatever sendmail's return value was.
  +
  +So, we need to have the spamd daemon running. I added it to the postfix
  +bootscript, using the command "spamd -d -u postfixfilter".
   
   Next, configure postfix to do filtering.
   
  @@ -109,13 +96,12 @@
   It would be advisable to indent it with a tab or some spaces just so you
   can easier see that it belongs to the previous line. Do not forget the
   colon at the end of the postfixfilter. I'm not quite sure what it does, but
  -the FILTER_README file warns to do it, so I just do it. I have yet to
  -figure it out.
  +the FILTER_README file warns to include it, so just do it.
   
   Append the following lines to the end of the master.cf file:
   
   postfixfilter unix - n n - - pipe
  -        flags=Rq user=postfixfilter argv=/home/postfixfilter/postfixfilter -f ${sender} -- ${recipient}
  +        flags=Rq user=postfixfilter argv=/usr/bin/postfixfilter -f ${sender} -- ${recipient}
   
   
   Okay, if you did exactly what I told you to do and I didn't forget to tell
  @@ -127,13 +113,4 @@
   Incoming mail should now be filtered for spam by spamassassin. You can
   configure spamassassin and razor through the config files in
   /home/postfixfilter
  -
  -Disclaimer: I wrote this hint after I set it up on linuxfromscratch.org.
  -Things are setup a little bit differently on linuxfromscratch.org and I
  -didn't use the groupadd/useradd command, nor using /home/postfixfilter.
  -What I wrote here just seems more sensible (I thought of it after I set it
  -up on linuxfromscratch.org, so I'll be changing the setup there one day).
  -Let me know if I wrote down something wrong here, because I did not
  -actually test everything I wrote step-by-step. I may have missed a few
  -steps.
   
  
  
  
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe hints' in the subject header of the message



More information about the hints mailing list