Filtering Mail with Mail::Audit and Mail::SpamAssassin Creede Lambard penguinsinthenight.com 20 August 2002.

Slides:



Advertisements
Similar presentations
Microsoft ® Office Outlook ® 2003 Training Outlook can help protect you from junk Upstate Technology Services presents:
Advertisements

K12 WebMail
Working with Outlook 2007 at CERN Outlook Main window Customize views Send s Organize s: Category, Follow-up flag, To-Do Bar Create signatures.
How to Use Stowe School District
The Internet 8th Edition Tutorial 3 Using Web-Based Services for Communication and Collaboration.
Basic Communication on the Internet:
Managing Incoming Chapter 3 Bit Literacy. Terminology client – program which retrieves s from a mail server, lets you read the mails,
KELLER WILLIAMS REALTY Google Early Adopters: Customize Account Settings We will begin at 11:00 AM (Central Time)
COMPUTER BASICS METC 106. The Internet Global group of interconnected networks Originated in 1969 – Department of Defense ARPANet Only text, no graphics.
Dealing With Spam The kind, not the Food product.
Server Upgrade From UW to Cyrus. What is an IMAP Server? Provides access to your mail messages stored on the mail server Requires authentication.
Tony BrettOUCS Course Code ZAE 1 March 2004 Webmail – the new WING Tony Brett Oxford University Computing Services.
The Internet. Telnet Telnet means using your computer as a terminal. All commands you type are sent to the host computer you are connected to and executed.
Fundamentals of Electronic Mail From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction Advantages.
Chapter 30 Electronic Mail Representation & Transfer
HUNTINGTON BEACH PUBLIC LIBRARY Basics. What is ? short for electronic mail send & receive messages over the internet.
Surrey Libraries Computer Learning Centres Totally New to Computers Easy Gmail September 2013 Easy Gmail Teaching Script.
Hearth Bulk System Divisional Secretaries’ Briefing 2012.
GroupWise Tutorial What is GroupWise? GroupWise is an and calendar service (much like Microsoft outlook) for Collin College faculty and staff.
Surrey Libraries Computer Learning Centres Totally New to Computers Easy Gmail March 2013 Easy Gmail Teaching Script.
Pro Exchange SPAM Filter An Exchange 2000 based spam filtering solution.
23 October 2002Emmanuel Ormancey1 Spam Filtering at CERN Emmanuel Ormancey - 23 October 2002.
OCR Functional Skills Keywords Use the right keywords To do this you need to know what it is you are searching for! – For example, you might want to search.
This is the first page of the log in, this is were you enter your unique details.
CT NIKHEF Nov Mail NIKHEF CT system support.
Practical PC, 7 th Edition Chapter 9: Sending and Attachments.
AND SPAM BY OLUWATOBI BAKARE
ICT Essential Skills. (electronic mail) Snail Mail.
Stop Spam by using SpamAssassin and Procmail ! Mark Kushinsky – MDS Computer Solutions
Technology ICT Option: . Electronic mail is the transmission of mainly text based messages across networks This can be within a particular.
Unit 9 Communication Services
Project Four Forms Discuss form processing Describe the difference between client-side and server-side form processing Add a horizontal rule to a Web page.
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 12 Electronic Mail.
Unit 10 Communication Services.  Identify types of electronic communication  Describe users of electronic communication  Identify major components.
ES Module 5 Uniform Resource Locators, Hypertext Transfer Protocol, & Common Gateway Interface.
Python CGI programming
1 Using Messages sent from machine to machine and stored for later reading. You will use a client to read –Type mail or pine in UNIX to read.
(or ?) Short for Electronic Mail The transmission of messages over networks.
The Internet 8th Edition Tutorial 2 Basic Communication on the Internet: .
Unit 10 Communication Services
Computer Technology Michael Viphongsay 4B. Electronic mail Internet or Intranet.
Telecommunications Communication over a long distance; Distant communication.
Dylan Bayliff. Contents: 1- Sending s & Using etiquette 2- Staying safe and Accessing 3- Open s 4- Replying to s 5- Setting up contacts.
Week Rainey Community ICT Classes ICT – The Basics.
Using . Creating and Sending Messages The Inbox view serves as Outlook’s interface Click the Inbox icon in the Outlook Bar or Folder List.
Microsoft Office Outlook 2013 Microsoft Office Outlook 2013 Courseware # 3252 Lesson 6: Organizing Information.
Outlook 2007 basics. Create an account An account must be created before sending/receiving . Follow these steps to create an account:
Microsoft Outlook Objective The learner will be able to perform basic tasks in Microsoft Outlook 2003.
Microsoft Office Illustrated Introductory, Second Edition Started with Outlook 2003 Getting.
Outlook Web App Crash course. Outlook Agenda Login Login Reset Password Reset Password Getting Started in Outlook Web App Getting Started in Outlook Web.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
Managing Incoming Chapter 3 Bit Literacy. Terminology client – program which retrieves s from a mail server, lets you read the mails,
SpamAssassin Filter Rodney Weakly April 26, 2006.
Basic Features and Options Accessing  Means of communicating electronically via the Internet.  Used by individuals, businesses,
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
SpamAssassin An Introduction PacNOG I Workshop June 20, 2005 Nadi, Fiji Hervey Allen.
The Internet 8th Edition Tutorial 3 Using Web-Based Services for Communication and Collaboration.
Managing Your Inbox. Flagging Messages Message requires a specific response or action from the recipient Flagging draws attention to your request Quick.
Living Online Lesson 3 Using the Internet IC3 Basics Internet and Computing Core Certification Ambrose, Bergerud, Buscge, Morrison, Wells-Pusins.
Created by Ed, VE7ED.  For a Winlink user to receive a message, the sender's address must be listed in the recipient's whitelist (the accept list)
Form Processing Week Four. Form Processing Concepts The principal tool used to process Web forms stored on UNIX servers is a CGI (Common Gateway Interface)
A Quick Look At How Works Understanding the basics of how works can make life a lot easier for any user. Especially those who are interested.
Yahoo! Mail We gave Google some good press so we’ll use Yahoo! mail as our example for web s. If you don’t have an account Yahoo! will provide.
Anti-Spam Updates Activity Coordination Meeting March 2006 Kevin Hill.
Charles Duan Harvard Univ. Computer Services March 27, 2002
Siebel integration with MS Outlook
Huntington Beach Public Library
What is it? Why do I keep getting from Barracuda? SPAM.
Hearth Bulk System Divisional Secretaries Briefing 2011.
Basics HURY DEPARTMENT OF COMPUTER SCIENCE M.TEJASWINI.
Presentation transcript:

