Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,235
» Latest member: pwcreator
» Forum threads: 4,030
» Forum posts: 16,405

Full Statistics

Online Users
There are currently 654 online users.
» 0 Member(s) | 651 Guest(s)
Baidu, Bing, Google

Latest Threads
Wi-Fi works for a few min...
Forum: Network Problems
Last Post: kabifff
2025-12-15, 12:57 AM
» Replies: 0
» Views: 39
How to install Archboot i...
Forum: Network Problems
Last Post: Meup
2025-05-13, 01:41 PM
» Replies: 0
» Views: 3,585
clear logs in smoothwall
Forum: Security and Firewalls
Last Post: amanda63
2024-03-10, 03:27 PM
» Replies: 8
» Views: 113,029
I cannot install RedHat 8...
Forum: Redhat
Last Post: hybrid
2023-11-11, 01:01 PM
» Replies: 1
» Views: 59,944
How things are done, usin...
Forum: Xorg Problems
Last Post: ross
2023-09-04, 09:03 AM
» Replies: 0
» Views: 4,962
Im back.....
Forum: Hello
Last Post: anyweb
2021-01-17, 11:36 AM
» Replies: 1
» Views: 8,634
add mp3 plugin to xmms in...
Forum: Fedora
Last Post: anyweb
2021-01-17, 11:30 AM
» Replies: 11
» Views: 45,995
Configuring VSFTPd Server
Forum: FTP Server
Last Post: Johnbaca
2020-10-14, 10:25 AM
» Replies: 32
» Views: 143,063
Wolf won't play sound!
Forum: Game Problems
Last Post: Guest
2020-10-03, 05:51 PM
» Replies: 1
» Views: 79,164
Using git + python
Forum: How Do I?
Last Post: Clueless puppy
2020-08-21, 04:37 PM
» Replies: 0
» Views: 62,412

 
  postfix + spamassassin
Posted by: hijinks - 2003-12-24, 02:39 PM - Forum: Tips and Tricks - No Replies


This is a simple doc on how to get spamassassin and postfix working together. This doc is targeted towards people with Redhat or Fedora. I also use apt-get. If you don't, you are missing out. Grab it at [/url]http://apt.freshrpms.net.

 

I like postfix mainly because its proven itself as being a fast and secure MTA. It is also very simple to configure unlike sendmail.

 

Lets grab the needed rpms using apt-get. Chances are apt-get will prompt you to install other needed rpms, just hit yes and let them install

 



Code:
apt-get install postfix spamassassin redhat-switch-mail




 

Now that you have all the needed rpms installed lets make sure sendmail won't start on startup and the SA and postfix will load on startup

 



Code:
chkconfig sendmail off
service sendmail stop
chkconfig spamassassin on
chkconfig postfix on




 

Now lets just the switch-mail program to make sure postfix is our default MTA

 



Code:
redhat-switch-mail




 

Then select postfix and hit ok. It'll change some symlinks to make sure that postfix is the default MTA. Now we are ready to start to config SA and postfix to end spam for good

 

So we need to create a spam user and also a homer dir for the spam user then make sure all the permissions are ok

 



Code:
groupadd spam
adduser -g spam -d /var/spam spam
chown -R spam:spam /var/spam




 

Now that the spam user is setup we have to make a spamfilter file. This is the file that will run the mail through spamassassin. create a file in /usr/local/bin/spamfilter.sh and insert the following lines into the file

 



Code:
#!/bin/sh
INSPECT_DIR=/var/spam
SENDMAIL=/usr/sbin/sendmail
SPAMASSASSIN=/usr/bin/spamc
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
trap "rm -f in.$$; rm -f out.$$" 0 1 2 3 15
cat | $SPAMASSASSIN -f > out.$$ #|| # { echo Message content rejected; exit $EX_UNAVAILABLE; }
$SENDMAIL "$@" < out.$$
exit $?




 

Now that the file is made we have to set the permissions and ownership for the file so that the user spam can run the file

 



Code:
chmod +x /usr/local/bin/spamfilter.sh
chown spam:spam /usr/local/bin/spamfilter.sh




 

Now lets setup postfix. edit the file /etc/postfix/main.cf. Below I have copied the lines I have edited in that file just as they appear BEFORE i edited them. Its up to you to change them. If you see a # in front make sure you remove it. If you don't see one then just edit that line. Ignore the () on the line.. they are my notes to you.

 



Code:
#myhostname = host.domain.tld (host.domain.com)
#mydomain = domain.tld (domain.com)
#myorigin = $mydomain (just remove the #)

