TimeLinux1

Wednesday, September 22, 2010

Linux HowTo: E-Mail Configuration

Here is some help on Email configuration on Linux:
=====

-Electronic Mail works on the basis of SMTP.
-SMTP    -  Simple Mail Transfer Protocol;    the standard for mail transport on the Internet.
-it only defines how mail is to be sent from one host to another. it doesnt define how the mail is to be displayed.
-it is platform independent, protocol independent and simple.
-smtp port is 25. smtp prereq is that sending host be able to send ascii text to receiving host.
-basic transfer mechanism used by all mail software (hidden behind a nice looking gui)
        . telnet mailserver port                -client connects to mailserver
        . helo     clientname                    -client introduces itself to mailserver
        . mail from:    sender@dom.com            -sender email (on client)
        . rcpt  to:    receivr@dom.com            -receiver email
        . data:    bla bla                     -mail text
        . <empty line>                    -an empty line
        . <.>                            -a period
        . <empty line>                    -an empty line
        . quit                            -end of conn

-sendmail    -    is a mail server
-postfix    -    is a mail server         with focus on security but simpler than sendmail
-three components of mail service:
        . mua    -  mail user  agent    -  what the user sees    -eg evolution, eudora, outlook,
                    -  only for reading / writing mail
        . mta     -  mail trnsfr agent    -  transfer bet client-srvr    -eg sendmail, postfix (basically smtp servers).
        . mda    -  mail deliv agent    -  puts mail in mailbox    -eg /bin/mail, procmail, exchange server (which does both mda + mta). postfix does only mta.
-useful cmds:
        # yum -y install postfix
        # chkconfig postfix on                    - similarly for sendmail
        # service postfix    start | stop | status | restart        - similarly for sendmail
-postfix config file is        /etc/postfix/main.cf
-postfix process config file    /etc/postfix/master.cf
-To check the postfix config:
        # postfix  check                        - checks main.cf
-usefuls:
        # mailq                - checks mail queue
        # /etc/aliases            - email alias list
        # /var/log/maillog            - config file
-mda serves the mua. the mda procmail serves emails to mua (like evolution) in mbox format.
-mbox        -    a simple text mail format.
-this separation of mda & mua via mbox format is useful in case of offline or remote usage (eg laptops)
-POP = Post Office Protocol:
-idea behind pop:
        . a central mail server manages mail
        . mails queue on the server until clients connect. on the server, the mail format can be mbox, etc
        . clients connect and download mail via pop
-IMAP=Internet Message Access Protocol       
-idea behind imap:
        . imap was developed to fill in some gaps in pop (at univ of washington)
        . eg:    imap allows you to keep a master-copy of mail on the server and download a copy on the client.
-Usual Ports for Mail services:
-ports are defined in /etc/services file
        . pop        110
        . imap        143
-install:
        # yum -y install uw-imap                (uw    =  univ of washington)
-generally imap and pop run under xinetd
        . /etc/xinetd.d/imap
        . /etc/xinetd.d/ipop3
-checking pop and imap:
        . pop    -            # telnet    localhost    110
            user     <username>
            pass     <passwd>
            …
            quit
        . imap    -            # telnet    localhost    143
            login    <username>    <passwd>
            …
            logout
-in their original form, pop or imap dont have encryption. To do encryption, you need ssl.
-when using ssl, the ports are    (specified in /etc/xinetd.d    files?)
        . pop        995                (pop3s    actually)
        . imap        993                (imaps    actually)
-useful log files for mail are:
        . /var/log/messages
        . /var/log/maillog

No comments:

Post a Comment