Sunday 2 October 2011

Sendmail


Mail Server

Sendmail is an electronic mail transport agent. It is the more common mail server application. A mail server is also known as a mail transfer agent or MTA, is an application that receives incoming e-mail from local users and remote senders and forwards outgoing e-mail for delivery.

Configuration files:
  1. /etc/mail/access
  2. /etc/mail/sendmail.mc
  3. /etc/mail/sendmail.cf
  4. /etc/dovecot.conf

Deamons / Sevices:
  1. sendmail
  2. dovecot

Requirements:
  1. Yum
  2. HTTP / Web Server
  3. DNS (Optional)

# yum install httpd
# yum install sendmail
# yum install sendmail-cf
# yum install dovecot
# yum install squirrelmail             (Install 2 packages)
  1. sendmail
  2. php

# vi /etc/mail/sendmail.mc                        (Open sendmail configuration file for edit)
            Goto line no. 116, copy this line to the bellow, delete “dnl” at beginning on that line and change the ip address of mail server then save and quite it.

            Ex:-
            115 dnl #

            116 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

            117 DAEMON_OPTIONS(`Port=smtp,Addr=192.168.1.1, Name=MTA')dnl

            118 dnl #

# vi /etc/mail/access
            Go to the bottom of this file and add a new line.

            Connect:192.168.1.1                      RELAY
            Then :wq

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
            This command is generate sendmail.cf file from sendmail.mc.

# vi /etc/dovecot.conf
            Un-comment the line no. 17, 87 and 88 in this file then save and quite it.
           
            Ex:-
            17        protocols = imap imaps pop3 pop3s
            87        ssl_cert_file = /etc/pki/dovecot/certs/dovecot.pem

            88        ssl_key_file = /etc/pki/dovecot/private/dovecot.pem
            :wq


            Creating Keys for Dovecot:
# cd /etc/pki/tls/certs
# make dovecot.pem
            It will be asked to provide information about the location and name of our company as well as contacts.  This private key can be used to create a self-signed certificate.  The certificate functions much like a public key.

            Ex:-
            Country Name (2 letter code) [GB]:IN
            State or Province Name (full name) [Berkshire]:New Delhi
            Locality Name (eg, city) [Newbury]:New Delhi
            Organization Name (eg, company) [My Company Ltd]:TBM Technologies Pvt. Ltd.
            Organizational Unit Name (eg, section) []:Hauz Khas
            Common Name (eg, your name or your server's hostname) []:TBM
            Email Address []:nilesh@tbmtechnologies.com

# service httpd restart
# service sendmail restart
# service dovecot restart
# chkconfig httpd on
# chkconfig sendmail on
# chkconfig dovecot on


            Configure Squirrel Mail:
Configure squirrel mail using “conf.pl” script that resides in “/usr/share/squirrelmail/config/” directory and configuration file “config.php” store in /etc/squirrelmail” directory.
# /usr/share/squirelmail/config/conf.pl
            Press 2 for Server Settings > enter 3 for Sendmail or SMTP setting > enter 1 for sendmail.
Again enter A for Update IMAP settings > enter 4 for IMAP server (dell.com)
           

            Creating Mail Only Users:
            All system users are mail users as well. But we can also create mail only users.
# useradd -s /usr/sbin/smrsh mailuser1
# passwd mailuser1

No comments:

Post a Comment

Boot to UEFI Mode or legacy BIOS mode

Boot to UEFI Mode or legacy BIOS mode Choose UEFI or legacy BIOS modes while installing Windows. After Windows is installed, if you nee...