How to Set up a Postfix email server in Linux:

Source: Internet
Author: User

[Switch] how to set up a Postfix email server in Linux: postfix email server

I set up an email server on my own server to write a shell script for alarm monitoring. When an accident occurs on the server, you can send the email server to your mailbox in time.

I have read two tutorials and constructed them according to the two tutorials. Thank you for the original work.

How to Set up a Postfix email server in Linux:

1. First disable the sendmail service

Service sendmail stop

2. chkconfig sendmail off (disable auto-start upon startup)

3. Modify the DNS resolution file so that DNS can resolve the mailbox service.

Add the following two lines

Mail.zhubf.com. in a 172.17.17.2

Zhubf.com. in mx 10 mail.zhubf.com.

Restart DNS

Service named restart

Chkconfig named on

Echo "">/etc/resolv. conf

Test whether DNS settings are correct.

Host mail.zhubf.com

Mail.zhubf.com has address 172.17.17.2

4. Install the postfix package (install yum and configure the yum source)

Yum install-y postfix

Modify the postfix configuration file

Vim/etc/postfix/main. cf

The main content is as follows:

5. Configure saslauthd. This software is installed by default.

Modify the saslauthd configuration file

Vi/etc/sysconfig/saslauthd

Set MECH = shadow

Service saslauthd restart

Chkconfig saslauthd on

Create an email user

Useradd zhubf

Passwd zhubf

Echo zhubf | passwd -- stdin zhubf

Password verification test

Testsaslauthd-u zhubf-p 'zhubf'

0: OK "Success ."

If it fails, it may be a firewall or selinux setting problem.

Add the following permission settings to the postfix master configuration file/etc/postfix/main. cf:

Smtpd_sasl_auth_enable = yes

Smtpd_sasl_local_domain =''

Smtpd_recipient_restrictions =

Permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

Broken_sasl_auth_clients = yes

Smtpd_client_restrictions = permit_sasl_authenticated

Smtpd_sasl_security_options = noanonymous

Restart the postfix Service

Service postfix restart

Chkconfig postfix on

Another helper tutorial is: http://www.cnblogs.com/dudu/archive/2012/12/12/linux-postfix-mailserver.html

Well written.

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.