Filtering Mail with Mail::Audit and Mail::SpamAssassin Creede Lambard penguinsinthenight.com 20 August 2002

General Outline:

● How UNIX handles mail

General Outline: ● How UNIX handles mail ● A simple understated diatribe against unsolicited commercial

General Outline: ● How UNIX handles mail ● A simple understated diatribe against unsolicited commercial ● Why mail filtering is a Good Thing tm

General Outline: ● How UNIX handles mail ● A simple understated diatribe against unsolicited commercial ● Why mail filtering is a Good Thing tm ● If you use Windows...

General Outline: ● How UNIX handles mail ● A simple understated diatribe against unsolicited commercial ● Why mail filtering is a Good Thing tm ● If you use Windows... ● Using Mail::Audit

General Outline: ● How UNIX handles mail ● A simple understated diatribe against unsolicited commercial ● Why mail filtering is a Good Thing tm ● If you use Windows... ● Using Mail::Audit ● Using Mail::SpamAssassin

How Unix handles your mail

.forward to another mail address:

How Unix handles your mail Piping to another program: | vacation

Does this look familiar?

spam

● Unsolicited commercial

spam ● Unsolicited commercial – Sent in bulk

spam ● Unsolicited commercial – Sent in bulk – Directly or indirectly advertises a product or service

spam ● Unsolicited commercial – Sent in bulk – Directly or indirectly advertises a product or service – Not requested by recipient

spam ● Unsolicited commercial – Sent in bulk – Directly or indirectly advertises a product or service – Not requested by recipient ● Not necessarily mail you don't want...

spam ● Unsolicited commercial – Sent in bulk – Directly or indirectly advertises a product or service – Not requested by recipient ● Not necessarily mail you don't want... – Although for purposes of this presentation we'll treat them the same.

When Spam tm is acceptable

spam is a Bad Thing tm

● It shifts the burden of costs to the recipient

spam is a Bad Thing tm ● It shifts the burden of costs to the recipient ● It clogs the Net

