FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 02-03-2011, 02:38 PM
testwreq wreq
 
Default filter unwanted email

I am new to CentOS. How do I set a rule to so that any email coming from @linkedin.com (and other abused locations), going to an application RT (setup on the system), will get rejected or dropped silently.*

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2011, 02:56 PM
Andrew Grimberg
 
Default filter unwanted email

On Thu, 2011-02-03 at 10:38 -0500, testwreq wreq wrote:
> I am new to CentOS. How do I set a rule to so that any email coming from @
> linkedin.com (and other abused locations), going to an application RT (setup
> on the system), will get rejected or dropped silently.

Procmail filters on the receiving account would be the easiest solution.

Make sure that procmail is installed and then man procmailrc for how to
configure it.

IIRC for RT ticket submission/modification via email to work you have to
be using a mail filter of some sort already and the docs give a basic
promail filter for you to use. As such, you should just need to add a
few rules ahead of that particular rule to catch the type of mail you
don't want.

This of course is just scratching the surface of keeping unwanted mail
out of your ticket tracking system

-Andy-
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2011, 03:27 PM
testwreq wreq
 
Default filter unwanted email

For RT, we have used /etc/aliases and I have sendmail installed. How can I used the existing mail functionality to filter?


On Thu, Feb 3, 2011 at 10:56 AM, Andrew Grimberg <tykeal@bardicgrove.org> wrote:




On Thu, 2011-02-03 at 10:38 -0500, testwreq wreq wrote:
> I am new to CentOS. How do I set a rule to so that any email coming from @
> linkedin.com (and other abused locations), going to an application RT (setup

> on the system), will get rejected or dropped silently.

Procmail filters on the receiving account would be the easiest solution.

Make sure that procmail is installed and then man procmailrc for how to

configure it.

IIRC for RT ticket submission/modification via email to work you have to
be using a mail filter of some sort already and the docs give a basic
promail filter for you to use. *As such, you should just need to add a

few rules ahead of that particular rule to catch the type of mail you
don't want.

This of course is just scratching the surface of keeping unwanted mail
out of your ticket tracking system

-Andy-

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2011, 03:33 PM
Robert Heller
 
Default filter unwanted email

At Thu, 3 Feb 2011 10:38:31 -0500 CentOS mailing list <centos@centos.org> wrote:

>
>
>
> I am new to CentOS. How do I set a rule to so that any email coming from @
> linkedin.com (and other abused locations), going to an application RT (setup
> on the system), will get rejected or dropped silently.

Install spamassassin (yum install spamassassin).

Create a special user account called 'rtspam'. In this account's home
directory create a directory .spamassassin, and copy
/usr/share/spamassassin/user_prefs.template into this directroy, naming
it user_prefs.

Create a file named .procmailrc, that looks something like this:

MAILDIR=/home/rtspam/Mail #you'd better make sure it exists
DEFAULT=$ORGMAIL #completely optional
LOGFILE=$MAILDIR/from #recommended
METAMAIL_TMPDIR=$MAILDIR/Attachments
MAILCAPS=$HOME/.mailcap.pr
KEYIGNHEADS=Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Content-Disposition:Content-Id


:0fw
| /usr/bin/spamassassin -p /home/rtspam/.spamassassin/user_prefs

# catch anything tagged by spamassassin as spam
:0:
*^X-Spam-Warning: This message may be SPAM.*
spam/.

# catch anything with a spam score of 5 or more
:0:
*^X-Spam-Level: *****.*
spam/.

:0 c
backup/.

:0 ic
| cd /home/rtspam/Mail/backup && rm -f dummy `ls -t * | sed -e 1,32d`

:0 ic
| cd /home/rtspam/Mail/spam && rm -f dummy `ls -t * | sed -e 1,200d`


# Special aliases -- will go to RT once it is set up.

:0
* ^TOrt@
|/var/www/rt3/bin/rt-mailgate --queue general --action correspond --url http://rt.deepsoft.com:8080/

:0
* ^TOrt-comment@
|/var/www/rt3/bin/rt-mailgate --queue general --action comment --url http://rt.deepsoft.com:8080/

#Billing and sales

:0
* ^TObilling@
|/var/www/rt3/bin/rt-mailgate --queue sales --action correspond --url http://rt.deepsoft.com:8080/

