TimeLinux1

Monday, April 4, 2011

Linux: Email - 1

Here is the first of Email series:

-Sending and Receiving emails requires 3 pieces of s/w:
    . mua    - mail user agent    - the client used by end user - eg: thunderbird
    . mta    - mail transfer agent    - the email server - eg: sendmail=smtp server
    . mda    - mail delivery agent    - the deliverer at receiver site - eg: dovecot (runs pop, imap)..
-most mua's (eg thunderbird) dont interact directly with mta (eg sendmail).
-they use a services like pop / imap.
-This is esp useful when the sending host is a mobile device. the mua and mta are on different hosts.
-sendmail:
    . the smtp server uses port 25 by default for its work.
    . requires pkgs - sendmail (for work) and sendmail-cf (for config)
-while sendmail is predominant, it is complex. its alternatives are postfix and qmail.
-sendmail working:
    . when email is sent by mua, it is queued in /var/spool/mqueue
    . sendmail generates a df (datafile) and qf (queue file) for the msg (message).
    . sendmail then sends the file to the dest sendmail.
    . if any error occurs, sendmail creates a tf (temp file) and xf (error log).
    . on receiver side, the mda stores msgs in /var/spool/mail in mbox format.
    . in this dir, each user has a mail file.
    . sendmail logs are in /var/log/maillog.
    . to see status of outgoing mail run 'mailq' cmd or 'mailstats' cmd.
    . to read mail, run 'mail' cmd.
    . if the delivery is made to alternate users (eg root, postmaster, webmaster), /etc/alias can be used.
    . format of /etc/alias is:
        type:    whom-to
    -eg:    complaints:    root, mrinal@admin.com
        lost:        /dev/null
    . after /etc/alias is created, run cmd 'newaliases' or bounce sendmail to recreate alias.db that sendmail reads.
    . while /etc/alias is config by root, indiv users can redirect/forward their own mails using .forward file.
    . the .forward file lives in users home dir

...continued...

No comments:

Post a Comment