spam is a Bad Thing tm ● It shifts the burden of costs to the recipient ● It clogs the Net ● It wastes your time

spam is a Bad Thing tm ● It shifts the burden of costs to the recipient ● It clogs the Net ● It wastes your time ● Items/services advertised through spamming tend to be of questionable value

spam is a Bad Thing tm ● It shifts the burden of costs to the recipient ● It clogs the Net ● It wastes your time ● Items/services advertised through spamming tend to be of questionable value ● The vast majority of it is fraudulent

Dealing with spam

● Ignore it

Dealing with spam ● Ignore it... and hope it goes away

Dealing with spam

● Ignore it... not an option

Dealing with spam ● Ignore it... not an option ● Just hit Delete...

Dealing with spam ● Ignore it... not an option ● Just hit Delete... The damage is already done

Dealing with spam ● Ignore it... not an option ● Just hit Delete... The damage is already done ● Filter it as early as possible in its life cycle

Dealing with spam ● Ignore it... not an option ● Just hit Delete... The damage is already done ● Filter it as early as possible in its life cycle ● Filter it as it's trying to enter your machine

If you use Windows...

Mail filtering

| /home/you/mailfilter

Mail filtering apart from spam filtering

● Separating mailing lists into their own folders

Mail filtering apart from spam filtering ● Separating mailing lists into their own folders ● News-to-mail gateways

procmail

● Advantages:

procmail ● Advantages: – Well-established

procmail ● Advantages: – Well-established – Lots of sample scripts

procmail ● Advantages: – Well-established – Lots of sample scripts ● Disadvantages:

procmail ● Advantages: – Well-established – Lots of sample scripts ● Disadvantages: – Arcane syntax

procmail ● Advantages: – Well-established – Lots of sample scripts ● Disadvantages: – Arcane syntax – Like learning a new language...

procmail ● Advantages: – Well-established – Lots of sample scripts ● Disadvantages: – Arcane syntax – Like learning a new language... – And it's not Perl!

Mail::Audit

● Written by Simon Cozens

Mail::Audit ● Written by Simon Cozens procmail is nasty. It has a tortuous and complicated recipe format, and I don't like it. I wanted something flexible whereby I could filter my mail using Perl tests. - Simon Cozens, from the Mail::Audit perldoc

Mail::Audit ● Written by Simon Cozens ● Based on audit_mail and deliverlib by Tom Christiansen

Mail::Audit ● Written by Simon Cozens ● Based on audit_mail and deliverlib by Tom Christiansen ● It's Perl!!!!!!!!!!!!!!!

Mail::Audit ● Written by Simon Cozens ● Based on audit_mail and deliverlib by Tom Christiansen ● It's Perl!!!!!!!!!!!!!!! ● A module, not a standalone program

How Mail::Audit Works

Parsing mail

● Mail::Internet object

Parsing mail ● Mail::Internet object ● Parse by:

Parsing mail ● Mail::Internet object ● Parse by: – From, To or CC lines

Parsing mail ● Mail::Internet object ● Parse by: – From, To or CC lines – Subject

Parsing mail ● Mail::Internet object ● Parse by: – From, To or CC lines – Subject – Absence, presence or content of headers

Parsing mail ● Mail::Internet object ● Parse by: – From, To or CC lines – Subject – Absence, presence or content of headers – Body text

Parsing mail ● Mail::Internet object ● Parse by: – From, To or CC lines – Subject – Absence, presence or content of headers – Body text ● Anything can be parsed

Parsing mail ● Mail::Internet object ● Parse by: – From, To or CC lines – Subject – Absence, presence or content of headers – Body text ● Anything can be parsed – Using Mail::Internet::as_string

Installation

● Download and install Mail::Audit from CPAN

Installation # perl -MCPAN -e shell cpan> install Mail::Audit

Installation ● Download and install Mail::Audit from CPAN ● Create.forward file

Installation | /home/creede/mailfilter

Installation ● Download and install Mail::Audit from CPAN ● Create.forward file ● Create filter file

Installation #!/usr/bin/perl use Mail::Audit; my $mail = new Mail::Audit;

Installation #!/usr/bin/perl use Mail::Audit; my $mail = new Mail::Audit; my $from = $mail->from; my $to = $mail->to; my $cc = $mail->cc; my $subject = $mail->subject;