:0
* ^TOwholesale@
|/var/www/rt3/bin/rt-mailgate --queue sales --action correspond --url http://rt.deepsoft.com:8080/

:0
* ^TOpromos@
|/var/www/rt3/bin/rt-mailgate --queue sales --action correspond --url http://rt.deepsoft.com:8080/

:0
* ^TOsales@
|/var/www/rt3/bin/rt-mailgate --queue sales --action correspond --url http://rt.deepsoft.com:8080/

etc...

End the file with:

:0
* ^FROM_MAILER
! heller@deepsoft.com

:0
* ^From:.*MAILER-DAEMON
! heller@deepsoft.com

:0
|/var/www/rt3/bin/rt-mailgate --queue general --action correspond --url http://rt.deepsoft.com:8080/


(change the ^TO patterns, the path to rt-mailgate, the --queue and --url
options, etc. to suit your configuration.)

In your /etc/aliases set up your RT addresses like this:

rt: rtspam
rt-comment: rtspam
billing: rtspam
wholesale: rtspam
promos: rtspam
sales: rtspam

etc.

(Again change the names to suit your configuration.)

You can then add whitelist_from and blacklist_from addresses to
~rtspam/.spamassassin/user_prefs, as well as any special SpamAssassin
rules you need. This is what I use and it works quite well. You will
want to check the spam and backup mail folders from time to time to
check for false positives (in the spam mail folder) and spam leaks (in
the backup mail folder) and adjust things as needed.


--
Robert Heller -- 978-544-6933 / heller@deepsoft.com
Deepwoods Software -- http://www.deepsoft.com/
() ascii ribbon campaign -- against html e-mail
/ www.asciiribbon.org -- against proprietary attachments



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2011, 07:20 PM
Alexander Dalloz
 
Default filter unwanted email

Am 03.02.2011 17:33, schrieb Robert Heller:

> Create a file named .procmailrc, that looks something like this:

[ ... ]

> :0fw
> | /usr/bin/spamassassin -p /home/rtspam/.spamassassin/user_prefs

It is the worst solution to spawn a new spamassassin process with each
mail going through the filter. The consequences depend on the amount of
mails transported and the powers of the host, but doing this with a
resource hungry and slow process like spamassassin is not recommended in
any way.

Alexander
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2011, 07:31 PM
Kai Schaetzl
 
Default filter unwanted email

Please inform yourself about antispam measures. This list is not a forum
to find out how you can fight spam.
As for simply rejecting certain senders/hosts you use the access db.
Google for "sendmail access.db".

Kai


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2011, 08:45 PM
"Dr. Ed Morbius"
 
Default filter unwanted email

on 21:20 Thu 03 Feb, Alexander Dalloz (ad+lists@uni-x.org) wrote:
> Am 03.02.2011 17:33, schrieb Robert Heller:
>
> > Create a file named .procmailrc, that looks something like this:
>
> [ ... ]
>
> > :0fw
> > | /usr/bin/spamassassin -p /home/rtspam/.spamassassin/user_prefs
>
> It is the worst solution to spawn a new spamassassin process with each
> mail going through the filter. The consequences depend on the amount of
> mails transported and the powers of the host, but doing this with a
> resource hungry and slow process like spamassassin is not recommended in
> any way.

It'd be helpful to mention the alternative:

1: Run spamassassin in daemon mode.

2: Invoke the spamc client (should be installed with spamassassin though
I haven't confirmed for CentOS) in your procmail (or other mail
filtering) systems.

If you're running your own MTA locally or remotely, most have hooks
which allow for automated spam rejection based on rules or filters as
well. Discussion of that is beyond the scope of this list, but
texts/documentation for postfix, exim4, smail, and sendmail should all
address this adequately.

MTA spam filtering, done at SMTP transaction time, can be _very_
efficient and effective. It also has the added benefit, if done
correctly, of indicating to the sender what's happened (e.g.: mail was
rejected as spam), which in the case of false-positive rejections may
(assuming a clueful user, unfortunately not valid in many instances) be
helpful in identifying and correcting such instances.

--
Dr. Ed Morbius
Chief Scientist
Krell Power Systems Unlimited
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-04-2011, 12:38 AM
"Michel Donais"
 
Default filter unwanted email

Get a look at this site;
*
http://www.spamhaus.org/
*
It's easy to install, just a line to change in
sendmail.
*
*
*
---
Michel Donais
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 07:40 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org