190 likes | 208 Views
Learn how to send, receive, filter, and manage emails on Unix systems. Explore Mail Transfer Agents, User Agents, and Mail Delivery Agents, configuring Sendmail, Dovecot, and Procmail, creating mailing lists with Mailman and managing them effectively.
E N D
COP 4343Unix System Administration Unit 14: email send and receive mail mail filtering mail server mailing lists
Understanding Email • Mail Transfer Agent • moves email from one server to another • new: Mail Sending Agent • Mail Delivery Agent • places email in a user’s mailbox • Mail User Agent • manages email for user
Mail User Agent • mail • pine • modern GUI-based email readers • thunderbird, mozilla mail • outlook, evolution • Kmail • WebMail
Mail User Agent • mail • pine • read email from system mailbox • /var/mail/userid • send email via MTA directly
GUI-based Mail User Agent • read email from mail server via • Internet Mail Access Protocol (IMAP) • Post Office Protocol (POP3) • send email to MTA via • Simple Mail Transport Protocol (SMTP) • new: authenticate/send email via MSA
Mail Delivery Agent: procmail • filters email based on user-defined criteria • typical use • virus scan • www.clamav.net • spam scan • www.spamassassin.org
Mail Transfer Agent • sendmail • Simple Mail Transport Protocol (SMTP) • TCP port 25 • new: TCP port 587 for MSA
configuring a mail server • packages • sendmail • dovecot • for imap and pop3 • procmail • open firewall • imap: 143, pop3: 110, smtp: 25
sendmail configuration • chkconfig sendmail on • configuration directory: /etc/mail • edit file: sendmail.mc dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA') LOCAL_DOMAIN(`instructor.ege.com') MASQUERADE_AS(`instructor.ege.com') • install package sendmail-cf • make • service sendmail start • open firewall port 25
sendmail MSA configuration • convention: • users send email via their ISP • possible: • allow sendmail to be RELAY • /etc/mail/access file • new: sendmail configured as MSA • requires authentication • sendmail MSA port: 587
dovecot configuration • chkconfig dovecot on • service dovecot start • add ports 110 and 143 to iptables • /etc/dovecot.conf • example setting: first_valid_uid = 500
procmail configuration • configuration • /etc/procmailrc • per user .procmailrc • also define environment variables • lists recipe to filter email :0 [flags] [ : [locallockfile] ] <zero or more conditions (one per line)> <exactly one action line>
procmail examples :0 * ^Subject: .*scuba.* scubafile :0 * < 1000 ! myname@home :0 * ^^%! | lpr :0fw | processMailFilter
spamassassin recipe • yum install spamassassin • chkconfig spamassassin on • service spamassassin start • /etc/procmailrc DROPPRIVS=yes :0fw | /usr/bin/spamc
Mailing lists • establish alias to send bulk email • enable membership management • package: mailman
mailman configuration • /etc/httpd/conf.d/mailman.conf • set domain name • restart httpd • set mailman passwd • /usr/lib/mailman/bin/mmsitepass password • Set the values for DEFAULT_EMAIL_HOST and DEFAULT_URL_HOST in /usr/lib/mailman/Mailman/mm_cfg.py
mailman configuration • Update Mailman list files: /usr/lib/mailman/bin/update • Create a "site-wide" mailing list /usr/lib/mailman/bin/newlist mailman • you will need to add lines to /etc/aliases and then run newaliases • chkconfig mailman on • service mailman start • visit: http://instructor.ege.com/mailman
mailman list management • select administrative interface from web page • follow prompt to create new list • email is sent to list administrator with instructions: • add lines to /etc/aliases file • run newaliases