Friday, February 17, 2012

Configuring sendmail

Files and Directories
/ Usr / sbin / sendmail
Sendmail daemon
/ Usr / bin / makemap
Map generation files (access, virtususer registration)
/ Usr / bin / nealiases
alias file to create the DB
/ Usr / lib / sendmail
Sendmail daemon (/ usr / sbin / sendmail and link)
/ Var / spool / mqueue
Kyudirektori (mail temporary storage directory)
/ Var / spool / mail
/ Etc / mail / access
Relay restrictions and configuration files
/ Etc / mail / aliases
alias configuration file
/ Etc / mail / domaintable
Domain registration file table
/ Etc / mail / local-host-names
JS ChoiShinji configuration file
/ Etc / mail /
/ Etc / mail /
JS ChoiShinji configuration file (old version)
/ Etc / mail / virtusertable
Virtual-mail address, the register file
/ Etc / rc.d / init.d / sendmail
Sendmail startup and shutdown scripts (rpm installation)
/ Etc / sysconfig / sendmail
Sendmail configuration files at runtime execution options
/ Var / log /
Sendmail executable file, the situation

# Rpm installation è sendmail, sendmail-CF, m4 Verifying the Installation
# Chkconfig sendmail on
# Service sendmail restart
# Pgrep sendmail

# Vi post-edit-sendmail -> things need to change the configuration of sendmail script
#! / Bin / bash
cd / etc / mail
/ Etc / init.d / sendmail restart è put up for practice. usually does not change the file does not need to be restarted.  service is not a good idea in your server
  Nowadays simple / etc / mail / directory, run "make" when you access and changes, including the virtusertable file allows all of the applicable. And if it does not generate restart sendmail daemon does not need to.
# Chmod 700 post-edit-sendmail

# Vi / etc / resolv.conf
domain -> Make sure that your mail server matches the domain of
nameserver -> Mail Server acts as a DNS client, so make sure

# Vi / etc / hosts localhost.localdomain localhost bigboy è / etc / hosts file, so make sure the DNS client settings in

# Vi / etc / mail /
-          dnl DAEMON_OPTIONS ('Port = SMTP, Addr =, Name = MTA') è rokeolhoseuteuman rather than listen to listen on all interfaces are commented out.

-          FEATURE ('accept_unresolvable_domains') dnl è does not exist in order to block spam mail coming from the domain will be accepted (553 error) to handle the comment. If you do not uncomment the sender's domain without checking mail Relay permits.

    Note that with multiple NIC and accept a specific NIC, if ten thousand local interface settings as shown below, without commenting further stated the address of the NIC to accept a row is added.
DAEMON_OPTIONS ('Port = smtp, Addr =, Name = MTA')
DAEMON_OPTIONS ('Port = smtp, Addr =, Name = MTA')

-            dnl define ('SMART_HOST', '') -> This is not necessary.

※ Anti-Spam SMTP authentication settings for
: Access the DRAC IP address based on the other hand, this configuration allowed RELAY ID / PASS to allow RELAY. Only use this configuration file, RELAY to allow access to the IP address is deleted.

# Vi / etc / mail /
-> In the above "TRUST_AUTH_MECH" remove the comment lines that begin with the following makes.
# M4. />. /
# / Etc / rc.d / init.d / sendmail restart

"Client Settings>

# M4 / etc / mail /> / etc / mail /
# Service sendmail restart
    Check the configuration file - after checking to change the settings that you change mc file instead of cf
# Vi / etc / mail /
AliasFile = / etc / aliases è file path "/ etc / mail / aliases" If you modify a
MaxMessageSize = ten million è maximum mail size 10000000bytes (10MB) is limited to
Sendmail SmtpGreetingMessage = $ J $ v / $ Z; $ b è twenty-five welcome message when connecting to port. $ V / $ Z REQUIREMENTS

# Vi / etc / mail / Relay-Domains  ->This is not generated by default, must be created manually. This file specifies the domain to allow relay for spammers to fake the source domain, because the possibility. Than this, but usually / etc / mail / access is commonly used.

# Vi / etc / mail / access -> REJECT match, where things are not.
localhost.localdomain        RELAY
localhost                                RELAY                                RELAY                         RELAY
192.168.2                               RELAY                          RELAY REJECT                         -> Incoming / outgoing rejected             DISCARD  ->Discarded after they received mail. Do not dispose of the sender notification

