Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Mail Service spam in Linux Server

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces how to use the mail service spam in the Linux server, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Install spam

Spam (SpamAssassin) uses perl for text analysis. He checks the title, content, and sender of the message, so that spam can be filtered out.

1. Install spam. Because spam has too many dependencies, users must use yum source to install it, so as to reduce unnecessary trouble

[root@localhost ~] # rpm-qa | grep spamassassin

[root@localhost openwebmail] # yum install-y spamassassin

Complete!

2. Configure postfix to use spam function to modify the configuration file "/ etc/postfix/master.cf"

[root@localhost ~] # gedit / etc/postfix/master.cf

Smtp inet n-n-- smtpd-o content_filter=spamassassin

Spamassassin unix-n-- pipe user=nobody argv=/usr/bin/spamc-f / usr/sbin/sendmail-oi-f $(sender)-- $(recipient) / / append to the last line

3. Restart postfix

[root@localhost openwebmail] # service postfix restart

Close postfix: [OK]

Start postfix: [OK]

[root@localhost openwebmail] #

4. Start the spam service

[root@localhost ~] # service spamassassin start

Start spamassassin: [OK]

[root@localhost ~] #

5. Test spam.

1) spamassassin provides us with a spam template "sample-spam.txt", which we can send using the contents of this template.

[root@localhost openwebmail] # cat / usr/share/doc/spamassassin-3.3.1/sample-spam.txt

Subject: Test spam mail (GTUBE)

Message-ID:

Date: Wed, 23 Jul 2003 23:30:00 + 0200

From: Sender

To: Recipient

Precedence: junk

MIME-Version: 1.0

Content-Type: text/plain; charset=us-ascii

Content-Transfer-Encoding: 7bit

This is the GTUBE, the

Generic

Test for

Unsolicited

Bulk

Email

If your spam filter supports it, the GTUBE provides a test by which you

Can verify that the filter is installed correctly and is detecting incoming

Spam. You can send yourself a test mail containing the following string of

Characters (in upper case and with no white spaces and line breaks):

XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X / / that's what spam is all about.

You should send this test mail from an account outside of your network.

2) use openwebmail to send messages

3) View the log file of the mailbox. Spam uses a points system. By default, more than 5 points is spam, and we can see that the email identified below is 999 points, which is obviously spam.

[root@localhost openwebmail] # cat / var/log/maillog

Aug 21 08:44:14 localhost spamd [6401]: spamd: failed to create readable default_prefs: / / .spamassassin / user_prefs

Aug 21 08:44:14 localhost spamd [6401]: spamd: processing message for nobody:99

Aug 21 08:44:26 localhost spamd [6401]: spamd: identified spam (999.0 up 5.0) for nobody:99 in 12.5 seconds, 603 bytes.

Aug 21 08:44:26 localhost spamd [6401]: spamd:

Result: y 999-

ALL_TRUSTED,GTUBE,TVD_SPACE_RATIO scantime=12.5,size=603,user=nobody,uid=99,required_score=5.0,rhost=localhost,raddr=127.0.0.1

Rport=33149,mid=,autolearn=no

Aug 21 08:44:26 localhost postfix/pipe [6443]: 3F2FD14141A: to=

Relay=spamassassin, delay=13, delays=0.06/0.03/0/12, dsn=2.0.0, status=sent (delivered via spamassassin service)

Aug 21 08:44:26 localhost postfix/qmgr [6368]: 3F2FD14141A: removed

Aug 21 08:44:26 localhost spamd [6399]: prefork: child states: II

About how to use the mail service spam in the Linux server to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report