Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Mailscanner + spamassassin + clamav package

    Scheduled Pinned Locked Moved pfSense Packages
    313 Posts 54 Posters 305.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      ics
      last edited by

      @marcelloc:

      Will be there  when you update/upgrade the package. :)

      And about updates, is there a procedure to update packages ?
      Or I just need to click on "Reinstall this package" in the package manager ?

      package.png
      package.png_thumb

      1 Reply Last reply Reply Quote 0
      • marcellocM
        marcelloc
        last edited by

        Normally, just update.

        A backup first is always a good idea.  :)

        Treinamentos de Elite: http://sys-squad.com

        Help a community developer! ;D

        1 Reply Last reply Reply Quote 0
        • E
          expert_az
          last edited by

          Hello Marcello

          i just installed postfix and mailscanner on my pre production pf box,and getting this error on my system log

          My pf version:
          2.0.1-RELEASE (amd64)
          built on Mon Dec 12 18:16:13 EST 2011
          FreeBSD 8.1-RELEASE-p6

          Jun 7 16:32:39 MailScanner[15521]: Syntax error in line 145, value "" for allowscripttags is not one of allowed values "yes","disarm","no"
          Jun 7 16:32:39 MailScanner[15521]: Reading configuration file /usr/local/etc/MailScanner/conf.d/README
          Jun 7 16:32:39 MailScanner[15521]: Reading configuration file /usr/local/etc/MailScanner/MailScanner.conf
          Jun 7 16:32:39 MailScanner[15521]: MailScanner E-Mail Virus Scanner version 4.83.5 starting…
          Jun 7 16:32:39 mailscanner: Process did not exit cleanly, returned 1 with signal 0
          Jun 7 16:32:39 MailScanner[3723]: ClamAV Module ERROR:: Could not load databases from /var/db/clamav
          Jun 7 16:32:39 MailScanner[3723]: I have found clamavmodule scanners installed, and will use them all by default.
          Jun 7 16:32:34 MailScanner[8485]: Enabling SpamAssassin auto-whitelist functionality…
          Jun 7 16:32:34 MailScanner[8485]: Connected to SpamAssassin cache database
          Jun 7 16:32:34 MailScanner[8485]: Using SpamAssassin results cache

          1 Reply Last reply Reply Quote 0
          • I
            ics
            last edited by

            Your antivirus is up to date ?
            freshclam –version

            clamav is not automatically updated, you have configure your crontab.
            To update manually :
            /usr/local/bin/freshclam

            1 Reply Last reply Reply Quote 0
            • E
              expert_az
              last edited by

              /usr/local/bin/freshclam
              ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).
              ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).

              freshclam –version
              ClamAV 0.97.3

              1 Reply Last reply Reply Quote 0
              • C
                Chuckit
                last edited by

                /usr/local/bin/sa-update    -> this one too  ;)

                1 Reply Last reply Reply Quote 0
                • E
                  expert_az
                  last edited by

                  sa-update
                  /usr/local/lib/perl5/site_perl/5.12.4 /usr/local/lib/perl5/5.12.3/BSDPAN /usr/local/lib/perl5/site_perl/5.12.3/mach /usr/local/lib/perl5/site_perl/5.12.3 /usr/local/lib/perl5/5.12.3/mach /usr/local/lib/perl5/5.12.3) at /usr/local/bin/sa-update line 80.
                  BEGIN failed–compilation aborted at /usr/local/bin/sa-update line 80.

                  1 Reply Last reply Reply Quote 0
                  • marcellocM
                    marcelloc
                    last edited by

                    @expert_az:

                    sa-update
                    /usr/local/lib/perl5/site_perl/5.12.4 /usr/local/lib/perl5/5.12.3/BSDPAN /usr/local/lib/perl5/site_perl/5.12.3/mach /usr/local/lib/perl5/site_perl/5.12.3 /usr/local/lib/perl5/5.12.3/mach /usr/local/lib/perl5/5.12.3) at /usr/local/bin/sa-update line 80.
                    BEGIN failed–compilation aborted at /usr/local/bin/sa-update line 80.

                    Are you using the latest mailscanner package version?

                    Treinamentos de Elite: http://sys-squad.com

                    Help a community developer! ;D

                    1 Reply Last reply Reply Quote 0
                    • E
                      expert_az
                      last edited by

                      mailscanner-dev Services Package Info 4.83.5 pkg v.0.2.1

                      1 Reply Last reply Reply Quote 0
                      • M
                        mschiek01
                        last edited by

                        Clamd::ERROR:: UNKNOWN CLAMD RETURN ./lstat() failed: Permission denied. ERROR :: /var/spool/MailScanner/incoming

                        Is anyone seeing this error in the /var/log/maillog.  It's obviously a permissions error, but I can not figure out how to get rid of it.

                        the /var/spool/MailScanner/ is created by postfix. I tried adding clamav to the postfix group as well as www and wheel the error still occurs.

                        1 Reply Last reply Reply Quote 0
                        • marcellocM
                          marcelloc
                          last edited by

                          clamd should be running with postfix user.

                          Try to apply maiscanner config and check in /usr/local/etc/clamd.conf what user is configured.

                          att,
                          Marcello Coutinho

                          Treinamentos de Elite: http://sys-squad.com

                          Help a community developer! ;D

                          1 Reply Last reply Reply Quote 0
                          • M
                            mschiek01
                            last edited by

                            Multiple installs all installed

                            postfix->mailscanner->dansguardian

                            I check them all all have

                            Run as another user (clamd must be started by root for this option to work)

                            Default: don't drop privileges

                            User clamav

                            Tried save mailscanner configuration and enabling and disabling the daemon. It appears that the program is not updating the clamd.conf at all.

                            Did a new clean install -postfix-mailscanner-dansguardian.  Saved the mailscanner config and checked the clamd.conf "clamav" was still the user.

                            Manually edited the clamd.conf and changed the user from "clamav" to "postfix" reboot and everthing is working properly.

                            1 Reply Last reply Reply Quote 0
                            • marcellocM
                              marcelloc
                              last edited by

                              @mschiek01:

                              Manually edited the clamd.conf and changed the user from "clamav" to "postfix" reboot and everthing is working properly.

                              I'll check again the code and include a force config file option. On my install it's working with user postfix without any manual edit.

                              att,
                              Marcello Coutinho

                              Treinamentos de Elite: http://sys-squad.com

                              Help a community developer! ;D

                              1 Reply Last reply Reply Quote 0
                              • U
                                Unubtanium
                                last edited by

                                I have a problem with Mailscanner, mailscanner installed today so  it should be uptodate.
                                Working with postfix and mailscanner-dev: http://forum.pfsense.org/index.php/topic,40201.0.html

                                Mailscanner do exit every second or two. with this in the log:
                                mailscanner: Process did not exit cleanly, returned 1 with signal 0

                                I also get this in the log:
                                ClamAV Module ERROR:: Could not load databases from /var/db/clamav

                                So i tried to do as suggested here and tried to run this:
                                /usr/local/bin/freshclam

                                but then i got this error:
                                ERROR: Can not open /var/log/clamav/freshclam.log in append mode (check permissions!)
                                ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log)

                                When i check the folder /var/log/clamav it is emty!!
                                Same thing with /var/log/db  emty!!

                                Running freshclam –version
                                Gives ClamAV 0.97.3

                                and did run this one(/usr/local/bin/sa-update ) too and that did run with no output.

                                So is mailscanner restarting every second because clamav has no db??

                                EDIT: Might have been a bit quick posting here.

                                Manually created the log file: /var/log/clamav/freshclam.log and changed permisions so any thing could log to it.
                                then tried to updated and then it complained it could not create tem folder in /var/db/clamav so i changed the permisions on that folder so it could update and create the temp folder.

                                And now i am stuck on this error when trying to update clamav:

                                WARNING: Clamd was NOT Notified: Can't connect to clamd through /var/run/clamav/clamd.sock  
                                connect(): No such file or directory  ???

                                The folder var/run/clamav/ is emty? Should it be?
                                And now mailscanner is veining me this in the log
                                mailscanner: Process did not exit cleanly, returned 0 with signal 9
                                And i get alot of this: kernel: swap_pager_getswapspace(4): failed until i get this:  kernel: pid 8874 (perl5.12.4), uid 125, was killed: out of swap space
                                And then it continues with: swap_pager_getswapspace(5): failed

                                Sorry for noob questions.  ::)

                                1 Reply Last reply Reply Quote 0
                                • marcellocM
                                  marcelloc
                                  last edited by

                                  Did you configured the mailscanner on gui? Checked and save options on all tabs?

                                  Treinamentos de Elite: http://sys-squad.com

                                  Help a community developer! ;D

                                  1 Reply Last reply Reply Quote 0
                                  • U
                                    Unubtanium
                                    last edited by

                                    jupp i did.
                                    I did go through all of the to make sure they saved and did write the config files to stop this error:
                                    MailScanner[15521]: Syntax error in line 145, value "" for allowscripttags is not one of allowed values "yes","disarm","no"

                                    that did not fix it so i had to change allowscripttags from disarm to no..

                                    looks like the swap_pager_getswapspace problem is gone after a reboot.. strange???

                                    Looks like thing are working as they should now, and did not do anything else then describe in previous post except reboot.

                                    But anyway would still like to know more about this error:
                                    WARNING: Clamd was NOT Notified: Can't connect to clamd through /var/run/clamav/clamd.sock  
                                    connect(): No such file or directory

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      mschiek01
                                      last edited by

                                      @Unubtanium:

                                      I have a problem with Mailscanner, mailscanner installed today so  it should be uptodate.
                                      Working with postfix and mailscanner-dev: http://forum.pfsense.org/index.php/topic,40201.0.html

                                      Mailscanner do exit every second or two. with this in the log:
                                      mailscanner: Process did not exit cleanly, returned 1 with signal 0

                                      I also get this in the log:
                                      ClamAV Module ERROR:: Could not load databases from /var/db/clamav

                                      So i tried to do as suggested here and tried to run this:
                                      /usr/local/bin/freshclam

                                      but then i got this error:
                                      ERROR: Can not open /var/log/clamav/freshclam.log in append mode (check permissions!)
                                      ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log)

                                      When i check the folder /var/log/clamav it is emty!!
                                      Same thing with /var/log/db  emty!!

                                      Running freshclam –version
                                      Gives ClamAV 0.97.3

                                      and did run this one(/usr/local/bin/sa-update ) too and that did run with no output.

                                      So is mailscanner restarting every second because clamav has no db??

                                      EDIT: Might have been a bit quick posting here.

                                      Manually created the log file: /var/log/clamav/freshclam.log and changed permisions so any thing could log to it.
                                      then tried to updated and then it complained it could not create tem folder in /var/db/clamav so i changed the permisions on that folder so it could update and create the temp folder.

                                      And now i am stuck on this error when trying to update clamav:

                                      WARNING: Clamd was NOT Notified: Can't connect to clamd through /var/run/clamav/clamd.sock  
                                      connect(): No such file or directory  ???

                                      The folder var/run/clamav/ is emty? Should it be?
                                      And now mailscanner is veining me this in the log
                                      mailscanner: Process did not exit cleanly, returned 0 with signal 9
                                      And i get alot of this: kernel: swap_pager_getswapspace(4): failed until i get this:  kernel: pid 8874 (perl5.12.4), uid 125, was killed: out of swap space
                                      And then it continues with: swap_pager_getswapspace(5): failed

                                      Sorry for noob questions.  ::)

                                      check this file /usr/local/etc/clamd.conf

                                      scroll down to the following line and make sure that this is who clam is running under:

                                      Run as another user (clamd must be started by root for this option to work)

                                      Default: don't drop privileges

                                      User postfix

                                      If not change the user then you will need to reboot the box.

                                      1 Reply Last reply Reply Quote 0
                                      • U
                                        Unubtanium
                                        last edited by

                                        Thanks for that mschiek01, the user was set to clamav so just changed it(Nice recap with the VI editor too :) ) and now it is rebooting.

                                        So now more playing with subject word blacklisting.  ;D

                                        1 Reply Last reply Reply Quote 0
                                        • marcellocM
                                          marcelloc
                                          last edited by

                                          Just a question, did you checked VirusScanning(yes) and Virus scanner =clamd on mailscanner antivirus tab?

                                          I've checked the code and it looks for user clamav on clamd.conf file

                                          
                                          #check virus_scanner options
                                          $libexec_dir="/usr/local/libexec/MailScanner/";
                                          if ($virus_scanning == "yes"){
                                          	if ($antivirus['virus_scanner'] =="none"){
                                          		unlink_if_exists($libexec_dir.'clamav-autoupdate');
                                          		unlink_if_exists($libexec_dir.'clamav-wrapper');
                                          	}
                                          else{
                                          .
                                          .
                                          .
                                          #clamd conf file
                                          $cconf="/usr/local/etc/clamd.conf";
                                          if (file_exists($conf)){
                                          	$cconf_file=file_get_contents($cconf);
                                          	if (preg_match('/User clamav/',$cconf_file)){
                                          		$cconf_file=preg_replace("/User clamav/","User postfix",$cconf_file);
                                          		file_put_contents($cconf, $cconf_file, LOCK_EX);
                                          		}
                                          	}
                                          
                                          

                                          Treinamentos de Elite: http://sys-squad.com

                                          Help a community developer! ;D

                                          1 Reply Last reply Reply Quote 0
                                          • M
                                            mschiek01
                                            last edited by

                                            @marcelloc:

                                            Just a question, did you checked VirusScanning(yes) and Virus scanner =clamd on mailscanner antivirus tab?

                                            I've checked the code and it looks for user clamav on clamd.conf file

                                            
                                            #check virus_scanner options
                                            $libexec_dir="/usr/local/libexec/MailScanner/";
                                            if ($virus_scanning == "yes"){
                                            	if ($antivirus['virus_scanner'] =="none"){
                                            		unlink_if_exists($libexec_dir.'clamav-autoupdate');
                                            		unlink_if_exists($libexec_dir.'clamav-wrapper');
                                            	}
                                            else{
                                            .
                                            .
                                            .
                                            #clamd conf file
                                            $cconf="/usr/local/etc/clamd.conf";
                                            if (file_exists($conf)){
                                            	$cconf_file=file_get_contents($cconf);
                                            	if (preg_match('/User clamav/',$cconf_file)){
                                            		$cconf_file=preg_replace("/User clamav/","User postfix",$cconf_file);
                                            		file_put_contents($cconf, $cconf_file, LOCK_EX);
                                            		}
                                            	}
                                            
                                            

                                            All my boxes had virus scanner = auto.  Maybe that is why I always have to configure it manually?

                                            Maybe you should default it in your package to clamd instead of auto?

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.