Last update at :2024-06-26,Edit by888u
Personally, Snail's mail system generally uses free third-party mail or uses Tencent domain name post office, and there are no particularly serious problems in sending and receiving mail. After all, it is not a business necessity. However, for businesses that must and have strict requirements to rely on mail, there may be some possible problems if you use a free post office, such as the inability to send and receive mail immediately, delays, or even directly entering the trash or being blocked by a blacklist.
Of course, if it is for an enterprise and does not have the technical ability to build a mail server, Snail personally recommends purchasing a paid post office service, which may save more technology and time. But for some users who need to learn and struggle, we may try to use the server to set up our own mail server. Snail has read this article this morning (reference: http://www.cnblogs.com/hgj123/p/6186400 .html), so I am also going to refer to this article and use Postfix and Dovecot software to build a simple mail server to see if I can finally realize the task of sending and receiving emails.
First, preparations
1. Here I perform it directly on a Linux VPS host CentOS6.8 64bit system.
2. Prepare a domain name that needs to be resolved to the server to configure a self-built post office.
Second, install Postfix
yum -y install postfix
Third, modify email transmission
yum remove sendmail #Remove the built-in sendmail
alternatives –config mta
alternatives –display mta #Check whether it takes effect
When you see the line "mat – status is manual" at the top, it means there is no problem and you can continue to the next step.
Third, install Dovecot
yum -y install dovecot
Fourth, configure Postfix files
vi /etc/postfix/main.cf
It becomes more important from here on, and a configuration file is required.
1. Modify the corresponding number of lines
# Line 75: Uncomment, set hostnamemyhostname = mail.laobuluo.com# Line 83: Uncomment, set domain name mydomain = laobuluo.com# Line 99: Uncomment myorigin = $mydomain# Line 116: Modify inet_interfaces = all # Line 119: ipv4 is recommended. If ipv6 is supported, allinet_protocols = ipv4# Line 164: Add mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain# Line 264: Uncomment and specify the intranet and local IP Address range mynetworks = 127.0.0.0/8, 10.0.0.0/24# Line 419: Uncomment, mail saving directory home_mailbox = Maildir/# Line 571: Add smtpd_banner = $myhostname ESMTP
2. Add to the end of the file
message_size_limit = 10485760mailbox_size_limit = 1073741824smtpd_sasl_type = dovecotsmtpd_sasl_path = private/authsmtpd_sasl_auth_enable = yessmtpd_sasl_security_options = noanonymoussmtpd_sasl_local_domain = $myhost namesmtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
Finally, we need to start postfix and set up automatic startup
/etc/rc.d/init.d/postfix startchkconfig postfix on
Fifth, configure Dovecot file
vi /etc/dovecot/conf.d/10-auth.conf# Line 9: Uncomment and modify disable_plaintext_auth = no# Line 97: Add auth_mechanisms = plain login
vi /etc/dovecot/conf.d/10-mail.conf# Line 30: Uncomment and add mail_location = maildir:~/Maildir
vi /etc/dovecot/conf.d/10-master.conf# Lines 88-90: Uncomment and add # Postfix smtp verification
unix_listener /var/spool/postfix/private/auth {mode = 0666user = postfixgroup = postfix}
Finally, set the settings to enable startup
/etc/rc.d/init.d/dovecot startchkconfig dovecot on
Fifth, how to use a self-built post office
Here we need to create a user in the VPS, or directly use the existing root user.
useradd admin
passwd admin
According to the prompts, we can set up an admin user post office, and a password needs to be set. FoxMail is used here to connect to the post office.
Filled in by our users.
Use admin for the email account. Then create and see if it can be completed.
It seems to be relatively smooth.
Finally, there is no problem with Snail simply sending and receiving emails. However, after reading related articles from some netizens, such simple settings are not good enough and more complex configurations are needed to ensure that they are not intercepted by the blacklist. This article simply records this method, and I will organize it in detail later when I have time.
Recommended site searches: dual-line dual-ip, domain name host, Korean high-defense server, registration-free virtual space, Guangdong hosting domain name registration query, domain name registration information query, Hong Kong free virtual host PHP website space, IP address query, < /p>
发表评论