Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 22nd February 2011, 09:20
itsnedkeren itsnedkeren is offline
Senior Member
 
Join Date: May 2009
Location: Denmark
Posts: 128
Thanks: 32
Thanked 10 Times in 10 Posts
Question Spamsnake Baruwa - Various issues

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 root@localhost? 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":
Code:
Feb 22 08:43:01 mailgw postfix/smtp[2510]: 6AC2CC2B85: to=<mailadmin@domain.tld>, orig_to=<root@domain.tld>, relay=node01.domain.tld[78.46.92.124]: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:
Code:
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 http://www.mailscanner.tv/2011-082.19
Retrieving http://www.mailscanner.tv/2011-082.20
/var/spool/MailScanner/quarantine/phishingupdate/cache/2011-082.20
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":
Code:
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/dccifd.pid): 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.
Code:
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.
__________________
Best regards

Jim

Last edited by itsnedkeren; 22nd February 2011 at 10:00.
Reply With Quote
Sponsored Links
  #2  
Old 22nd February 2011, 19:03
itsnedkeren itsnedkeren is offline
Senior Member
 
Join Date: May 2009
Location: Denmark
Posts: 128
Thanks: 32
Thanked 10 Times in 10 Posts
Default

2) is solved now, if you get this:

Code:
Feb 22 17:10:23 mailgw dccifd[1248]: fopen(/var/run/dcc/dccifd.pid): 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:


Code:
#!/bin/sh
#
# dcc-client	example file to build /etc/init.d/ scripts.
#		This file should be used to construct scripts for /etc/init.d.

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/dccifd
NAME=dccifd
DESC="DCC program interface daemon"
########START EDIT##########
DCC_RUNDIR=/var/run/dcc
if [ ! -d $DCC_RUNDIR ]; then
    mkdir -p $DCC_RUNDIR
    chown dcc:dcc $DCC_RUNDIR
fi
########END EDIT###########

test -f $DAEMON || exit 0

set -e

case "$1" in
  start)
	echo -n "Starting $DESC: $NAME"
	start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
		--chuid dcc:dcc --exec $DAEMON -- $OPTIONS
	echo "."
	;;
  stop)
	echo -n "Stopping $DESC: $NAME"
	start-stop-daemon --oknodo --stop --quiet --exec $DAEMON
	echo "."
	;;
  restart)
	echo -n "Restarting $DESC: $NAME"
	start-stop-daemon --stop --quiet --pidfile \
		/var/run/$NAME.pid --exec $DAEMON
	sleep 1
	start-stop-daemon --start --quiet --pidfile \
		/var/run/$NAME.pid --exec $DAEMON -- $OPTIONS
	echo "."
	#echo "\n"
	;;
  *)
	N=/etc/init.d/$NAME
	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
	echo "Usage: $N {start|stop|restart}" >&2
	exit 1
	;;
esac

exit 0
Afterwards reboot Ubuntu and you'll see that "dccifd.pid" now exists in /var/run/dcc


2) If you get this:

Code:
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.
Code:
clamav		/opt/MailScanner/lib/clamav-wrapper	/usr
Afterwards, run:

/etc/init.d/clamav-freshclam restart



Still looking for help on the others though


Thanks
__________________
Best regards

Jim

Last edited by itsnedkeren; 22nd February 2011 at 19:14.
Reply With Quote
  #3  
Old 22nd February 2011, 22:00
Rocky Rocky is offline
Senior Member
 
Join Date: Oct 2005
Posts: 553
Thanks: 14
Thanked 49 Times in 48 Posts
Default

Hey,

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.
__________________
Home of the SpamSnake

Last edited by Rocky; 22nd February 2011 at 22:05.
Reply With Quote
The Following User Says Thank You to Rocky For This Useful Post:
itsnedkeren (23rd February 2011)
  #4  
Old 23rd February 2011, 08:08
itsnedkeren itsnedkeren is offline
Senior Member
 
Join Date: May 2009
Location: Denmark
Posts: 128
Thanks: 32
Thanked 10 Times in 10 Posts
Default

Quote:
Originally Posted by Rocky View Post
Hey,

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.
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/postfix.sh

Code:
postconf -e "mynetworks = 127.0.0.0/8, 192.168.0.0/24"
Obviously I'm not using 192.168.0.0/24 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.
__________________
Best regards

Jim
Reply With Quote
  #5  
Old 23rd February 2011, 13:22
itsnedkeren itsnedkeren is offline
Senior Member
 
Join Date: May 2009
Location: Denmark
Posts: 128
Thanks: 32
Thanked 10 Times in 10 Posts
Default

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 master.cf enables submission port 587.

Code:
submission inet n       -       -       -       -       smtpd
__________________
Best regards

Jim
Reply With Quote
The Following User Says Thank You to itsnedkeren For This Useful Post:
falko (23rd February 2011)
  #6  
Old 23rd February 2011, 15:04
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

You actually need:

Code:
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:
Code:
submission inet n       -       n       -       -       smtpd
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
The Following User Says Thank You to topdog For This Useful Post:
itsnedkeren (23rd February 2011)
  #7  
Old 23rd February 2011, 16:43
itsnedkeren itsnedkeren is offline
Senior Member
 
Join Date: May 2009
Location: Denmark
Posts: 128
Thanks: 32
Thanked 10 Times in 10 Posts
Default

Quote:
Originally Posted by topdog View Post
You actually need:

Code:
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:
Code:
submission inet n       -       n       -       -       smtpd
Thanks Topdog, I need to remove "chroot" as that would't work.
Code:
Feb 23 16:20:02 node01 postfix/smtpd[24056]: fatal: SASL per-process initialization failed
__________________
Best regards

Jim
Reply With Quote
  #8  
Old 24th February 2011, 12:13
itsnedkeren itsnedkeren is offline
Senior Member
 
Join Date: May 2009
Location: Denmark
Posts: 128
Thanks: 32
Thanked 10 Times in 10 Posts
Default

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

Code:
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??

Thanks
__________________
Best regards

Jim
Reply With Quote
  #9  
Old 24th February 2011, 14:51
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

http://osdir.com/ml/users-spamassass.../msg00692.html
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
itsnedkeren (24th February 2011)
  #10  
Old 24th February 2011, 19:10
itsnedkeren itsnedkeren is offline
Senior Member
 
Join Date: May 2009
Location: Denmark
Posts: 128
Thanks: 32
Thanked 10 Times in 10 Posts
 
Default

Hmm that's odd

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

Code:
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:
Code:
mailgw:~# spamassassin -x -D -p /opt/MailScanner/etc/spam.assassin.prefs.conf --lint 2>&1 | fgrep 'warn'
Only outputs this:

Code:
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

Thanks

EDIT: No luck with the info from your link, Falko. Thanks though.
__________________
Best regards

Jim

Last edited by itsnedkeren; 24th February 2011 at 19:20.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with Baruwa - The Perfect Spamsnake Ubuntu 10.10 neofire HOWTO-Related Questions 44 31st May 2011 15:09
MailWatch Error: no rows retrieved from database sergio.arnaldo Server Operation 25 21st March 2011 06:05
[The Perfect Spamsnake Ubuntu 10.10] - No mail relay, just errors. itsnedkeren HOWTO-Related Questions 2 20th February 2011 10:45
spamsnake 10.10 Baruwa problem pkay HOWTO-Related Questions 3 13th January 2011 06:18
MailScanner trouble with DBD-MYSQL sergio.arnaldo Server Operation 11 26th August 2009 18:08


All times are GMT +2. The time now is 12:11.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.