Send mail is one of the old and widely used mail delivery agent/Mail system.
First Please check this link to know more about Mail Server
Configuration Of Sendmail :
1. All the sendmail configuration files are located at /etc/mail
2. Main configuration files are access, sendmail.mc and send mail.cf.
3. In this example my domain is example.com and my mail server host-name is mx.example.comStep1 : Install sendmail packages
zone/file
Step4 : All the sendmail configuration files are stored in /etc/mail and now configure relay ip address list
#yum install sendmail*
#yum install m4
Step2 : Configure DNS entries in forward look-up zone file
#vi /path/to/your/forward/lookup/zone/file
mx1.example.com. IN MX 10 example.com.
Save the file and exit.
Step3 : Check for configuration errors and reload the DNS server
#named-checkzone example.com /path/to/your/forward/lookup/#service named reload
Why we require this relay list?
Ans : This is because to secure your sendmail not get spam. So what ever Network/host-names you specified in this access file those networks/host-names only get access to our sendmail.
#vi /etc/mail/access
Entries as follows.
192.168.0.0/24 RELAY
Save and exit the file
Step5 : Now update the file to sendmail database with makemap command
Note : After executing below command you will find access.db, this is the indication that your makemap command worked perfect and database have been updated successfully.
Note : So if you want to relay more networks you have to edit access file.
#makemap hash access < access Step6 : Configure sendmail.mc file
Step6(b) : Search for 127.0.0 line and comment that line if its not commented.
to
dnl
#vi /etc/mail/sendmail.mc
Step6(a) : Search for "confAUTH_OPTIONS" with out quotes open a new line after that and enter below entry in that line
define(`confDOMAIN_NAME', 'example.com')dnl
Caution : When using the quotes, "`" opening quote is near to escape key and "'" closing quote is at enter key.
dnl #DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Step6(c) : Search for LOCAL_DOMAINN with out quotes and modify the line as below from.
LOCAL_DOMAIN(`localhost.localdomain')dnl
LOCAL_DOMAIN(`mx.example.com')dnl
Step6(d) : Search for "MASQUERADE_AS" with out quotes and modify the line as below from..
dnl MASQUERADE_AS(`mydomain.com')to
MASQUERADE_AS(`example.com')dnl
Now save the file and exit
Step7 : Now compile sendmail.mc changes to reflect them in sendmail.cf
#m4 sendmail.mc > sendmail.cfStep8 : Now start/restart the sendmail service
#service sendmail restart Step9 : Now add the sendmail service to chkconfig list to start automatically at booting times
Step1 : Try sending mail using telnet command
#chkconfig sendmail on
Dovecot Configuration :
Step1 : Install the dovecot package
#yum install dovecotStep2 : Search for "protocols" in /etc/dovecot.conf file and replace with below mention line.
#vi /etc/dovecot.conf#protocols = imap imapsReplace this toprotocols = pop3 imap imaps
Step3 : Start the dovecot service.
#service dovecot restart
Step4 : Now add the dovecot service to chkconfig list to start automatically at booting times
#chkconfig dovecot onTesting the mail server
#telnet mx.example.com 25
Server responds with: 220 mx.example.com SMTP then type HELLO
HELLO
Now Server responds with: 250 OK now send MAIL FROM:root@example.com
Now Server responds with: 250 Address Ok. Now type
RCPT TO:user@example.com
RCPT TO:user@example.com
Now Server responds with: 250 user@example.com OK. now type DATA to enter mail content.
DATA
Now Server Responds (or may not): 354 Enter Mail
Enter message, then on a new line,.
exit
Now the message will be sent to user@example.com.
Now log-in to that user and try to see the mail.
#su user$mail
Here you can see your mail.As send mail configuration is huge and depends on the requirement. Here the configuration which I have shown you is basic configuration.
Q. What is the port number for SMTP?
Some FAQ's:
Ans : 25
Q. What is the port number for POP3, IMAP?
Ans : 110, 143
Q. What is present sendmail version?
Ans : 8
Q. What are other highly used mail servers in world?
Ans : qmail, exchange etcDo you want to find port numbers to other
protocols too?
Use google squared. My example is here
0 comments:
Post a Comment