Sunteți pe pagina 1din 21

E-Mail Tools

David Hilley
davidhi@cc.gatech.edu

David Hilley, March 5, 2008

A LTEX - p. 1

Roadmap

G Roadmap
Introduction Local Mail Utilities Mail Server Conclusion

Introduction / Overview Local Mail Utilities & Conguration Running Your Own Mail Server?

David Hilley, March 5, 2008

A LTEX - p. 2

G Roadmap
Introduction

G Email Pipeline/Components? G Lifecycle


Local Mail Utilities Mail Server Conclusion

Introduction

David Hilley, March 5, 2008

A LTEX - p. 3

Email Pipeline/Components?
I
G Roadmap
Introduction

MTA Mail Transfer Agent (SMTP) sendmail, qmail, Postx, exim, Courier MDA Mail Delivery Agent procmail, maildrop (or MTA) Remote Access to delivered mail POP3, IMAP, etc. Dovecot, Courier, Cyrus IMAP, SquirrelMail MUA Mail User Agent Mutt, Gnus, Pine, etc. Mail tools Fetchmail, SpamAssassin, BogoFilter, etc.
A LTEX - p. 4

G Email Pipeline/Components? G Lifecycle


Local Mail Utilities Mail Server Conclusion

David Hilley, March 5, 2008

Email Pipeline/Components?
I
G Roadmap
Introduction

MTA Mail Transfer Agent (SMTP) sendmail, qmail, Postx, exim, Courier MDA Mail Delivery Agent procmail, maildrop (or MTA) Remote Access to delivered mail POP3, IMAP, etc. Dovecot, Courier, Cyrus IMAP, SquirrelMail MUA Mail User Agent Mutt, Gnus, Pine, etc. Mail tools Fetchmail, SpamAssassin, BogoFilter, etc.
A LTEX - p. 4

G Email Pipeline/Components? G Lifecycle


Local Mail Utilities Mail Server Conclusion

David Hilley, March 5, 2008

Lifecycle

G Roadmap
Introduction

Local Machine SMTP

G Email Pipeline/Components? G Lifecycle


Local Mail Utilities Mail Server Conclusion

MTA

MDA

Local Filters

MTA
R e a d s

Remote

POP3
IMAP

d R ea

Local Files

R e ad s

MUA

IMAP

Outgoing

MUA

David Hilley, March 5, 2008

A LTEX - p. 5

Lifecycle

G Roadmap
Introduction

G Email Pipeline/Components? G Lifecycle


Local Mail Utilities Mail Server Conclusion

Outgoing SMTP

MTA
Fetchmail

Local Machine

MDA

Local Filters

Host MTA Host IMAP

IMAP
Outgoing

d s R e a

Local Files

MUA

David Hilley, March 5, 2008

A LTEX - p. 5

G Roadmap
Introduction Local Mail Utilities

G One Possible Conguration G Fetchmail G Procmail G SpamAssassin G SpamAssassin Plugins


Mail Server Conclusion

Local Mail Utilities

David Hilley, March 5, 2008

A LTEX - p. 6

One Possible Conguration Remote server gets/sends mail Fetchmail grabs mail to local machine Procmail delivers mail on local machine SpamAssassin lters spam Local MTA smart-hosts to remote server
This is a useful conguration even if you run your own mail server, because you may want to fetch and store/read your mail locally on a desktop.

I
G Roadmap
Introduction Local Mail Utilities

G One Possible Conguration G Fetchmail G Procmail G SpamAssassin G SpamAssassin Plugins


Mail Server Conclusion

David Hilley, March 5, 2008

A LTEX - p. 7

Fetchmail
I
G Roadmap
Introduction Local Mail Utilities

Two ways to run:


N N

From crontab/mail client/manually As daemon supports IMAP IDLE


.fetchmailrc:

G One Possible Conguration G Fetchmail G Procmail G SpamAssassin G SpamAssassin Plugins


Mail Server Conclusion

poll email2.cc.gatech.edu with proto imap: user "davidhi" pass "12345678" is "davidhi" here keep mda "/usr/bin/procmail -d davidhi"; no rewrite ssl idle poll mikkeli.cc.gatech.edu with proto imap preauth ssh: plugin "ssh email 2> /dev/null"; user davidhi is davidhi here keep mda "/usr/bin/procmail -d davidhi"

David Hilley, March 5, 2008

A LTEX - p. 8

Procmail
I
G Roadmap
Introduction Local Mail Utilities

Filters/sorts/pipes mail, etc. Congure .procmailrc to specify mailboxes and rules

G One Possible Conguration G Fetchmail G Procmail G SpamAssassin G SpamAssassin Plugins


Mail Server Conclusion

MAILDIR=$HOME/.incoming DEFAULT=$HOME/.incoming/inbox LOGFILE=$PMDIR/log :0: :0fw: spamassassin.lock * X-GT-Spam-Rating: ######### * < 256000 spam | spamc :0: * X-Spam-Status: Yes spam :0: * Content-Transfer-Encoding: base64 * name=.*\.(exe|bat|scr|pif|com) spam

