how to upgrade spamassassin

CONFIGURATION OF SPAMASSASSIN

  1. CASE 1: SPAMASSASSIN HAS TO BE INSTALLED FOR THE FIRST TIME
    1. Currently the version of spamassassin which is 3.1.5 is present in
      /usr/src/packages/RPMS/i586
    2. For current installation if take the rpms from here and skip to point no. 12
    3. For the next version updation that is 3.1.6 and so on please read the following points
    4. log on to http://spamassassin.apache.org/
    5. If there are any announcements regarding updation of version that would be done on that main page of the site and a downloads links would be provided for the same.
    6. Click on that downloads link
    7. Download the latest version
    8. The version that we are using currently is 3.1.4. That has been updated on the site as 3.1.5. The explanation of installation would be done in the context of the version 3.1.5
    9. Download SpamAssassin in tar.gz format.
    10. As root user execute the command
       
         rpmbuild -tb Mail-SpamAssassin-3.1.5.tar.gz
        
    11. This will create the rpm of Spamassassin for the current version 3.1.5
    12. On Suse Linux 9.1 in the directory /usr/src/packages/RPMS/i586 the
      following rpms are created
       
          perl-Mail-SpamAssassin-3.1.5-1.i586.rpm
          spamassassin-3.1.5-1.i586.rpm
        
    13. Install the rpms in the order
      • perl-Mail-SpamAssassin-3.1.5-1.i586.rpm
      • spamassassin-3.1.5-1.i586.rpm
    14. execute the following command
       
          rpm -ivh perl-Mail-SpamAssassin-3.1.5-1.i586.rpm
          rpm -ivh spamassassin-3.1.5-1.i586.rpm  
        
    15. The executiion of the 2nd command might give the output of installation completion and along with that give this error:
       
      /var/tmp/rpm-tmp.97172: line 13: /sbin/service: No such file or directory
      error: %post(spamassassin-3.1.5-1) scriptlet failed, exit status 127
         
    16. Ignore that warning
    17. Execute the command
        rpm -qa | grep -i spam
        
    18. This will produce the following output
        spamassassin-3.1.5-1
        perl-Mail-SpamAssassin-3.1.5-1
        
    19. Restart amavis
       
        /etc/init.d/amavis restart 
        


    20. TESTING OF SPAMASSASSIN
      1. send test mail and check the log /var/adm/log/mail.log
      2. the amavis log while scanning the mail should have entries for spamassassin. For example an amavis log with spamassassin entry is
         
            Sep 22 13:31:38 apps1 amavis[19269]: (19269-01-8) TIMING [total 1783 ms] - SMTP
        pre-DATA-flush: 5 (0%)0, SMTP DATA: 1092 (61%)62, body_digest: 2 (0%)62,
        gen_mail_id: 0 (0%)62, mime_decode: 9 (1%)62, get-file-type1: 9 (0%)63,
        decompose_part: 2 (0%)63, parts_decode: 0 (0%)63, AV-scan-1: 9 (1%)63,
        spam-wb-list: 4 (0%)63, SA msg read: 1 (0%)64, SA parse: 2 (0%)64, SA check: 382 (21%)85
      3. Here the entry has the parts of SA msg read, SA check and so on. This means that spamassassin is taken into consideration by amavis during its scanning procedure.


  2. CASE 2: SPAMASSASSIN HAS BEEN INSTALLED AND NEEDS TO BE UPGRADED
    1. In order to do this we need to remove the earlier rpms and install the newer version.
    2. Make a tar of the current version and the version of spamassassin that is running and scp the same to the target mail server.
    3. We are also taking the current working version of spamassassin along with the newer version because if we need to roll back to the earlier version
    4. Log on to the target mail server
    5. Consider this scenario that the current version of spamassassin is 3.1.4 and we need to install 3.1.5
    6. Execute the command
        rpm -qa | grep -i spam
        
    7. This will produce the following output
        spamassassin-3.1.4-1
        perl-Mail-SpamAssassin-3.1.4-1
        
    8. Please note that this output is produced because version 3.1.4 is running on the mail server if any other version was there then the corresponding output would have been produced.
    9. Execute the following commands to remove the current rpm
        rpm -e spamassassin
        rpm -e perl-Mail-SpamAssassin
        
    10. Carry out the installation from point 14 of CASE 1 and the testing as described earlier