Installation #!/usr/bin/perl use Mail::Audit; my $mail = new Mail::Audit; my $from = $mail->from; my $to = $mail->to; my $cc = $mail->cc; my $subject = $mail->subject; my $_body = $mail->body; my $body =

Installation #!/usr/bin/perl use Mail::Audit; my $mail = new Mail::Audit; my $from = $mail->from; my $to = $mail->to; my $cc = $mail->cc; my $subject = $mail->subject; my $_body = $mail->body; my $body = my $xloop = $mail->get('X-Loop');

Installation #!/usr/bin/perl use Mail::Audit; my $mail = new Mail::Audit; my $from = $mail->from; my $to = $mail->to; my $cc = $mail->cc; my $subject = $mail->subject; my $_body = $mail->body; my $body = my $xloop = $mail->get('X-Loop'); my $message = $mail->{obj}->as_string;

Installation ● Download and install Mail::Audit from CPAN ● Create.forward file ● Create filter file ● Remember to chmod 0755!

Mail disposition ● $mail->accept – Accepts mail into default inbox

Mail disposition (continued) if ($mail->from =~ { $mail->accept; }

Mail disposition (continued) ● $mail->accept(“/path/to/alternate/mailbox”) – Accepts mail into a non-default mailbox

Mail disposition (continued) my $maildir = “/home/me/mail”; if ($mail->subject =~ /spug/i) { $mail->accept(“$maildir/spug-list”); }

Mail disposition (continued) ● $mail->pipe(“/path/to/external/program”) – Pipes mail through the specified program

Mail disposition (continued) if ($mail->subject =~ /keplerian/i) { $mail->pipe(“/home/creede/parse_kepler”); }

Mail disposition (continued) ● – Sends the mail in its entirety to another address

Mail disposition (continued) if (is_419($message)) { $mail->{noexit} = 1; $mail->put_header('X-Loop', $mail->put_header('To', "$to (forwarded -- no monetary loss -- for your files)"); $mail->{noexit} = 0; $mail->ignore; }

Mail disposition (continued) ● $mail->reject($reason) – Rejects the mail, returning it to the sender with the (optional) reason specified

Mail disposition (continued) if (is_murky($mail)) { $mail->put_header('X-Loop', $mail->reject("I don't like spam."); }

Mail disposition (continued) ● $mail->ignore – Consigns the mail to the bit bucket

Mail disposition (continued) # kill off Korean spam if ($body =~ /ks.c/i) { $mail->ignore; }

Mail::SpamAssassin

● Header analysis

Mail::SpamAssassin ● Header analysis ● Text analysis

Mail::SpamAssassin ● Header analysis ● Text analysis ● Blacklists

Mail::SpamAssassin ● Header analysis ● Text analysis ● Blacklists ● Vipul's Razor

Mail::SpamAssassin – Installation ● Download and install Mail::SpamAssassin from CPAN

Mail::SpamAssassin – Installation # perl -MCPAN -e shell cpan> install Mail::SpamAssassin

Mail::SpamAssassin – Installation #!/usr/bin/perl use Mail::Audit; use Mail::SpamAssassin; my $mail = new Mail::Audit; my $spamtest = new Mail::SpamAssassin; my $status = $spamtest->check($mail); if ($status->is_spam()) { $mail>accept(“/home/you/spamtrap”); }

Mail::SpamAssassin – Configuration ● Load configuration from /etc/mail/spamassasin.conf or /home/you/.spamassassin/user_prefs

Mail::SpamAssassin – Configuration # SpamAssassin user preference file # required_hits4 # #default is 5 # whitelist_from blacklist_from score USER_AGENT_AOL1.00

Paul Graham's Plan for Spam

madam 0.99 promotion 0.99 republic 0.99 shortest mandatory standardization sorry supported

URLs for more information

● Internet Mail

URLs for more information ● Internet Mail ● Mail::Audit

URLs for more information ● Internet Mail ● Mail::Audit ● Mail::SpamAssassin (Outlook)

URLs for more information ● Internet Mail ● Mail::Audit ● Mail::SpamAssassin (Outlook) ● Paul Graham's Plan for Spam

URLs for more information ● Internet Mail ● Mail::Audit ● Mail::SpamAssassin (Outlook) ● Paul Graham's Plan for Spam ● And of course Google.com!

Questions?

Thank you!