David Hilley, March 5, 2008

A LTEX - p. 9

SpamAssassin
I
G Roadmap
Introduction Local Mail Utilities

Two ways to run:


N N

Per-invocation

G One Possible Conguration G Fetchmail G Procmail G SpamAssassin G SpamAssassin Plugins


Mail Server Conclusion

spamc client / spamd daemon

system-wide cong or

/.spamassassin/user prefs
required_hits whitelist_from blacklist_from rewrite_subject subject_tag 5 *@cc.gatech.edu *@microsoft.com 0 [SPAM]

David Hilley, March 5, 2008

A LTEX - p. 10

SpamAssassin Plugins
I
G Roadmap
Introduction Local Mail Utilities

ClamAV detects malware attachments DNS-BL blacklists like SORBS, Spamhaus DCC, Razor, Pyzor distributed checksums Hashcash, SPF URI blacklists SURBL.org Bayesian ltering: BogoFilter or built-in:
N N N

G One Possible Conguration G Fetchmail G Procmail G SpamAssassin G SpamAssassin Plugins

I
Mail Server Conclusion

sa-learn use bayes 1 bayes auto learn 1


A LTEX - p. 11

David Hilley, March 5, 2008

G Roadmap
Introduction Local Mail Utilities Mail Server

G Potential Issues G Blueprint G Sender Policy Framework G DomainKeys


Conclusion

Mail Server

David Hilley, March 5, 2008

A LTEX - p. 12

Potential Issues Different game today due to spam Caveats:


N N N

I
G Roadmap
Introduction Local Mail Utilities Mail Server

G Potential Issues G Blueprint G Sender Policy Framework G DomainKeys


Conclusion

Port 25 ltering Dynamic IP blacklists Reverse DNS doesnt match:


e.g. c-69-180-23-68.hsd1.ga.comcast.net

Slightly used IP already in DNSBL

David Hilley, March 5, 2008

A LTEX - p. 13

Blueprint
I
G Roadmap
Introduction Local Mail Utilities Mail Server

Set up a mail server:


N N N

Postx or exim qmail sendmail

G Potential Issues G Blueprint G Sender Policy Framework G DomainKeys


Conclusion

Make an MX record for your domain Set up SPF records Set up DomainKeys/DKIM Dont forget a backup MX

David Hilley, March 5, 2008

A LTEX - p. 14

Sender Policy Framework Species who is allowed to send mail for a certain domain.
mit.edu. 60 IN TXT "v=spf1 ip4:18.7.7.0/24 ip4:18.7.21.0/24 ip4:18.72.0.0/16 all" ibm.com. "v=spf1 -all" 600 IN TXT

I
G Roadmap
Introduction Local Mail Utilities Mail Server

G Potential Issues G Blueprint G Sender Policy Framework G DomainKeys


Conclusion

us.ibm.com. 600 IN TXT "v=spf1 ip4:32.97.182.0/24 ip4:32.97.110.0/24 a:d25xlcore010.ca.ibm.com a:isource.boulder.ibm.com all"

David Hilley, March 5, 2008

A LTEX - p. 15

DomainKeys Cryptographic signatures


in email header:

I
G Roadmap
Introduction Local Mail Utilities Mail Server

G Potential Issues G Blueprint G Sender Policy Framework G DomainKeys


Conclusion

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from bh=...; b=...= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-versio b=...=
lookup selector._domainkey.domain:

gamma._domainkey.gmail.com. 300 IN TXT "k=rsa\; t=y\; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22

David Hilley, March 5, 2008

A LTEX - p. 16

G Roadmap
Introduction Local Mail Utilities Mail Server Conclusion

G Questions G Resources

Conclusion

David Hilley, March 5, 2008

A LTEX - p. 17

Questions Questions?

G Roadmap
Introduction Local Mail Utilities Mail Server Conclusion

G Questions G Resources

David Hilley, March 5, 2008

A LTEX - p. 18

Resources
I Fetchmail FAQ
G Roadmap
Introduction Local Mail Utilities Mail Server Conclusion

http://catb.org/~esr/fetchmail/fetchmail-FAQ.html
I Timos procmail tips and recipes

http://lipas.uwasa.fi/~ts/info/proctips.html
I Sender Policy Framework: Project Overview

G Questions G Resources

http://www.openspf.org/Project_Overview
I DomainKeys Identied Mail (DKIM)

http://www.dkim.org
I Postx

http://www.postfix.org/
I exim Internet Mailer

http://www.exim.org/
I qmail homepage

http://www.qmail.org
I Sendmail FAQ

http://www.sendmail.org/faq/

David Hilley, March 5, 2008

A LTEX - p. 19

S-ar putea să vă placă și