RedHat6.2 server configuration solution (6): Sendmail

Source: Internet
Author: User
Article Title: RedHat6.2 server configuration solution (6): Sendmail. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: Tang haijing
  
Chapter 6 Sendmail
6.1 Introduction
Email Service is the most important network service that users need. Web communication is large, but mail is mainly used for communication between individuals, while human-to-human communication is the basis of business. The network without email service is incomplete. In other words, such a network operating system is not trustworthy if you cannot provide full TCP/IP mail support.
  
Configuring sendmail is a big and complex task, but it is not exactly the same. Compared with other network server systems that only install the SMTP server software, most settings have been configured in Linux. In most systems, the default configuration works well. I will provide some configuration suggestions in this chapter. We recommend that you do not change the configuration parameters.
  
6.2 Required System Resources
6.2.1 configuration file:
  
File Source
  
/Etc/sendmail. cf sendmail-8.9.3-20.i386.rpm
  
/Etc/sendmail. cw sendmail-8.9.3-20.i386.rpm
  
6.2.2 related tools:
  
File Source
  
/Etc/rc. d/init. d/sendmail sendmail-8.9.3-20.i386.rpm
  
6.3 configuration Scheme
1. Main configuration file of/etc/sendmail. cf sendmail
  
Purpose:
  
Controls the configuration of sendmail runtime. The complete sendmail configuration should include seven parts:
  
Local Info (Local information): This part defines the information of the Local host.
  
Options: Used to set Options for defining the sendmail environment.
  
Message Precedence (Message priority): Priority of the sendmail Message
  
Trusted Users: defines the Users who are allowed to change the Sending address when sending an email.
  
Format of Headers: defines the mail header information inserted in sendmail.
  
Rewriting Rules: This part stores the rewrite email address command. You can use this command to rewrite the email address from the address form of the user email program to the address form required by the email sending program.
  
Mailer Definition.
  
In fact, configuring a complete sendmail server is an extremely complex project. However, for our applicability, many features are not necessary, so I want to illustrate our configuration with a simple example. That is to say, the configuration that has not been proposed does not need to be considered by our administrator in general, you can do it by default.
  
Instance:
  
V8/Berkeley
  
Cwlocalhost
  
Fw/etc/sendmail. cw
  
CP.
  
DYuunet.uu.net
  
CPUUCP
  
DS thj.mycompany.com
  
CO @ %!
  
C ..
  
C [[
  
Kmailertable hash-o/etc/mail/mailertable
  
# Create a database
  
Kdomaintable hash-o/etc/mail/domaintable
  
Kgenerics hash-o/etc/mail/genericstable
  
Kmeanuser hash-o/etc/mail/users' usertable
  
Kaccess hash-o/etc/mail/access
  
Kmxserved bestmx-z:-T
  
Kresolve host-a-T
  
FR-o/etc/mail/relay-domains
  
DR
  
DH
  
Kdequote dequote
  
CM root
  
DM thj.mycompany.com
  
# Setting the email server name
  
DnMAILER-DAEMON
  
CPREDIRECT
  
DZ8.9.3
  
O SevenBitInput = False
  
O EightBitMode = pass8
  
O AliasWait = 10
  
O AliasFile =/etc/mail/aliases,/etc/mail/majordomo
  
O MinFreeBlocks = 100
  
# Minimum idle Block
  
O MaxMessageSize = 1000000
  
# Specify the maximum size of mails that a user can send at a time
  
O BlankSub =.
  
O HoldExpensive = False
  
O DeliveryMode = background
  
O AutoRebuildAliases = true
  
O TempFileMode = 0600
  
O HelpFile =/etc/mail/sendmail. hf
  
O SendMimeErrors = True
  
O ForwardPath = $ z/. forward. $ w: $ z/. forward
  
O ConnectionCacheSize = 2
  
O ConnectionCacheTimeout = 5 m
  
O UseErrorsTo = False
  
O LogLevel = 9
  
# Event levels recorded in log files
  
O CheckAliases = False
  
O OldStyleHeaders = True
  
O PrivacyOptions = authwarnings, noexpn, novrfy
  
O QueueDirectory =/var/spool/mqueue
  
O Timeout. queuereturn = 4d
  
O Timeout. queuewarn = 4 h
  
O SuperSafe = True
  
O StatusFile =/var/log/sendmail. st
  
O DefaultUser = 8: 12
  
O SmtpGreetingMessage = $ j Sendmail $ v/$ Z; $ B
  
O UnixFromLine = From $ g $ d
  
O OperatorChars =.: % @! ^/[] +
  
Pfirst-class = 0
  
Pspecial-delivery = 100
  
Plist =-30
  
Pbulk =-60
  
Pjunk =-100
  
Ft-o/etc/mail/sendmail. ct
  
Troot
  
Tdaemon
  
Tuucp
  
R$ * $ # error $@5.7.1 $: "550 Relaying denied"
  
# The above is the default option in Linux. The client is not allowed to use the mail server to send and receive mails. If the client is allowed to send and receive mails, change the above sentence
  
R$-$ @ OK
  
# Note: There are two tabs in the middle.
  
# The mail header information
  
H? P? Return-Path: <$ g>
  
HReceived: $? Sfrom $ s $. $? _ ($? S $ | from $. $ _)
  
H? D? Resent-Date: $
  
H? D? Date: $
  
H? F? Resent-From: $? X $ x <$ g >$ | $ g $.
  
H? F? From: $? X $ x <$ g >$ | $ g $.
  
H? X? Full-Name: $ x
  
H? M? Resent-Message-Id: <$ t. $ I @ $ j>
  
H? M? Message-Id: $ t. $ I @ $ j
  
# The above is the mail header information
  
2. the administrator needs to execute touch/etc/mail/aliases and touch/etc/mail/majordomo to create two files, then restart sendmail and use sendmail. generate the configuration of the database in cf to generate two database files: aliases. db and majordomo. db; of course, the administrator can also execute makemap hash mailertable <mailertable to generate a new db without restarting.
  
6.4 test and management methods
1. The administrator can execute/etc/rc. d/init. d/sendmail restart to make the changed configuration take effect.
  
2. The Administrator executes fetchmail-u yourname yourserver to set the password for users who do not have emails. the user must set the password on the client.
  
3. The Administrator should open the pop3 service to change the configuration file.
  
4. The administrator can test whether the created Mail User works properly by executing the echo test |/usr/sbin/sendmail-v thj@mycompany.com on the server.
  
6.5 summary of this Chapter
In fact, we only need to set a few of them to implement the mail server function. This is because sendmail has a strong applicability and is constantly updated. Therefore, the sendmail configuration scheme provided to us has been tested in practice, and the powerful sendmail function can be implemented without too many changes by the Administrator.
  
  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.