Anda di halaman 1dari 3

Installing Sendmail

You will need to make sure that the sendmail, sendmail-cf, and m4 software RPMs are installed. sendmail-8.12.10-1.1.1.i38 .r!m.
[root@bigboy tmp]# chkconfig sendmail on [root@bigboy tmp]# service sendmail start [root@bigboy tmp]# service sendmail stop [root@bigboy tmp]# service sendmail restart [root@bigboy tmp]# pgrep sendmail

You should "et a res!onse of !lain old !rocess #$ num%ers.

How To Restart Sendmail After Editing Your Configuration Files


In this chapter, you'll see that sendmail uses a variety of configuration files that require different treatments for their commands to take effect. This little script encapsulates all the required post configuration steps.
#!/bin/bash cd /etc/mail make newaliases /etc/init.d/sendmail restart

It first runs the make command, which creates a new sendmail.cf file from the sendmail.mc file and compiles supporting configuration files in the /etc/mail directory according to the instructions in the file /etc/mail/Makefile. It then generates new e-mail aliases with the newaliases command, this will !e covered later", and then restarts sendmail. #se this command to make the script e$ecuta!le.
chmod 700 filename

%ou'll need to run the script each time you change any of the sendmail configuration files descri!ed in the sections to follow. The line in the script that restarts sendmail is only needed if you have made changes to the /etc/mail/sendmail.mc file, !ut I included it so that you don't forget. This may not !e a good idea in a production system.

Note: &hen sendmail starts, it reads the file sendmail.cf for its configuration. sendmail.mc is a more user friendly configuration file and really is much easier to fool around with without getting !urned. The sendmail.cf file is located in different directories depending on the version of 'ed(at you use. The /etc/sendmail.cf file is used for versions up to ).*, and /etc/mail/sendmail.cf is used for versions +., and higher and -edora .ore.

The /etc/mail/sendmail mc File


%ou can define most of sendmail's configuration parameters in the /etc/mail/sendmail.mc file, which is then used !y the m/ macros to create the /etc/mail/sendmail.cf file. .onfiguration of the sendmail.mc file is much simpler than configuration of sendmail.cf, !ut it is still often viewed as an intimidating task with its series of structured directive statements that get the 0o! done. -ortunately, in most cases you won't have to edit this file very often.

How to Put Comments in sendmal.mc


In most 1inu$ configuration files a 2 sym!ol is used at the !eginning of a line convert it into a comment line or to deactivate any commands that may reside on that line. The sendmail.mc file doesn't use this character for commenting, !ut instead uses the string 3dnl3. (ere are some valid e$amples of comments used with the sendmail.mc configuration file4

&hese statements are disa%led %' dnl commentin".

dnl !"#$%&$'()$%*+,'ort-smtp.!ddr-/07.0.0./. %ame-#(!12 dnl # !"#$%&$'()$%*+,'ort-smtp.!ddr-/07.0.0./. %ame-#(!12 &his statement is incorrectl' disa%led( # !"#$%&$'()$%*+,'ort-smtp.!ddr-/07.0.0./. %ame-#(!12 &his statement is acti)e( !"#$%&$'()$%*+,'ort-smtp.!ddr-/07.0.0./. %ame-#(!12

Installing Your !"! #ail Ser$er

You will need to make sure that the do)ecot software RPM is installed. do)ecot-0.**.11-1.+,3.4.i38 .r!m.

You can use the chkconfi" command to "et do)ecot confi"ured to start at %oot(
[root@bigboy tmp]# chkconfig dovecot on [root@bigboy tmp]# service dovecot start [root@bigboy tmp]# service dovecot stop [root@bigboy tmp]# service dovecot restart [root@bigboy tmp]# pgrep dovecot

The /etc/do$ecot conf File


1. #n the e-am!le %elow do)ecot is confi"ured to ser)e onl' P.P3.
# # 3ile /etc/dovecot.conf sample # # 'rotocols we want to be serving imap imaps pop4 pop4s #protocols - imap imaps pop4 pop4s protocols - pop4

2. You can then use the netstat command to do a sim!le !reliminar' test to make sure do)ecot is ser)in" P.P3 onl'.
[root@bigboy tmp]# netstat 5a 6 egrep 5i 1pop6imap1 tcp 0 0 78pop4 787 [root@bigboy tmp]# 9)*("%

Anda mungkin juga menyukai