Applicability
Not for UUCP
Applies for local-only
Applies for direct internbet connection.
What is email?
Body -- The text the user typed in
Normally 7bit ASCII
Normaly an upper length imposed to avoid deniual of service attack.
Header
Machine generated
Tells from, to, date, etc.
Can be from programs as well as people and to programs as well as people.
Mailer interface like elm, pine, mh.
Lets user compose mail.
Lets user read mail.
Store mail into folders (good programs allow this).
Handle mime attachments.
Handle locl nicknames (not alias, that comes later).
Mail addresses
user means send to the local user
user@host.domain means send to the user the the computer withing the domain.
host1!host2!host3!user is very old style and going away.
Mail routing
Look up IP number using DNS (domain name service).
If host has an MX record, send mail to the host instead,
Used so that all mail goes to a central (reliable) site.
If there are multiple MX records, use in low->high order.
If there is no MX record, send to that host.
Local delivery
Mail goes in /var/spool/mail/username.
Must be locked before mail can be appended.
Append to spool file.
Unlock.
Admin must check spool files to make sure they don't get overlarge.
Default for postfix
Mail goes to /home/username/Maildir/*
Each file is an email message
Locking not as critical
imap/pop servers need this
Denial of service attack.
How mail gets sent:
User runs Mail Interface program and composes mail.
M-I program runs sendmail (or equiv) on the text file it has just made.
Postfix reads file for config options.
If user is local
Check for .forward file
If found,
send mail there
else
Put mail in appropriate file.
Unlock.
Else user is remote, so
Look up IP number of remote host
If there is an MX record, change target host to the the MX host and go back one step.
Open socket to remote host
If success, send the mail
else
queue the job
SMTP (rfc link here)
Is a protocol for sending mail.
Works over socket #25
Start with HELO
MAIL FROM:username
then RCPT TO: user2
then RCPT TO: user3
then DATA
send lines of message
finish with a period on a line by itself.
Sendmail
Sendmail quote ...
It's been said that you aren't a real Unix system administrator until you've edited a sendmail.cf file. It's also been said that you're crazy if you've attempted to do so twice:-) Sendmail is an incredibly powerful program. It's also incredibly difficult to learn and understand for most people. Any program whose definitive reference (Sendmail, published by O'Reilly and Associates) is 792 pages long quite justifiably scares most people off.
Postfix
Designed for security first, reconfigurability and speed second.
Aliases
Make new ones as needed.
Format: cs495:
randy skinny bob joe
but NOT john@clarinet.uky.edu:
john@nc.state.edu
Run newaliases to update the database