How to install the SendMail Server software under Linux

Source: Internet
Author: User
Tags hash mx record

1, download the latest version from www.sendmail.org (this snedmail is necessary to upgrade to the latest version, because its upgrade is mainly a security vulnerability issue). This is a description of the sendmail-8.12.2.tar.gz.

2, cd/usr/local/src/

3. Download the file to:/USR/LOCAL/SRC

4, Tar zxvf sendmail-8.12.2.tar.gz

5, cd/usr/local/src/sendmail-8.12.2

6, chmod go-w//etc/etc/mail/usr/var/var/spool/var/spool/mqueue

7, Chown root//etc/etc/mail/usr/var/var/spool/var/spool/mqueue

8, Cd/usr/local/src/sendmail-8.12.2/sendmail

9, SH Build

10, CD/USR/LOCAL/SRC/SENDMAIL-8.12.2/CF/CF

11, the establishment of document SENDMAIL.MC content as follows, you can modify the corresponding parts as needed.

Divert (-1)

DNL this are the macro config file used to generate THE/ETC/SENDMAIL.CF

DNL file. If You are modify Thei file you'll have to regenerate the

DNL/ETC/SENDMAIL.CF by running this macro config through the M4

DNL Preprocessor:

DNL M4/ETC/SENDMAIL.MC >/ETC/SENDMAIL.CF

DNL you'll need to have the SENDMAIL-CF Pacage installed for this to work.

Include ('/USR/LOCAL/SRC/SENDMAIL-8.12.2/CF ')

Define (' confdef_user_id ', ' 8:12 ')

OSType (' Linux ')

Undefine (' Uucp_relay ')

Undefine (' Bitnet_relay ')

Define (' Confto_connect ', ' 1m ')

Define (' Conftry_null_mx_list ', true)

Define (' Confdont_probe_interfaces ', true)

Define (' Procmail_mailer_path ', '/usr/bin/procmail ')

Define (' Smart_host ', compaq.rd.xxx.com)

<---This is for (non-hub) default use hub to send mail

Masquerade_as (' rd.xxx.com ')

<-------------------------

FEATURE (' Masquerade_entire_domain ')

<---These three are used for email address camouflage

FEATURE (' Masquerade_envelope ')

<-------------------------

FEATURE (' Smrsh ', '/usr/sbin/smrsh ')

FEATURE (' mailertable ', ' hash-o/etc/mail/mailertable ')

FEATURE (' virtusertable ', ' hash-o/etc/mail/virtusertable ')

FEATURE (redirect)

FEATURE (Always_add_domain)

FEATURE (Use_cw_file)

FEATURE (Local_procmail)

FEATURE (' access_db ')

FEATURE (' blacklist_recipients ')

FEATURE (' Accept_unresolvable_domains ')

MAILER (SMTP)

MAILER (Procmail)

DNL We strongly recommend to comment this one out if you want to protect

Dnl yourself from spam. However, the laptop and users on computers

DNL not hav 24x7 DNS does need this.

DNL FEATURE (' relay_based_on_mx ')

12, SH build INSTALL-CF

13, Groupadd Smmsp

14, Useradd Smmsp

15. CD Cd/usr/local/src/sendmail-8.12.2/sendmail

16, SH Build Install

17, Cd/usr/local/src/sendmail-8.12.2/makemap

18, SH build clean

19, SH Build all

20, SH Build Install

21, CD/USR/LOCAL/SRC/SENDMAIL-8.12.2/

22, add MX record in the domain DNS master database file:

rd.xxx.com. In MX 0 Compaq

Note that the corresponding section is modified. That 0 is used when there are several mail concentrator to mark the order. When there are several MX, the recommended sequence is written as 10, 20, 30 ...

23. Create an Access file in the/etc/mail directory, similar to the following:

127.0.0.1 RELAY

21.9.22 RELAY

211.99.221.238 RELAY

Then: Makemap Hash access.db < access

24, the creation file/etc/mail/local-host-names, its content for this machine has domain name information.

Rd.xxx.com

Compaq.rd.xxx.com

25, create file/etc/mail/aliases, similar content:

Mailer-daemon:postmaster

Postmaster:root

Bin:root

Daemon:root

Nobody:root

Run newaliases to create the database.

One of the meanings of creating an alias file is when the message is sent to a user of another mail server in the domain rather than to the mail hub user.

For example, add a line:

Atan:atan@fbsd

Causes the message to be forwarded automatically to atan@fbsd.rd.xxx.com when it is sent to the mail hub

26, start SendMail:/usr/sbin/sendmail-bd-q30m

Error: If there is a problem that does not start, most of the problems are related to DNS configuration and you can use Nslookup to check DNS for normal. Checking the contents of the/etc/mail in a row is also a good way to arrange mistakes. In addition, modifying the configuration does not recommend directly editing the sendmail.cf file, it is recommended that you use the M4 Macro compilation tool, because some security vulnerabilities or outdated macros are prompted at compile time, so as to avoid related security issues.

Through the above article, we should know how to install the SendMail server under Linux, I hope to help you!

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.