LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-20-2006, 01:33 AM   #1
gr0undz3r0
LQ Newbie
 
Registered: Oct 2006
Distribution: FC 3 and 4
Posts: 24

Rep: Reputation: 15
Question Postfix Spamassassin Filter


I have been trying to get Spamassassin set up on my postfix server. I used http://advosys.ca/papers/postfix-filtering.html To go by. Everything installs clean and looks ok till I get to the test portion where I create a txt file and cat it to my filter.
Code:
Change to the /var/spool/filter directory if not there already. Use your favorite text editor to create a file named "test.txt" containing the following:

	
	From: <tester@yourdomain.com>
	To: <you@yourdomain.com>

	Hi there. This is a test message.
Code:
Send the above test message through the filter script as follows:

	
	cat test.txt | /usr/local/anomy/filter.sh -f tester -- root
I do it and I dont get any errors, the tutorial says for some reason I should have mail in root. But I dont.
What am I missing?

Last edited by gr0undz3r0; 10-20-2006 at 01:35 AM.
 
Old 10-20-2006, 05:36 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
First step should always be to look at you log. I'd guess it's maillog

Personally, I'd have a look ate www.postrfix.org and look at one of the howtos and implement amavisd-new. This will call spamassassin for you and filter viruses as well.


Rgds

Last edited by billymayday; 10-20-2006 at 05:39 AM.
 
Old 10-20-2006, 07:50 AM   #3
gr0undz3r0
LQ Newbie
 
Registered: Oct 2006
Distribution: FC 3 and 4
Posts: 24

Original Poster
Rep: Reputation: 15
Code:
Oct 20 08:15:53 mail postfix/smtp[29469]: E0C5F804068: to=<tester@mail.mydomain.com>, relay=none, delay=0, status=bounced (mail for mail.mydomain.com loops back to myself)
Oct 20 08:15:53 mail postfix/qmgr[23348]: E0C5F804068: removed
So it looks like I cant take mail that loops back.
I guess I need to fix that.
Any idea how?
Thanx Mate.
 
Old 10-20-2006, 03:21 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Looks like a basic config mistake.

Did you have postfix working before?

Quote:
NOTE: Your server must already have Postfix installed and working. Please do not try to follow these instructions until you first have a basic installation of Postfix working.
 
Old 10-20-2006, 03:27 PM   #5
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 40
Quote:
Originally Posted by gr0undz3r0
Code:
Oct 20 08:15:53 mail postfix/smtp[29469]: E0C5F804068: to=<tester@mail.mydomain.com>, relay=none, delay=0, status=bounced (mail for mail.mydomain.com loops back to myself)
Oct 20 08:15:53 mail postfix/qmgr[23348]: E0C5F804068: removed
So it looks like I cant take mail that loops back.
I guess I need to fix that.
Any idea how?
Thanx Mate.
When you typed out your test.txt file, make sure that you replace the "To: " line with a valid address that Postfix will deliver locally.

To find out which addresses postfix will deliver locally, just have Postfix show you the "mydestination" parameter, as follows:
Code:
postconf mydestination
if you see
mydestination = $myhostname localhost.$mydomain localhost
then those are the default settings, and mail sent to user@mydomain.com will not be delivered locally, but mail sent to user@hostname.mydomain.com will be, since "mydestination" has $myhostname listed.

I would suggest you read http://www.postfix.org/BASIC_CONFIGURATION_README.html

It's very easy to follow, and will ensure your foundational configuration of Postfix is not only set correctly, but understood.
 
Old 10-21-2006, 01:44 AM   #6
gr0undz3r0
LQ Newbie
 
Registered: Oct 2006
Distribution: FC 3 and 4
Posts: 24

Original Poster
Rep: Reputation: 15
I dont think the contents of the text file matter.
I dont have the user tester in the textfile:
The Text File:
Code:
From: <gooduser@mydomain1.com>
To: <gooduser2@mydomain2.com>

Hi there. This is a test message.
~
Output from maillog:
Code:
Oct 21 02:10:56 mail postfix/smtp[23718]: 203CE804068: to=<tester@mail.mydomain.com>, relay=none, delay=0, status=bounced (mail for mail.mydomain.com loops back to myself)
Oct 21 02:10:56 mail postfix/qmgr[23348]: 203CE804068: removed
I think the sender and recipient are stated in the command line var:
Code:
 cat test.txt | /usr/local/anomy/filter.sh -f tester -- root
Note: -f tester -- root.
Would be the from and to users.
Lastly the output of postconf mydestination
Code:
mydestination = mydomain1.com, mydomain2.com, mydomain3.com
Do I need to ad local hosts if so how?
EDIT:
I added localhost to mydestination in main.cf and bang the mail delivered.
Thanx a ton.

Last edited by gr0undz3r0; 10-21-2006 at 01:48 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Spamassassin and Postfix: Filter only incoming mails? Fonk Linux - Software 0 10-07-2004 12:43 PM
postfix filter...help id_viorel Linux - Newbie 2 07-20-2004 08:22 AM
Anybody know how to configure spamassassin to filter mail from hotwayd server? cmisip Linux - Networking 2 11-10-2003 06:46 PM
Postfix and Spamassassin Phaethar Linux - Networking 0 10-30-2003 08:30 AM
Spamassassin doesn't filter bear2x Linux - Software 1 09-05-2003 05:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration