Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Filtering Out Unwanted Junk Mail Using Regular Expression., Use this Regular Expression with the cPanel email filter to limit your
vujsa
post Feb 18 2008, 05:09 AM
Post #1


Absolute Newbie
Group Icon

Group: Admin
Posts: 887
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



I'm so irritated with the amount of spam I get on the email accounts I have hosted at AstaHost. It isn't the servers fault that I get so much junk mail! It wouldn't be so bad but my junk mail filter on my home system doesn't scan IMAP accounts which I use since my email client won't separate POP3 accounts properly.

So I finally got to the point I had to do something! I'm getting about 25 junk mail messages a day spread over 5 different email accounts. If I go a few days without checking my email, I have a lot of work to do to clean out the trash!

The good news it that cPanel has an email filter available that can help. Here is what I did...

First, I set up an email account simply named "junkmail"!
Then I go to the email filter page and click on the "Add Filter" link.
Attached File  Email_Filter1.png ( 56.51k ) Number of downloads: 2

We first do a filter for the body of the message by selecting "Body".
We then select "matches regex".
And for destination, we enter "junkmail@mydomain.com".

This will filter all of your email messages and move unwanted emails to the junkmail account where you can review them prior to deletion.
The regular expression I use is shown below:
CODE
.*(sperm|pr(a|4)d(a|4)|(l|1)(o|0)(a|4)n|gener(i|1)c|^cum|p(o|0)rn|d(i|1)or|fuck|d(i|1)ck|sex|ph(a|4)(l|1)(l|1)us|pen(i|1)s|ro(l|1)+ex|(l|1)uxury t(i|1)mep(i|1)ece|c(o|0)ck|cred(i|1)t c(a|4)rd|debt|v((i|1)+((a|4))+)+gr((a|4))+|c((i|1)+((a|4))+)+(l|1)+(i|1)+s|penetr(a|4)te|b(l|1)ue.?p(i|1)(l|1)(l|1)|hyrd(o|0)c(o|0)d(o|0)ne|erect(i|1)(l|1)e|erect(i|1)(o|0)n|(a|4)nt(i|1).?ed|s(c)?h(l|1)(o|0)ng|ph(a|4)rm(a|4)cy|drugst(o|0)re).*


I would list the filtered words but the forum filter will filter them out!

After you set up your filter for your "Body", then do the same for "Any Header" and you'll be done.

Be sure that you use the information specific to your account. You can "Discard" filtered emails but then you risk the chance that a wanted email is forever lost!

I offer no warranty for this information. It may allow unwanted email to be delivered. It may also filter legitimate emails and if no junk mail location is set, it will delete such emails. This also filters outgoing email so you won't be able to send an email from your account that contains one of these filtered words.

Basically, use at your own risk.

This is capturing about 90% of my junk mail and hasn't filtered legitimate emails on accident.
There is a filter tester available to see if certain words will be filtered correctly.

I hope this helps. cool.gif

vujsa
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Code To Send An Email From A Form(7)
  2. Zpanel/cpanel(12)
  3. E-mail Marketing :: Some Fundamentals(5)
  4. How To Send Email Using VB (using SMTP) ?(8)
  5. Funny Email Quizzes(5)
  6. iPod Help(8)
  7. Imho, You'll Be Rotfl!(12)
  8. Airtel GPRS(22)
  9. Using The Php Mail() Function For Images Or Attachments(3)
  10. Free Email Forwarding Service?(5)
  11. Filezilla: How To Use In cPanel?(7)
  12. How Do You Use The cPanel File Manager?(13)
  13. Dell Computer "shuts Down" When Opening Email(31)
  14. Php Send Mail Through Smtp(8)
  15. Best Email Client For Gmail(9)
  1. Wireless: Bypassing Mac Filtering(10)
  2. Qupis : Free Cpanel Web Hosting (one Line Text Ad At Bottom)(10)
  3. Make A Wish And It'll Come True...if....(6)
  4. Using Regular Expressions To Parse Functions(5)
  5. Cpanel Security(0)
  6. Mail Servers?(3)
  7. E-mail - Firefox(6)
  8. Email Problems(5)
  9. Domain Name Is Not Assigned To Ip. Access Cpanel With Ip Not With Domain Name.(6)
  10. Regular Expressions(6)
  11. Outlook Express: Older Sent Mail Disappears(1)
  12. Cpanel Isn't Working.(14)
  13. Help Needed(1)


 



- Lo-Fi Version Time is now: 5th September 2008 - 06:47 AM