Spamsnake Baruwa - Various issues

Discussion in 'HOWTO-Related Questions' started by itsnedkeren, Feb 22, 2011.

  1. itsnedkeren

    itsnedkeren New Member

    Thanks for a great how-to, after some time I finally got the system working!

    Although I have some issues I would like some help with:

    1) I keep getting "cron daemon" mails in my inbox! Aren't these supposed to be sent to [email protected]? I don't need all that info in my main inbox :( Is there somewhere I can change this?

    See snip from log below:

    From "mail.log":
    Feb 22 08:43:01 mailgw postfix/smtp[2510]: 6AC2CC2B85: to=<[email protected]>, orig_to=<[email protected]>, relay=node01.domain.tld[]:25, delay=0.04, delays=0.01/0/0/0.03, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 07E9720067)
    Mail from cron I recive:
    Reading status from /var/spool/MailScanner/quarantine/phishingupdate/status
    Checking that /var/spool/MailScanner/quarantine/phishingupdate/cache/2011-082 exists... ok Checking that /var/spool/MailScanner/quarantine/phishingupdate/cache/2011-082.18 exists... ok I am working with: Current: 2011-082 - 20 and Status: 2011-082 - 18 No base update required Update required Retrieving
    Updating live file /opt/MailScanner/etc/phishing.bad.sites.conf
    Deleting cached file: 2011-082.18.... ok

    2) I'm getting errors in "mail.err" about DCC and ClamAV, see below.

    From "mail.err":
    Feb 22 07:42:02 mailgw ClamAV-autoupdate[8718]: ClamAV updater /usr/local/bin/freshclam cannot be run
    Feb 22 08:35:08 mailgw dccifd[1264]: fopen(/var/run/dcc/ No such file or directory
    Feb 22 08:42:02 mailgw ClamAV-autoupdate[2298]: ClamAV updater /usr/local/bin/freshclam cannot be run
    3) When running spamassassin -x -D -p /opt/MailScanner/etc/spam.assassin.prefs.conf --lint, I see that my userid=1 and not 2. See below.
    Feb 22 09:26:17.606 [3308] dbg: bayes: database connection established
    Feb 22 09:26:17.606 [3308] dbg: bayes: found bayes db version 3
    Feb 22 09:26:17.607 [3308] dbg: bayes: Using userid: 1
    4) Using the Baruwa web-interface, I'm getting "Error connecting to server. check network!", when trying to perform a release, quarantine, delete, etc. on mails. I've browsed the web and suggestions are to disable Javascript, which seems to work. But is there any other workaround for this? It annoys me that I have to change Javascript setting all the time!

    5) How do I setup my mailserver to work with this gateway/spamsnake?
    5a) Are my clients still supposed to send mails via SMTP through my mailserver? Or should they now use the gateway/spamsnake to send mail from(SMTP)
    5b) If I configure my mailserver to accept mails only from the gateway/spamsnake, how will my clients be able to connect via SMTP for sending email(if answer to 5a are yes).

    6) I would love for someone (topdog), to check my server config and general setup via SSH, before throwing it into production, if this is by anyway possible.

    Thanks for any replies.
    Last edited: Feb 22, 2011
  2. itsnedkeren

    itsnedkeren New Member

    2) is solved now, if you get this:

    Feb 22 17:10:23 mailgw dccifd[1248]: fopen(/var/run/dcc/ No such file or directory
    Edit /etc/init.d/dcc-client and make it look like below, I have commented where edit starts and ends:

    # dcc-client	example file to build /etc/init.d/ scripts.
    #		This file should be used to construct scripts for /etc/init.d.
    DESC="DCC program interface daemon"
    [B]########START EDIT##########
    if [ ! -d $DCC_RUNDIR ]; then
        mkdir -p $DCC_RUNDIR
        chown dcc:dcc $DCC_RUNDIR
    ########END EDIT###########[/B]
    test -f $DAEMON || exit 0
    set -e
    case "$1" in
    	echo -n "Starting $DESC: $NAME"
    	start-stop-daemon --start --quiet --pidfile /var/run/$ \
    		--chuid dcc:dcc --exec $DAEMON -- $OPTIONS
    	echo "."
    	echo -n "Stopping $DESC: $NAME"
    	start-stop-daemon --oknodo --stop --quiet --exec $DAEMON
    	echo "."
    	echo -n "Restarting $DESC: $NAME"
    	start-stop-daemon --stop --quiet --pidfile \
    		/var/run/$ --exec $DAEMON
    	sleep 1
    	start-stop-daemon --start --quiet --pidfile \
    		/var/run/$ --exec $DAEMON -- $OPTIONS
    	echo "."
    	#echo "\n"
    	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
    	echo "Usage: $N {start|stop|restart}" >&2
    	exit 1
    exit 0
    Afterwards reboot Ubuntu and you'll see that "" now exists in /var/run/dcc

    2) If you get this:

    Feb 22 18:42:01 mailgw ClamAV-autoupdate[3976]: ClamAV updater /usr/local/bin/freshclam cannot be run
    Then edit the following line in /opt/MailScanner/etc/virus.scanners.conf and make it look like below! You probably have /usr/local at the the end.
    clamav		/opt/MailScanner/lib/clamav-wrapper	/usr
    Afterwards, run:

    /etc/init.d/clamav-freshclam restart

    Still looking for help on the others though :)

    Last edited: Feb 22, 2011
  3. Rocky

    Rocky Member


    Glad you got the snake up and running, although not completely 100% functional, I'm sure a few minor tweaks will fix your issues.

    Add &> /dev/null at the end of all of your cronjobs, before the comment (#) statement to avoid the email messages.

    The bayes user will be 1 because we specified root as the override user, who has access to the db, so that's normal.

    Ok so you've figured out dcc and clamav, that's great. Give us a breakdown of your setup. What is it relaying to, are your clients internal, have you setup proper dns mx records for your mails to flow to the snake?

    Once your mx records are setup properly, mails will start flowing to the snake. You'll have to setup the domains/transports in Baruwa for which you're relaying for and the destination smtp server, and after filtering, mails should flow to that server. A writeup can be found in the howto for the snake on how to do this.
    Last edited: Feb 22, 2011
  4. itsnedkeren

    itsnedkeren New Member

    Thanks for your post Rocky!

    I have 2 servers, the first server "node01" is running Debian with ISPConfig3 and acts as a LAMP basically. All my domains and mailboxes reside here.

    The second server "mailgw" is running the spamsnake. Where I have setup "node01" as relay host in the Baruwa interface.

    For now I have redirected only a test domains MX-record to the spamsnake. Mail seem to be relaying just fine.

    But if I manually send mail through "node01" to the test domain, mails are also coming in. This is obvious, as I have not limited "node01" to recieve mail from the spamsnake only. This is what I'm trying to find out howto to do in a proper way.

    Both server are "external", running as seperate machines with external global IP's.

    I'm wondering if I need to specify anything special in this line in /usr/src/

    postconf -e "mynetworks =,"
    Obviously I'm not using as my network, but I'm in doubt as what to enter here.

    Thanks for any assistance and please ask if you need more info.
  5. itsnedkeren

    itsnedkeren New Member

    5 is now also solved \o/

    I'm using IPTables to allow ONLY the spamsnake on port 25.
    Postfix on the mailserver has been changed to port 587/TLS SMTP for my mail users.

    uncommented below in enables submission port 587.

    submission inet n       -       -       -       -       smtpd
  6. topdog

    topdog Active Member

    You actually need:

    submission inet n       -       n       -       -       smtpd
      -o smtpd_enforce_tls=yes
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    Not just:
    submission inet n       -       n       -       -       smtpd
  7. itsnedkeren

    itsnedkeren New Member

    Thanks Topdog, I need to remove "chroot" as that would't work.
    Feb 23 16:20:02 node01 postfix/smtpd[24056]: fatal: SASL per-process initialization failed
  8. itsnedkeren

    itsnedkeren New Member

    I'm getting this, running the spamassasin --lint command:

    Feb 24 06:11:23.936 [20573] warn: config: failed to parse line, skipping, in "/etc/MailScanner/spam.assassin.prefs.conf": use_auto_whitelist 0 
    Should this be uncommented or??

  9. falko

    falko Super Moderator ISPConfig Developer

  10. itsnedkeren

    itsnedkeren New Member

    Hmm that's odd :confused:

    Checking the Baruwa web interface under "Status->Spamassasin lint" outputs the same error:

    Feb 24 06:11:23.936 [20573] warn: config: failed to parse line, skipping, in "/etc/MailScanner/spam.assassin.prefs.conf": use_auto_whitelist 0
    BUT, running:
    mailgw:~# spamassassin -x -D -p /opt/MailScanner/etc/spam.assassin.prefs.conf --lint 2>&1 | fgrep 'warn'
    Only outputs this:

    Feb 24 19:08:14.744 [27556] dbg: config: warning: score set for non-existent rule SHORTCIRCUIT
    Feb 24 19:08:14.744 [27556] dbg: config: warning: score set for non-existent rule SUBJ_RE_NUM
    Feb 24 19:08:14.744 [27556] dbg: config: warning: score set for non-existent rule FM_VIAGRA_SPAM1114
    Feb 24 19:08:14.745 [27556] dbg: config: warning: score set for non-existent rule AXB_HELO_LH_HOME
    Feb 24 19:08:14.745 [27556] dbg: config: warning: score set for non-existent rule ACCESSDB

    Which one to trust :confused: :eek:


    EDIT: No luck with the info from your link, Falko. Thanks though.
    Last edited: Feb 24, 2011
  11. Rocky

    Rocky Member


    Your're having these issues because you've used the distributed deb package, which will install the distributed mailscanner version for ubuntu. Now, you have 2 instances of mailscanner, since you followed my guide. The distributed version will be an older version where as the tar version will be the latest version and is always installed in /opt. You can either remove the distributed version and create a symlink of /opt/MailScanner in /etc or get rid of both mailscanner and baruwa and reinstall them via the guide using my deb v102 package.

    Last edited: Feb 25, 2011
  12. itsnedkeren

    itsnedkeren New Member

    Ah, yes I see your point :) I'll stick to your upgrades!

    I've uninstalled mailscanner and baruwa and installed from your guide 1.0.2. Everything seems to work as intended.

    Thanks for your excellent assistance :)
  13. Rocky

    Rocky Member

    Great! I'm happy it's working and no problem at all.
  14. itsnedkeren

    itsnedkeren New Member

    Thanks, all is working excellent, although a slight problem with the Altermime function.

    ALL my mails have this message at the bottom, even the incoming ones:

    This message has been scanned for viruses and
    dangerous content by MailScanner, and is
    believed to be clean.
    -- This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

    I have double-checked the AlterMIME section of your guide, but without success. Any pointers here?

  15. Rocky

    Rocky Member

    Last edited: Feb 25, 2011
  16. itsnedkeren

    itsnedkeren New Member

    Thanks again Rocky, I never got this to work properly. Even when following the other guide from scratch.

    Never the less, it's not so important at the moment so I'll leave it at that.

    Thanks for all your help on this.

Share This Page