postfix

45
Postfix on Linux

Upload: akila-jayarathna

Post on 19-May-2015

2.864 views

Category:

Education


1 download

DESCRIPTION

Basic details about postfix

TRANSCRIPT

Page 1: Postfix

Postfix on Linux

Page 2: Postfix

What is Postfix?

Page 3: Postfix

Introduction

• E-mail is easily the most popular and important Internet service today, which has made it a popular target of cyber-criminals and spam-happy miscreants. criminals and spam-happy miscreants.

• It facilitates us to communicate easily and effectively.

Page 4: Postfix

Introduction (cont.)

• Internet e-mail is built from several standards and protocols that define how messages are composed and transferred from a sender to a recipient. There are many different pieces of software involved, each one handling a different step in message delivery. Postfix handles only a portion of the whole process. Postfix handles only a portion of the whole process. Most e-mail users are only familiar with the software they use for reading composing messages, known as a Mail User Agent (MUA). Examples of some common MUAs include Pine, Netscape Communicator and Outlook Express. MUAs are good for reading and composing e-mail messages, but they don't do much for mail delivery. That's what Postfix fits in.

Page 5: Postfix

What is a Mail Transfer Agent -MTA?

• MTAs move e-mail from one host or network to another. These are in contrast to Mail Delivery Agents, which move mail within a system (i.e., from an MTA to a local user's mailbox, or from a mailbox to a file or mailbox, or from a mailbox to a file or directory). In other words, MTAs are like the mail trucks (and airplanes, trains, etc.) that move mail between post offices; Mail Delivery Agents are like the letter-carriers who distribute the mail to their destination mail boxes.

Page 6: Postfix

What is a Mail Transfer Agent (cont.)

• In addition to MTAs and MDAs, there are also various kinds of e-mail readers, including POP, POP3, and IMAP clients for retrieving e-mail from remote systems. These are also known as Mail User Agents, or MUAs. (There is no real-Mail User Agents, or MUAs. (There is no real-life simile for these, unless your mail is handed to you each day by a minion whose sole duty is to check your mail box now and then!) But we're not concerned with these or with MDAs, except to mention how they relate to MTAs.

Page 7: Postfix

What is Postfix?

• Postfix is a free open source mail transfer agent (MTA), a computer program for the routing and delivery of email.

• Postfix is the default MTA for a number of Unix(-• Postfix is the default MTA for a number of Unix(-like) operating systems such as Ubuntu Linux.

• This mail transfer agent postfix, provides an alternative to send mail that is simpler in design, more modular, easier to configure and less work to administer. Equally important, it's been designed with scalability, reliability and sound security as fundamental requirements.

Page 8: Postfix

What is Postfix? (cont.)

• Postfix is a Mail Transfer Agent and it is the default Mail Transfer Agent (MTA) for Ubuntu. It is in Ubuntu's main repository, which means that it receives security updates. This is supporting LDAP, SMTP AUTH (SASL), and TLS and running in a chroot environment. Postfix is Wietse Venema's mailer that started life as an alternative to the widely-used Send mail program. alternative to the widely-used Send mail program. Postfix attempts to be fast, easy to administer, and secure, while at the same time being send mail compatible enough to not upset existing users. Thus, the outside has a sendmail-ish flavor, but the inside is completely different. This software was formerly known as VMailer. It was released by the end of 1998 as the IBM Secure Mailer. From then on it has lived on as Postfix. This rpm supports LDAP, SMTP AUTH (trough cyrus-sasl) and TLS. If you need MySQL too, rebuild the srpm --with mysql.

Page 9: Postfix

Founder of Postfix

• POSTFIX was originally written by Wietse Venema during a stay at the IBM Thomas J. Watson Research Center. Postfix was first released in mid-1999.

• Dr. Wietse Zweitze Venema (born 1951) is a • Dr. Wietse Zweitze Venema (born 1951) is a Dutch programmer and physicist best known for writing the Postfix mail system. He has also written numerous other security related tools, such as SATAN and The Coroner's Toolkit, both in co-operation with Dan Farmer, and TCP Wrapper.

Page 10: Postfix

Dr. Wietse Zweitze Venema

Page 11: Postfix

`

• He studied physics at the University of Groningen, graduating with a PhD. He spent 12 years at Eindhoven University as a systems architect in the Mathematics and Computer Science department, and spent part of this time

`department, and spent part of this time writing tools for Electronic Data Interchange. Since emigrating to the U.S. in 1996 he has been working for the IBM Thomas J. Watson Research Center in New York.

Page 12: Postfix

He was awarded in many awards such

as;

• Security Summit Hall of Fame Award (July 1998)

• SAGE Outstanding Achievement Award (November 1999) (November 1999)

• NLUUG Award (November 2000)

• Sendmail Milter Innovation Award (November 2006)

Page 13: Postfix

Developed by

Wietse Venema and many others

Latest release 2.5.3 / July 29, 2008

Preview 2.6-20080726 / July 26, 2008

Preview release

2.6-20080726 / July 26, 2008

OS Cross-platform

Type Mail transfer agent

License IBM Public License

Website http://www.postfix.org/

Page 14: Postfix

Structure

•How Postfix receives mail

•How Postfix delivers mail

From Postfix page

Page 15: Postfix

Receives

Delivers

Page 16: Postfix

How Postfix receives mail

incoming ->cleanup(8)-> qmqpd(8)->Network

\

smtpd(8)-> Network

trivial-rewrite(8)

^|

|v

From Postfix page

postdrop(1)-> sendmail(1)-> Local

^| | | |

maildrop <-pickup(8)

/ incoming ->cleanup(8)-> qmqpd(8)->Network

Page 17: Postfix

How Postfix receives mail

cleanup(8)-> qmqpd(8)

->

Network

\smtpd(8)

->

Network

smtpd(8) or qmqpd(8) servers :-

From Postfix page

• enter Network mail to postfix.

• remove the SMTP or QMQP protocol encapsulation.

• enforce some sanity checks to protect Postfix.

• block unwanted mail.

• give the sender, recipients and message content to the cleanup(8) server.

Page 18: Postfix

How Postfix receives mail

^| | | |

maildrop <-pickup(8)

/ cleanup(8)

From Postfix page

postdrop(1)-> sendmail(1)-> Local

| | | |

sendmail(1) compatibility command :-• receive Local submissions.

Page 19: Postfix

maildrop queue :-• queued Local submissions by the privileged

postdrop(1) command.

pickup(8) server :-

• picks up local submissions.

• enforces some sanity checks to protect Postfix. • enforces some sanity checks to protect Postfix.

• gives the sender, recipients and message content to the cleanup(8) server.

From Postfix page

Page 20: Postfix

cleanup(8) server :-

• Accept mails from smtpd(8), qmqpd(8) and pickup(8).

incoming ->cleanup(8)

trivial-rewrite(8)

^|

|v

• Accept mails from smtpd(8), qmqpd(8) and pickup(8).

• Accept Mail from internal sources.

• implements the final processing stage before mail is queued.

trivial-rewrite(8) server :-• rewrites addresses to the standard "[email protected]"

form.

From Postfix page

Page 21: Postfix

How Postfix delivers mail

File, command -> local(8)-qmgr(8)-> active -> incoming

/ Network -> lmtp(8)-

/

Network -> smtp(8)trivial-rewrite(8)

^|

|v

From Postfix page

Command-> pipe(8)

\deferred

File -> virtual(8)-\

File, command -> local(8)-qmgr(8)-> active -> incoming

^|

|v

Page 22: Postfix

qmgr(8) (queue manager ) :-

• This is the heart of Postfix mail delivery.

• It contacts the smtp(8), lmtp(8), local(8), virtual(8), pipe(8), discard(8) or error(8) delivery agents.

• sends a delivery request for one or more recipient addresses.

discard(8) and error(8) delivery agents :-

• discard or bounce all mail. • discard or bounce all mail.

active queue :-

• maintains by the queue manager with the messages that it has opened for delivery.

• acts as a limited window on potentially large incoming or deferred queues.

• prevents the queue manager from running out of memory under heavy load.

Page 23: Postfix

deferred queue :-

• maintains by queue manager for mail that cannot be delivered.

trivial-rewrite(8) server :-

• resolves each recipient address according to its local or remote address class.

• recipients whose address has changed; mail for such recipients is returned to the sender with an explanation.

Page 24: Postfix

Behind the scene

These server processes rely on other server processes that do things behind

the scenes.

As before, names followed by a number are Postfix commands or server

programs, while unnumbered names inside shaded areas represent Postfix

queues.

Page 25: Postfix

– The resident master server is the supervisor that keeps an eye on the well-being of the Postfix mail system.

– The bounce, defer and trace services each maintain their own queue directory trees with per-message log files.

– The proxy map servers provide read-only and read-write table lookup service to Postfix read-write table lookup service to Postfix processes.

– The scache server maintains the connection cache for the Postfix smtp cleint.

Page 26: Postfix

When delivering mail to a destination with multiple mail servers, connection caching can help to skip over a non-responding server, and thus dramatically speed up delivery.

Page 27: Postfix

Postfix QueuePostfix Queue

• A key contributor to the stability and the speed of postfix is the intelligent way in which it queues mail.

• Postfix uses four different queues,• Postfix uses four different queues,» Mail drop queue.

» Incoming queue.

» Active queue.

» Deferred queue.

27

Page 28: Postfix

Mail drop queueMail drop queue

•Mail that is delivered locally on the system is accepted in the Mail drop queue.

• In this queue, the mail is checked for proper formatting and fixed if necessary. formatting and fixed if necessary.

• Then it is handed to the Incoming queue.

Mail Drop queue Incoming queue

Mail

28

Page 29: Postfix

Incoming queue Incoming queue

•The Incoming queue receives mail from other hosts, clients or the Mail drop queue.

• As long as e-mail is still arriving and as • As long as e-mail is still arriving and as long as postfix hasn't really handled the e-mail, this queue is the place where the e-mails are kept.

29

Page 30: Postfix

Active queueActive queue

•The Active queue is the queue that is used to actually deliver messages and therefore has the greatest potential risk of something going wrong. of something going wrong.

•This queue has a limited size, and messages will be accepted only if there is space for them.

•That means e-mail in the Incoming and deferred queues have to wait until the Active queue can accept them.

30

Page 31: Postfix

Deferred queue Deferred queue

•E-mail that cannot be delivered is placed in the deferred queue.

•This prevents the system from continuously trying to deliver e-mail continuously trying to deliver e-mail and keeps the Active queue as short as possible in order to give newer messages priority.

•This also enhances stability of the mail.

31

Page 32: Postfix

Deferred queue continued…Deferred queue continued…

•If the MTA cannot reach a domain, all the e-mail for that domain is placed in the deferred queue, so that those messages will not needlessly messages will not needlessly monopolize system resources.

•Retry is scheduled with an increasing waiting time. When the waiting time expires, the e-mail is again placed in the Active queue for delivery.

•The system keeps track of retry history. 32

Page 33: Postfix

Incoming queue Active queueMail drop queue

Deferred queue

Mail

33

Page 34: Postfix

Postfix CommandsPostfix Commands

•The most common invocations of the postfix command are postfix start, postfix stop and postfix reload.

•Postfix Start- This command will start the postfix. If •Postfix Start- This command will start the postfix. If you already not installed postfix, terminal will display an error.

•Postfix Stop- This command will stop postfix through the action.

•Postfix Reload- This will reload its configuration files without stopping and restarting.

34

Page 35: Postfix

••subhash@subhashsubhash@subhash--laptop:/root$laptop:/root$ postfix startpostfix startThe program 'postfix' is currently not installedThe program 'postfix' is currently not installed

••You can install it by typing: You can install it by typing:

–– sudosudo aptapt--get install postfixget install postfix

35

Page 36: Postfix

Postfix Commands Postfix Commands continued…continued…

•There are also some other commands,•Postfix flush- This will immediately attempt to send all queued messages.

•Postalias-Maintains Postfix alias databases.

•Postcat- Displays the contents of Postfix queue files.

•Postkick-Makes some internal communication channels available for use in.

•Postlock- Provides Postfix-compatible mailbox locking for use in.

36

Page 37: Postfix

Features of PostfixFeatures of Postfix

�Security

�Simplicity

�Compatability

�Robustness�Robustness

�Stability

Page 38: Postfix

Postfix Content InspectionPostfix Content Inspection

Postfix supports three content inspection methods

1. Before queue, built-in, light-weight

2. After queue, external, heavy-weight

3. Before queue, external, medium-weight

Page 39: Postfix

Certain LimitationsCertain Limitations

�Content Inspection Software must finish in a limited amount of time

�Content Inspection Software must run in a limited amount of memoryin a limited amount of memory

�Befor queue inspection limits the sophistication of the content filter that you can use

Page 40: Postfix

SMTP POP APOP

File system

Database

LDAP

Other

MS

Ex: Serv

Yes ? Yes No No Yes Active Directo

ry

Comparison of mail serversComparison of mail servers

Net Mail

Yes Yes Yes Yes Yes Yes eDirectory,

LDAP

Postfix

Yes No No Yes Yes Yes ?

Page 41: Postfix

Surge Mail

Yes ? ? Yes Yes Yes ?

Win Gate

Yes Yes Yes Yes Yes No NT Domain, Active Gate , Active Directory, CRAM-MD5, SASL PLAIN, SASL LOGIN

Page 42: Postfix

Feature comparison Linux

Windows

Mac OS X

SMTP

POP3

IMAP

SM:TLS

P o

: TLS

NNTP

SSL Web

mail

MSMSMSMS

Ex: SerEx: SerEx: SerEx: Ser

No Yes No Yes Yes Yes Yes Yes Yes Yes Yes Proprietary

Net MailNet MailNet MailNet Mail Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Proprietary

Postfix Postfix Postfix Postfix

Yes No Yes Yes No No Yes No No Yes No Open

source

Page 43: Postfix

gm

ail

Yes No Yes Yes Yes No No No ? No No Public dom

ain

Send m

ail

Yes No Yes Yes No No Yes No No No No Open source/IBM Publi

ailPubli

c

License

Spark Engine

Yes Yes Yes Yes No No Yes No No Yes No Proprietary

Page 44: Postfix

Conclusion

• is a Mail Transfer Agent

• use to route email

• simple to configure

• Highly respect by expert for its secure design & facts

• Use to troubleshooting

Page 45: Postfix

Thank youThank you