inet_interfaces = localhost (add a # in front)
#inet_interfaces = all ( remove the # in front)

#mydestination = $myhostname, localhost.$mydomain  (add a # in front)
mydestination = $myhostname, localhost.$mydomain $mydomain l ( remove the # in front)

#mynetworks_style = subnet
#mynetworks = 168.100.189.0/28, 127.0.0.0/8  (make sure you edit the first string)

#mail_spool_directory = /var/spool/mail




 

Thats it for main.cf. Now lets edit the file /etc/postfix/master.cf Below I will show the originals then what you should chanjge it to

 

smtp inet n - y - - smtpd

change it to look like this

smtp inet n - n - - smtpd -o content_filter=spamfilter:dummy

 

then scroll down to the bottom of the file and add the following. NOTE! the following line should just be one line in the file

 

spamfilter unix - n n - - pipe flags=Rq user=spam argv=/usr/local/bin/spamfilter.sh ${sender} ${recipient}

 

Now you are done with that. So the last thing to do is change how spamassassin is started. Edit the file /etc/sysconfig/spamassassin

 

 



Code:
# Options to spamd
SPAMDOPTIONS="-d -c -a -u spam -H /var/spam"




 

The last thing we have to edit is the SA config. It is located at /etc/mail/spamassassin/local.cf. I have an example one at www.zcentric.com/local.cf or use [url=http://www.yrex.com/spam/spamconfig.php]http://www.yrex.com/spam/spamconfig.php to generate your own.

 

Once you have created your own local.cf file you can move on to the next step

 

Now lets startup SA and postfix and do some testing!

 



Code:
service spamassassin start
service postfix start




 

Then test it out. Make sure you send mail from an outside host. SA does not seem to process it if you send it from the same host that the mailserver is running. You should see something like this in the headers

 

 

 



Code:
X-Spam-Status: No, hits=1.1 required=7.0
       tests=DATE_IN_PAST_03_06,SPAM_PHRASE_00_01
       version=2.44
X-Spam-Level: *




 

As you can see I have my limit set at 7 and my test mail got a 1.1 rating. So it doesn't get marked as spam. If its above 7.0 then it'll change the subject to ****SPAM**** before the real subject. Then I have a filter setup on my mailclient to move all mails with that in the subject to a spam folder. You can make SA delete all spam also. Read the SA docs and its all done in the local.cf file

 

ANother great tip from the J to the Y. Damn i rule

Print this item

  KobrAs :)
Posted by: KobrAs - 2003-12-24, 11:25 AM - Forum: Hello - Replies (4)


Hey all ... I`m KobrAs, real name bogdan :)I'm from Romania ... far far far away :)16 old. Finished cisco CCNA1, loving LINUX :)but still using windows :/ cause some mother/sister problems :)... the girls dont understand LINUX !

heh

and thats all

Print this item

  happy christmas from linux-noob.com
Posted by: anyweb - 2003-12-24, 10:48 AM - Forum: Site News - Replies (4)


happy christmas everyone,

 

thanks for joining and thanks for being part of the forums,

 

lets look forward to next year getting better and better,

 

i hope you all have a wonderful christmas, lots of drink and fun and presents and some time to relax and unwind

 

cheers

 

anyweb

Print this item

  my car
Posted by: anyweb - 2003-12-23, 11:36 PM - Forum: General Chat - Replies (20)


check it out, ive just taken the dashboard out ...

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-1-1072222595.jpg" data-fileid="15">[img]<fileStore.core_Attachment>/post-1-1072222595.jpg[/img]</a>



Attached Files
.jpg   december_206.jpg (Size: 1.13 MB / Downloads: 328)
Print this item

  XFCE in Fedora
Posted by: Guest - 2003-12-23, 10:40 PM - Forum: How Do I? - Replies (1)


does anyone here knows how to install xfce in fedora. I found the rpms for shrike on [/url][url=http://www.xfce.org]http://www.xfce.org and install it sucessfully but i am unable to get it working for the dm session <Session Window> in the Login.

I still have the default choices of KDE Gnome Failsafe and default, and i was expecting an XFCE entry would be there but its not.

So i checked if XFCE 4 is installed properly by checking the script /etc/X11/gdm/Sessions/XFCe* which is an executable and execute it and it ran fine but the xfce entry in the sessions window in the login interface is still not available.

now i freakin added XCfe.desktop to /etc/X11/dm/sessions but still no luck ;(

 

any comments would be helpful

Print this item

  apache howto by [Strabo]
Posted by: anyweb - 2003-12-23, 04:38 PM - Forum: LAMP - No Replies


good reading :)

 

[/url][url=http://www.xn85turbo.com/website.txt]http://www.xn85turbo.com/website.txt

 

cheers

 

anyweb

Print this item

  Another Flux, RH9
Posted by: kZo - 2003-12-23, 04:28 PM - Forum: Linux - Replies (3)


Terminal Services running at 450x450 :)

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-11-1072196924.png" data-fileid="13">[img]<fileStore.core_Attachment>/post-11-1072196924.png[/img]</a>



Attached Files
.png   screensnap.png (Size: 630.59 KB / Downloads: 0)
Print this item

  clanhtas.net website defaced
Posted by: anyweb - 2003-12-23, 12:59 PM - Forum: Game Problems - Replies (10)


hi guys

 

the site was defaced probably due to really old openssl versions etc

 

heres the servers details

 

Apache/1.3.29 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.2 PHP/4.3.4 FrontPage/5.0.2.2634 mod_ssl/2.8.16 OpenSSL/0.9.6b

 

its more than likely rootkitted by now

 

ive put up a temp index.php page just to alert people that its down but below is a screenshot of the defaced page

 

cheers

 

anyweb

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-38-1072184360.png" data-fileid="12">[img]<fileStore.core_Attachment>/post-38-1072184360.png[/img]</a>



Attached Files
.png   Screenshot_1.png (Size: 91.38 KB / Downloads: 0)
Print this item

  Ello
Posted by: warthog - 2003-12-22, 11:50 PM - Forum: Hello - Replies (5)


Hello noob!!!!!

I am a prat, just so you all know :P I dont know anything about computers or operating systems or networking or firewalls.

The only thing i know about Windows is that they usually are made from glass and break easy. So dont ask me any questions OK...

 

 

 

other than that....

 

I like the forums dude... need a lesson in this i think...

 

/the HOG

Print this item

  Xfce4 on Fedora
Posted by: Oroshi - 2003-12-21, 12:52 AM - Forum: Linux - No Replies


There u go.

 

[Image: xfce4.png]

Print this item