Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Postfix+dovecot+foxmail

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

For everyone on the Internet, sending and receiving e-mail is a basic requirement. But for those users who need to do network product promotion and news message push, ordinary mailboxes can not meet the requirements, because if the amount of mail sent is very large, the number of emails sent will be limited. For details, you can take a look at this report on the configuration of SMTP servers and the restrictions on the amount of SMTP sent by the major free email accounts.

To put it simply: if you do network product promotion and news message push, and the amount of mail sent is very large, the general suggestion is to set up your own post office server, or spend money to buy professional mass mail sending service. The SMTP of free mailbox is suitable for a small number of mass mail sending needs.

At present, there are about these service providers that provide mail delivery: SendGrid, MailChimp, Amazon SES, SendCloud, Mailgun and so on. But these third-party mail servers all use shared IP. If the sending frequency is too high, the other party will not be able to receive mail. The price of each independent IP is generally in the twenties or even forties a month, so it is better to buy a VPS to build your own mail service system.

Therefore, this tutorial helps you build personal or corporate mail service systems on VPS.

The tutorial is as follows:

Purchased VPS server information:

VPS, Centos 6.5,32-bit, 1G memory

VPS service provider reference:

Conoha: https://www.conoha.jp/zh/

Z.com: https://cloud.z.com/sg/zh/?mode=logout

Use the tool

1.Postfix

2.Dovecot

3.Foxmail client

4. An available domain name

I. installation process

1. Install Postfix

Rpm-e sendmail / / some VPS needs to delete the sendmail that comes with it

Yum remove sendmail / / some VPS needs to delete the sendmail that comes with it

Yum install-y postfix

Modify MTA (default mail transfer agent)

Alternatives-config mta

You can enter Enter directly.

Check to see if the setting is successful

Alternatives-display mta

On the first line, you can see the status of mta. For example: mat-status is manual.

two。 Install Dovecot

Yum install dovecot-y II. After the installation is complete, there is a configuration tutorial.

1. Configure Postfix

Edit / etc/postfix/main.cf, which can be downloaded or edited using vim:

Yum install-y vim

Vim / etc/postfix/main.cf

The modifications are as follows:

Line # 75: uncomment, set

Hostnamemyhostname = mail.nbu431.com

Line # 83: uncomment and set the domain name

Mydomain = nbu431.com

Line # 99: uncomment

Myorigin = $mydomain

# 116 line: modify

Inet_interfaces = al

Line 1 # 119: ipv4 is recommended. If ipv6 is supported, it can be all.

Inet_protocols = ipv4

# 164 lines: add

Mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

Line # 264: uncomment and specify intranet and local IP address ranges

Mynetworks = 127.0.0. 0. 0. 0. 0. 8, 10. 0. 0. 0. 0. 0. 0.

Line # 419: uncomment and save the mail directory

Home_mailbox = Maildir/

# 571 line: add

Smtpd_banner = $myhostname ESMTP

# add to the end

# limit the maximum size of mail to 10m

Message_size_limit = 10485760

# limit the maximum capacity of your inbox to 1G

Mailbox_size_limit = 1073741824

# SMTP Certification

Smtpd_sasl_type = dovecot

Smtpd_sasl_path = private/auth

Smtpd_sasl_auth_enable = yes

Smtpd_sasl_security_options = noanonymous

Smtpd_sasl_local_domain = $myhostname

Smtpd_recipient_restrictions=permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject

After modification, use / etc/rc.d/init.d/postfix start to open postfix, and use chkconfig postfix on to boot postfix.

two。 Configure Dovecot

The modifications are as follows:

[root@vultr ~] # vim / etc/dovecot/dovecot.conf

Line # 26: if you do not use IPv6, change it to *

Listen = *

[root@vultr ~] # vim / etc/dovecot/conf.d/10-auth.conf

Line # 9: uncomment and modify

Disable_plaintext_auth = no

# 97 line: add

Auth_mechanisms = plain login

[root@vultr ~] # vim / etc/dovecot/conf.d/10-mail.conf

Line # 30: uncomment and add

Mail_location = maildir:~/Maildir

[root@vultr ~] # vim / etc/dovecot/conf.d/10-master.conf

Lines # 88-90: uncomment and add

# Postfix smtp Verification

Unix_listener / var/spool/postfix/private/auth {

Mode = 0666

User = postfix

Group = postfix

}

[root@vultr ~] # / etc/rc.d/init.d/dovecot start

Starting Dovecot Imap: [OK]

[root@vultr ~] # chkconfig dovecot on

At this point, our mail server has been built successfully.

III. Domain name resolution

Domain name resolution is also required after the construction is completed.

Add a subdomain name mail,A record to resolve to the server IP.

Add another MX record, the host record is empty, and the record value is the second-level domain name mail.nbu431.com resolved above, with a priority of 10.

Note: it may take some time for the resolution to take effect.

IV. A tutorial on the use of mailbox clients

When everything is done, you can use third-party software such as Foxmail to send and receive email.

Here, we need to say that the system user of VPS is the user of email:

For example, root, which is not only the administrator user of VPS, but also the mailbox user we built, as a mailbox user, its account number is: root@nbu431.com, and the mailbox password is the root login password of vps.

Here, we generally add an administrator user for a mailbox. The process is as follows:

# create a user

Useradd admin

# if you set a password, you will be required to enter it twice

Passwd admin

The next step is to download and login to Foxmail

1 >. Download Foxmail

2 >. The installation process is simple. Log in to Foxmail after the installation is complete.

Click create to enter the login settings: note here that the email account is admin, not email, and we do not have SSL configured, so do not check it. Next, click create, and if everything is all right, you have succeeded.

* * at this point, you can use the client to send a pleasant mass email, which is very fast. Batch email address import is supported. Even .txt email address can be imported in batch with a little editing. In addition,

Postscript description

How to use posfix

/ etc/rc.d/init.d/postfix start/stop/status/restart

How to use Dovecot

/ etc/rc.d/init.d/dovecot start/stop/status/restart

Server log directory:

Cat / var/log/maillog

In addition:

You can try to install pflogsumm on the server, which is very convenient to manage email. There are many installation tutorials online, you can search for the installation.

The pflogsumm functions are as follows

Count today's information.

Pflogsumm-d today / var/log/maillog

Statistics of yesterday's information

Pflogsumm-d yesterday / var/log/maillog

Generate yesterday's report using scheduled tasks

1 * / usr/sbin/pflogsumm-d yesterday / var/log/maillog 2 > & 1 | mail-s "daily mail stats" postmaster@domain.com

Use scheduled tasks to generate last week's report

10 * / usr/sbin/pflogsumm / var/log/maillog.1 2 > & 1 | mail-s "weekly mail stats" postmaster@domain.com

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report