Download presentation
Presentation is loading. Please wait.
1
Email WeeSan Lee http://www.cs.ucr.edu/~weesan/cs183/
2
Roadmap Introduction Mail System Architecture Email Headers Sendmail Debugging Aliases Forwarding Procmail Q&A
3
Introduction MTA (port 25) MSA (port 587) MUA Eudora MUA pine MUA mail The Internet MTA (port 25) LDA procmail Message store MUA mail MUA pine AA Imapd, pop3 MUA Outlook
4
Introduction (cont) A mail system consists of: MUA – Mail User Agent Lets users read and compose email, eg. Mail, Pine, Eudora, Outlook MTA – Mail Transport Agent Routes emails among machines, eg. Sendmail, Postfix Speaks SMTP (Simple Mail Transport Protocol) MSA – Mail Submission Agent Accepting emails from MUA, eg. Sendmail LDA – Local Delivery Agent Places emails to a local message store, eg. Procmail /var/spool/mail/username AA – Access Agent Connects MUA to message store, eg. POP3, IMAP Question: What are the differences between POP3 and IMAP?
5
Mail System Architecture Incoming SMTP server For accepting incoming emails with spam filters Outgoing SMTP server For sending outgoing emails IMAP or POP3 server For retrieving emails Message Store /var/spool/mail/username /home/username/mail/INBOX
6
E-mail Header Attribute: value Eg. From: weesan@cs.ucr.eduweesan@cs.ucr.edu Bcc: bill.gates@microsoft.combill.gates@microsoft.com Header starts with X- will be ignored, eg. X-Spam-Flag: YES Body 7-bit ASCII text Question: How are binary data sent over emails?
7
Sendmail Both a MTA (port 25) and MSA (port 587) Configuration file /etc/mail/sendmail.cf Mail queue /var/spool/mqueue/
8
Debugging mail $ cal | mail -s “test” weesan@cs.ucr.eduweesan@cs.ucr.edu sendmail -oi -t $ cat | sendmail -oi –t From: weesan@cs.ucr.eduweesan@cs.ucr.edu To: bill.gates@microsoft.combill.gates@microsoft.com Subject: Hi Bill Linux is better -WeeSan ^D
9
Debugging (cont) telnet $ telnet mail.cs.ucr.edu 25 … 220 esmtp.cs.ucr.edu ESMTP Postfix mail from: weesan@cs.ucr.edu 250 Ok rcpt to: bill.gates@microsoft.com 250 Ok data 354 End data with. Subject: Hi Bill Linux is better :) . 250 Ok: queued as F1C832AFBE4 quit 221 Bye Connection closed by foreign host.
10
/etc/aliases or /etc/mail/aliases Allows users to be referred by multiple names Used by mailing list $ cat /etc/aliases | grep weesan root: weesan, weesan@email.comweesan@email.com To rehash aliases $ newaliases
11
~/.forward $ cat ~/.forward \weesan weesan@email.com
12
~/.procmailrc # For spam :0 * (^Subject:.*\[SPAM\]|X-Spam-Flag: YES) INBOX.spam # Another type of spam :0 * ^From:.*bill.gates@microsoft.com /dev/null
13
~/.procmailrc # SMS myself :0 c * ^From:.*myboss@ucr.edu | (formail -c -XFrom: -XSubject: ; echo "To: $MY_CELL") | $SENDMAIL -oi -t
14
~/.procmailrc # UCR Systems support emails :0 * ^Subject:.*(New Ticket|Ticket Assigned) { :0 c INBOX.systems :0 | (formail -c -XFrom: -XSubject: ; echo "To: $MY_CELL") | $SENDMAIL -oi -t }
15
Reference LAH Ch 18: Electronic Mail http://www.sendmail.org/ http://www.procmail.org/ http://www.imap.org/
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.