-> If the access file and smtp authentication when used as hosts access files in a separate setting in Outlook smtp authentication is not required. Host names are also used here in / etc / hosts that uses / etc / hosts will be set well in advance.

# Cd / etc / mail
# Make -> / Etc / mail / access.db apply


# Makemap hash / etc / mail / access.db
# Strings / etc / mail / access.db -> Confirmation

Domain Check and check all the access is set to determine if the first domain and sends an error code 553 does not exist. Check the domain is not set or if the next access.db be either present a list of domains to check if it is set to be rejected on the list, or 550 (relaying denied), and sends an error.

# Vi / etc / maill / local-host-names -> Domain and receive mail settings (if your old / etc / used)
-> Note that this file name in the file "Fw / etc / mail / local-host-names" reference

※ The procedure for the mail server to handle mail
A. / Etc / mail / local-host-names to make sure, if in receipt of a domain
Two. suryeongdoen mail forwarding in virtusertable
Three. Get on top of the alias or aliases if you are explicitly handled in
Four. As a local account set up forwarding all mail processing presence in the local reporting process

# Vi / etc / mail / virtusertable è suryeongdoen specify what to do with mail
@ My-site webmater                             Paul            Peter -> webmaster-mail accounts are available in two domains
@                              Marc                                                 Paul                         Paul
@                                      Error: User Unknown nouser
-> E-mail address of the destination, the first column, the second a local user mailboxes, remote mail box, / etc / aliases file, mailing lists can be. In other words, when the second column and match the destination e-mail is forwarded to the address.

# Cd / etc / mail
# Make

# Vi / etc / aliases  ->The first, called a virtual meilbakseura mailing list, and the second, separated by commas, are members of the mailing list. (Comma separated space shall be free at)
Mailer-daemon:                    postmaster
postmaster:                           root
Directors:                               Peter, Paul, Mary è there should be no spaces
Admin-list:                             ": include :/ Home / Mailings / Admin-list" -> Can be explicitly specified as

# Vi / home / mailings / admin-list
    aliases are handled in the order
       Check here first that sendmail sendmail mail without thinking of the local user's address is stored in the local user's mailbox.
       Check the mail in the first column of the second column the second column aliases Meant to be the first column of the second column, so be sure to first column that you are.
       Sendmail duplicate (first column, second column) confirmed that there is nothing, the local user sends e-mail.
# Newaliases

# Tail-f / var / log / maillog -> View Log

# Vi / etc / mail / -> Public use spam blacklists
FEATURE ('dnsbl', '', '"550 Mail from" $ & {client_addr} "ref .....
FEATURE ('... see the site
-> See the list of spam by various agencies that match will reject mail.

# M4 / etc / mail /> / etc / mail /
# Service sendmail restart

# Telnet 25
MAIL From: test@test.comRCPT To:
Test email

<-To-use Spam Assassin>
: Sendmail receives mail messages in the mailbox of the user account that is actually placing the message is processed eungyongin procmail. Control of two procmail spam filter temporarily to other applications, such as to enable filtering can neomgieo. Spam Assassin Spam not erasing the 'smap' put the phrase in the title. Then, the mail client to see this phrase to suit the user's intent is to be configured to handle.

# Rpm-Uvh samassassin-2.60-2.i386.rpm
# Chkconfig - level 345 spamassassin on
# Service spamassassin start

# Cp / etc / mail / SpamAssassin / SpamAssassin-spamc.rc / etc / procmailrc  ->/ Etc / procmailrc file procmail procmail helper programs used to say what is the file. By default, the file is not generated automatically.

# Vi / etc / mail / SpamAssassin /  ->Spam Assassin configuration file. file from the website that you can create a menu format. Find related websites.

# Spamassassin-d - lint ->Check file. If there is no more than the output
# Service spamassassin restart

- dovecot IMAP / POP server
# Chkconfig dovecot on
# Service dovecot restart
# Pgrep dovecot
# Vi / etc / dovecot.conf è By default, IMAP, IMAPS, POP, POPS uses both. A good idea to limit the protocol to use.
# Protocols = POP3 IMAP IMAPS POP3S -> commented out
POP3 protocols = è only explicit use
# Netstat-a | egrep-i 'pop | imap'
-> If you use pop3s 995 times in Outlook using the settings in order to use the Encrypted POP should be separate. Do not forget the firewall must be set.

"Change-mail source>   ☞ mail is sent from. 
Note that if you send mail, if it does not recognize your own domain
# Dj $ w.Foo.COM the "" less as its domain, then rerun the daemon