Postfix Mail Server construction, postfix Mail Server

Source: Internet
Author: User
Tags dovecot

Postfix Mail Server construction, postfix Mail Server

Environment
Centos 6.4 64-bit System
The service is a system account used to send and receive emails.

Before configuring DNS resolution for the server, add A, MX, and TXT tags. Take hichina as an example.


Record type host record resolution line record value MX priority TTL
A mail default line 192.168.1.2 -- 10 minutes
MX @ default line www.abc.com. 10 10 minutes
TXT @ default line v = spf1 a mx ~ All -- 10 minutes

Install postfix
Yum-y install postfix
The main. cf configuration file does not need to be changed as for master. cf. the default value is good.
Note that there must be no spaces at the beginning of the line before modification.
Cd/etc/postfix
Cp main. cf main. cf_bak # Back up data before modification
Vi main. cf
Modify the following content. If the preceding number is a row number or there is a deviation, use your own number as the standard.
76 myhostname = www.abc.com # Set the Host Name (note that this comment cannot be written in the configuration file; otherwise, an error may occur. It is only convenient to annotate it here)
83 mydomain = abc.com # generally, the name after the first vertex of myhostname is obtained.
99 myorigin = $ mydomain # source address displayed during mail sending. This value is used when mail from is empty.
113 inet_interfaces = all # Set the postfix listener interface. By default, only the local interface is monitored, and all is the listener interface.
119 inet_protocols = ipv4 # Set the postfix listening IP protocol. If ipv6 is available, add it.
165 mydestination = $ myhostname, localhost. $ mydomain, localhost, $ mydomain # Set the host name that can receive emails
264 mynetworks = 127.0.0.0/8 # specifies a trusted client, where only local mail forwarding is allowed
386 alias_maps = hash:/etc/aliases # Set the email alias
397 alias_database = hash:/etc/aliases

Save and exit
You must restart postfix every time you change main. cf. You can run/etc/init. d/postfix reload (restart)

Start postfix,/etc/init. d/postfix start

Test email sending
Telnet 127.0.0.1 25

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 www.abc.com ESMTP Postfix

Ehlo service
250-www.abc.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

Mail from: service@abc.com
250 2.1.0 OK

Rcpt to: 123456789@qq.com
250 2.1.5 OK

Data
354 End data with <CR> <LF>. <CR> <LF>
Subject: test postfix mail
Is test body
.
250 2.0.0 OK: queued as 89EC7240511

Quit

The email is sent successfully. view the email queue.

The queue is empty, indicating that the email has been sent out and there is no error

 

Install dovecot and use POP/IMAP on the client to receive emails.
Yum-y install dovecot
Modify the configuration file after installation
Because many clients prohibit plaintext transmission, they all use the POP3s/IMAPs protocol.
Cd/etc/dovecot
Cp dovecot. conf dovecot. conf_bak
Vi dovecot. conf

Save the modification and exit.

Cd conf. d
Cp 10-auth.conf 10-auth.conf_bak
Vi 10-auth.conf

Remove the comments from this line

Save and exit

Cp 10-ssl.conf 10-ssl.conf_bak
Vi 10-ssl.conf

Save and exit

Cp 10-master.conf 10-master.conf_bak
Vi 10-master.conf

After adding the content in the red box above, save and exit.

Cp 10-mail.conf 10-mail.conf_bak
Vi 10-mail.conf

Save and exit
Start dovecot
/Etc/init. d/dovecot start

Check whether the port is started

Now the installation is complete, and the rest is to use third-party software such as foxmail

 

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.