CentOS7如何安装和配置PowerMTA邮局服务器?教程来了

PowerMTA 是一种电子邮件SMTP服务器软件,用于发送大量营销性电子邮件。它旨在处理大量电子邮件流量,并具有高级传递控制、实时监控和报告以及支持多个虚拟 MTA 配置等功能。 PowerMTA 常被电子邮件服务提供商、电子商务公司和其他需要定期发送大量电子邮件的企业使用。

PowerMTA 可以独立安装,也可以与 cPanel、Cyber​​Panel、Plesk、Webmin/Virtualmin、VestaCP 等 Web 托管控制面板一起安装。使用任何网络托管控制面板安装 PowerMTA 都有一个优点,因为它会自动生成 mx、spf 和 dkim 记录,如果是独立的,我们必须手动执行这些记录,而且 powermata 只是一个邮件传输代理,要接收电子邮件,我们还需要一个支持传出电子邮件的电子邮件客户端,如 roundcube、thunderbird,这些控制面板预装了这些控制面板,或者这些面板内提供了一键安装选项。

因此,最好使用任何网络托管控制面板来安装 PowerMTA。这是因为我们通过这篇文章学习了如何直接从终端安装 powermata,而不需要任何控制面板。这就是为什么我们只安装和配置独立的 PowerMTA。

要求

1. 域名:如果您已经拥有,那就太好了。

2. 开放端口号 25 的 VPS:由于某些 VPS 提供商不希望他们的服务器用于电子邮件营销或批量邮件,这些提供商默认设置端口号 25 禁用,因为他们不希望他们的 IP 被获取列入黑名单。因此,无论您选择什么提供商,请确保您的服务器已启用端口号 25。

3. PowerMTA:需要 PMTA RPM 文件和许可证文件,请点击此处下载。

部署服务器

请记住,本教程适用于 centos 7,因此请确保选择相同的操作系统。在主机名中,确保格式如下;sub.yourdomain.com

接入服务器

要从 Windows 系统连接到您的服务器,您将需要 SSH 客户端。一种流行的选择是 Putty,它提供用户友好的界面和简单的连接选项。

检查端口 25

通过运行以下命令安装 telnet:

yum install telnet -y

通过运行以下命令检查端口号 25:

telnet smtp.gmail.com 25

如果未显示“已连接到 smtp.gmail.com”,则表示端口 25 已被阻止,您无法继续使用此服务器.

要退出 telnet,请运行:

quit

更新系统包

运行以下命令来更新服务器的系统包:

yum update -y

安装解压

运行以下命令来安装解压缩:

yum install unzip -y

安装 POWERMTA

我们将通过控制面板安装 pmta,这意味着要上传文件,我们需要 FileZilla 或WinSCP。安装其中任何一个后,使用您的 SERVER_IP、用户名、密码进行连接,并确保使用端口 22 进行连接。

连接后,将 pmta.zip 上传到根目录中。

现在,从您的终端确保该文件确实存在:

ll

通过运行以下命令提取 pmta.zip:

unzip pmta.zip

将目录从 root 更改为 pmta:

cd pmta/

并运行此安装程序文件:

sh install.sh

安装需要 10-12 分钟(取决于您的服务器配置)。与此同时,让我们更新 DNS 记录。

连接域名

登录您的域名注册商并为您的子域名添加 A 记录

Type: A | Name: subdomain_name | Value: your_server_ip | TTL: Auto

配置 POWERMTA

通过运行以下命令安装 nano 编辑器:

yum install nano -y

运行以下命令打开 /etc/pmta 内的配置文件:

nano /etc/pmta/config

搜索以下行:

smtp-listener 0.0.0.0/0:25

并将其更改为如下所示:

smtp-listener 127.0.0.1:2500 # listens on all local IPs

在以下行http-mgmt-port 8080之后,添加以下指令:

http-access 0/0 admin

将其更改为:

http-access 0/0 admin

到:

http-access your_server_ip admin

重新启动 POWERMTA

通过运行以下命令重新启动 pmta 服务:

service pmta restart

通过运行以下命令重新启动 pmtahttp 服务:

service pmtahttp restart

启动 POWERMTA

打开浏览器,然后转到your_server_ip:8080

PowerMTA 已安装,但无法运行,因为我们没有正确配置它。要正确配置它,首先复制以下代码:

postmaster mail@yourdomain.com
#smtp-port 2525
smtp-listener your_server_ip:2525
<source 0/0>
log-connections yes
log-commands yes # WARNING: verbose!
allow-unencrypted-plain-auth yes
</source>
sync-msg-create false
sync-msg-update false
run-as-root no
log-file /var/log/pmta/log # logrotate is used for rotation

<acct-file /var/log/pmta/acct.csv>
# move-to /opt/myapp/pmta-acct # configure as fit for your application
# move-interval 5m

max-size 50M
</acct-file>

# transient errors (soft bounces)
<acct-file /var/log/pmta/diag.csv>
move-interval 1d
delete-after never
records t
</acct-file>

#
# spool directories
#

spool /var/spool/pmta

http-mgmt-port 8080
http-access 127.0.0.1 admin
http-access 0/0 monitor

#<spool /var/spool/pmta>
#</spool>
<smtp-user adminjkm>
password dlogicsjkm
source {pmta-auth}
</smtp-user>
<source {pmta-auth}>
smtp-service yes
always-allow-relaying yes
require-auth true
process-x-virtual-mta yes
default-virtual-mta pmta-pool
remove-received-headers true
add-received-header false
hide-message-source true
</source>

#BEGIN VIRTUAL MTAS 
<virtual-mta pmta-vmta0>
smtp-source-host your_server_ip subdomain.yourdomain.com
domain-key dkim,*,/home/admin/conf/mail/yourdomain.com/dkim.pem
domain-key default,*,/var/cpanel/domain_keys/private/yourdomain.com 
<domain *>
max-cold-virtual-mta-msg 400/day
max-msg-rate 1000/h
</domain>
</virtual-mta> 
#END VIRTUAL MTAS


<virtual-mta-pool pmta-pool>
virtual-mta pmta-vmta0
</virtual-mta-pool>

<source 127.0.0.1>
always-allow-api-submission yes
add-message-id-header yes
retain-x-job yes
retain-x-virtual-mta yes
verp-default yes
process-x-envid yes
process-x-job yes
jobid-header X-Mailer-RecptId
process-x-virtual-mta yes
</source>

<domain yourdomain.com>
route [127.0.0.1]:2525
</domain>

#N: ISP rules
############################################################################
# domains that resolve to mx?.hotmail.com
domain-macro hotmail hotmail.com,msn.com,hotmail.co.uk,hotmail.fr,live.com,hotmail.it,hotmail.de,email.msn.com,email.hotmail.com,email.msn.com,hotmail.com,live.com,msn.com,webtv.com,webtv.net
<domain $hotmail>
max-smtp-out 1 # prevent "exceeded the connection limit"
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# domains that resolve to ?.mx.mail.yahoo.com
domain-macro yahoo yahoo.com,yahoo.ca,rocketmail.com,ymail.com,yahoo.com.au,geocities.com,yahoo.com.mx,yahoo.com.br,altavista.com,ameritech.net,att.net,bellsouth.net,attbroadband.com,attcanada.net,attglobal.com,attglobal.net,attnet.com,attworldnet.com,bellatlantic.net,bellatlantic.net,bellsouth.com,bellsouth.net,flash.net,netzero.net,nvbell.net,pacbell.net,prodigy.com,prodigy.net,sbcglobal.net,sbcglobal.net,snet.net,swbell.com,swbell.net,toast.net,usa.net,verizon.com,verizon.net,verizonmail.com,vzwpix.com,wans.net,worldnet.att.net,yahoo.net

<domain $yahoo>
max-msg-per-connection 2 # yahoo policy
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# domains that resolve to mailin-0?.mx.aol.com
domain-macro aol aol.com,aim.com,aim.net,cs.com,netscape.com,wmconnect.net,netscape.net,cs.com,mail.com,wmconnect.com,icqmail.com,email.com,usa.com
<domain $aol>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# domains that resolve to (alt?.)gmail-smtp-in.l.google.com
domain-macro gmail gmail.com,googlemail.com
<domain $gmail>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>
# http://feedback.comcast.net/
<domain comcast.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>
# Ameritrade, Amitrade
<domain tdameritrade.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Ameritrade, Amitrade
<domain ameritrade.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>
# Broadband
<domain charterinternet.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Broadband
<domain comcast.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Broadband
<domain comcast.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>


# Broadband
<domain comcastwork.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Broadband
<domain cox.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Broadband
<domain cox.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Broadband
<domain coxinternet.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Broadband
<domain cox-internet.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Broadband
<domain suddenlink.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>
# Broadband
<domain windjammer.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain centurylink.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain centurylink.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain centurytel.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain centurytel.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain cswnet.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain emadisonriver.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain emadisonriver.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain embarq.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain embarq.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain embarqmail.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain grics.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain gulftel.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain mebtel.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain qwest.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain uswest.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain uswest.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain swestmail.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Century Link
<domain uswestmail.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Cincinnati Bell
<domain fuse.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Cincinnati Bell
<domain fuse.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Cincinnati Bell
<domain zoomnet.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Cincinnati Bell
<domain zoomtown.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Cincinnati Bell
<domain zoomtown.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Earthlink
<domain earthlink.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Earthlink
<domain earthlink.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Earthlink
<domain mindspring.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Earthlink
<domain netcom.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Godaddy
<domain Inbox.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Godaddy
<domain outblaze.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Iwon
<domain excite.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Iwon
<domain iwon.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Lycos
<domain angelfire.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Lycos
<domain lycos.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Lycos
<domain lycosmail.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Lycos
<domain mailcity.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Sprint
<domain sprintpcs.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Time Warner
<domain rr.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Time Warner
<domain adelphia.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Time Warner
<domain adelphia.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Time Warner
<domain insightbb.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Time Warner
<domain roadrunner.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Time Warner
<domain roadrunner.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# Tmobile
<domain tmomail.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# United Internet
<domain gmx.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# United Internet
<domain mail.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# United Online
<domain juno.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# United Online
<domain netzero.com>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# United Online
<domain unitedonline.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

# United XO
<domain concentric.net>
max-msg-rate 250/h # prevent "exceeded the rate limit"
</domain>

<domain *>
use-starttls yes
require-starttls no
</domain>
############################################################################
# BEGIN: BACKOFF RULES
#<pattern-list myList>
#mail-from /admin@nicholashillmail.com/ virtual-mta=pmta-vmta19
#header from /admin@nicholashillmail.com/ virtual-mta=pmta-vmta19
#mail-from /admin@mx2.nicholashill.eu/ virtual-mta=pmta-vmta3
#header from /admin@mx2.nicholashill.eu/ virtual-mta=pmta-vmta3
#mail-from /admin@mx3.nicholashill.eu/ virtual-mta=pmta-vmta4
#header from /admin@mx3.nicholashill.eu/ virtual-mta=pmta-vmta4
#mail-from /admin@mx4.nicholashill.eu/ virtual-mta=pmta-vmta5
#header from /admin@mx4.nicholashill.eu/ virtual-mta=pmta-vmta5
#mail-from /admin@mx5.nicholashill.eu/ virtual-mta=pmta-vmta6
#header from /admin@mx5.nicholashill.eu/ virtual-mta=pmta-vmta6
#mail-from /admin@mx6.nicholashillmail.com/ virtual-mta=pmta-vmta7
#header from /admin@mx6.nicholashillmail.com/ virtual-mta=pmta-vmta7
#mail-from /admin@mx5.nicholashillmail.com/ virtual-mta=pmta-vmta8
#header from /admin@mx5.nicholashillmail.com/ virtual-mta=pmta-vmta8
#mail-from /admin@mx4.nicholashillmail.com/ virtual-mta=pmta-vmta9
#header from /admin@mx4.nicholashillmail.com/ virtual-mta=pmta-vmta9
#mail-from /admin@mx3.nicholashillmail.com/ virtual-mta=pmta-vmta10
#header from /admin@mx3.nicholashillmail.com/ virtual-mta=pmta-vmta10
#mail-from /admin@mx2.nicholashillmail.com/ virtual-mta=pmta-vmta11
#header from /admin@mx2.nicholashillmail.com/ virtual-mta=pmta-vmta11
#mail-from /admin@mx1.nicholashillmail.com/ virtual-mta=pmta-vmta12
#header from /admin@mx1.nicholashillmail.com/ virtual-mta=pmta-vmta12
#mail-from /admin@mx5.nicholashillnews.com/ virtual-mta=pmta-vmta13
#header from /admin@mx5.nicholashillnews.com/ virtual-mta=pmta-vmta13
#mail-from /admin@mx4.nicholashillnews.com/ virtual-mta=pmta-vmta14
#header from /admin@mx4.nicholashillnews.com/ virtual-mta=pmta-vmta14
#mail-from /admin@mx3.nicholashillnews.com/ virtual-mta=pmta-vmta15
#header from /admin@mx3.nicholashillnews.com/ virtual-mta=pmta-vmta15
#mail-from /admin@mx2.nicholashillnews.com/ virtual-mta=pmta-vmta16
#header from /admin@mx2.nicholashillnews.com/ virtual-mta=pmta-vmta16
#mail-from /admin@mx1.nicholashillnews.com/ virtual-mta=pmta-vmta17
#header from /admin@mx1.nicholashillnews.com/ virtual-mta=pmta-vmta17
#mail-from /admin@nicholashillnews.com/ virtual-mta=pmta-vmta18
#header from /admin@nicholashillnews.com/ virtual-mta=pmta-vmta18
#mail-from /admin@nicholashill.eu/ virtual-mta=pmta-vmta1
#header from /admin@nicholashill.eu/ virtual-mta=pmta-vmta1
#mail-from /admin@mx1.nicholashill.eu/ virtual-mta=pmta-vmta2
#header from /admin@mx1.nicholashill.eu/ virtual-mta=pmta-vmta2
#</pattern-list>


#<source 127.0.0.1>
#pattern-list myList # this selects the pattern list for messages
#always-allow-relaying yes
#</source>

#<pattern-list myList>
#header from /admin@mx3.nicholashillmail.com/ virtual-mta=pmta-vmta10
#mail-from /admin@mx3.nicholashillmail.com/ virtual-mta=pmta-vmta10
#header from /admin@mx4.nicholashillmail.com/ virtual-mta=pmta-vmta9
#mail-from /admin@mx4.nicholashillmail.com/ virtual-mta=pmta-vmta9
#</pattern-list>
#<source 127.0.0.1>
#pattern-list myList # this selects the pattern list for messages
#</source>

# default domain settings
<domain *>
max-smtp-out 2 # default be nice on concurrent connections
max-msg-per-connection 100 # max 500 mails in one session
max-errors-per-connection 10 # avoid 'too long without data command' error
max-msg-rate 1000/h
smtp-greeting-timeout 5m
bounce-upon-no-mx yes # proper mail domains should have mx
assume-delivery-upon-data-termination-timeout yes # avoid duplicate deliveries
retry-after 10m # typical greylisting period
bounce-after 24h # default 4d12h
smtp-pattern-list blocking-errors
backoff-max-msg-rate 1/m # send only regular tries during backoff (default unlimited)
backoff-retry-after 20m # retry at least every 20m (default 1h)
backoff-notify "" # disable backoff notifications
backoff-to-normal-after-delivery yes # revert to normal asap (default no)
backoff-to-normal-after 1h # always revert to normal after 1h (default never)
dkim-sign yes
ignore-8bitmime true
use-starttls yes
</domain>

############################################################################
# END: ISP rules
############################################################################

############################################################################

<smtp-pattern-list common-errors>
reply /generating high volumes of.* complaints from AOL/ mode=backoff
reply /Excessive unknown recipients - possible Open Relay/ mode=backoff
reply /^421 .* too many errors/ mode=backoff
reply /blocked.*spamhaus/ mode=backoff
reply /451 Rejected/ mode=backoff
</smtp-pattern-list>

<smtp-pattern-list blocking-errors>
#
# A QUEUE IN BACKOFF MODE WILL SEND MORE SLOWLY
# To place a queue back into normal mode, a command similar
# to one of the following will need to be run:
# pmta set queue --mode=normal yahoo.com
# or
# pmta set queue --mode=normal yahoo.com/vmta1
#
# To use backoff mode, uncomment individual <domain> directives
#
#AOL Errors
reply /421 .* SERVICE NOT AVAILABLE/ mode=backoff
reply /generating high volumes of.* complaints from AOL/ mode=backoff
reply /554 .*aol.com/ mode=backoff
reply /421dynt1/ mode=backoff
reply /HVU:B1/ mode=backoff
reply /DNS:NR/ mode=backoff
reply /RLY:NW/ mode=backoff
reply /DYN:T1/ mode=backoff
reply /RLY:BD/ mode=backoff
reply /RLY:CH2/ mode=backoff
#
#Yahoo Errors
reply /421 .* Please try again later/ mode=backoff
reply /421 Message temporarily deferred/ mode=backoff
reply /VS3-IP5 Excessive unknown recipients/ mode=backoff
reply /VSS-IP Excessive unknown recipients/ mode=backoff
#
# The following 4 Yahoo errors may be very common
# Using them may result in high use of backoff mode
#
reply /\[GL01\] Message from/ mode=backoff
reply /\[TS01\] Messages from/ mode=backoff
reply /\[TS02\] Messages from/ mode=backoff
reply /\[TS03\] All messages from/ mode=backoff
#
#Hotmail Errors
reply /exceeded the rate limit/ mode=backoff
reply /exceeded the connection limit/ mode=backoff
reply /Mail rejected by Windows Live Hotmail for policy reasons/ mode=backoff
reply /mail.live.com\/mail\/troubleshooting.aspx/ mode=backoff
#
#Adelphia Errors
reply /421 Message Rejected/ mode=backoff
reply /Client host rejected/ mode=backoff
reply /blocked using UCEProtect/ mode=backoff
#
#Road Runner Errors
reply /Mail Refused/ mode=backoff
reply /421 Exceeded allowable connection time/ mode=backoff
reply /amIBlockedByRR/ mode=backoff
reply /block-lookup/ mode=backoff
reply /Too many concurrent connections from source IP/ mode=backoff
#
#General Errors
reply /too many/ mode=backoff
reply /Exceeded allowable connection time/ mode=backoff
reply /Connection rate limit exceeded/ mode=backoff
reply /refused your connection/ mode=backoff
reply /try again later/ mode=backoff
reply /try later/ mode=backoff
reply /550 RBL/ mode=backoff
reply /TDC internal RBL/ mode=backoff
reply /connection refused/ mode=backoff
reply /please see www.spamhaus.org/ mode=backoff
reply /Message Rejected/ mode=backoff
reply /refused by antispam/ mode=backoff
reply /Service not available/ mode=backoff
reply /currently blocked/ mode=backoff
reply /locally blacklisted/ mode=backoff
reply /not currently accepting mail from your ip/ mode=backoff
reply /421.*closing connection/ mode=backoff
reply /421.*Lost connection/ mode=backoff
reply /476 connections from your host are denied/ mode=backoff
reply /421 Connection cannot be established/ mode=backoff
reply /421 temporary envelope failure/ mode=backoff
reply /421 4.4.2 Timeout while waiting for command/ mode=backoff
reply /450 Requested action aborted/ mode=backoff
reply /550 Access denied/ mode=backoff
reply /exceeded the rate limit/ mode=backoff # hotmail rate limit
reply /421rlynw/ mode=backoff # aol rate limit
reply /permanently deferred/ mode=backoff # yahoo
reply /\d+\.\d+\.\d+\.\d+ blocked/ mode=backoff # at&t, cox
reply /generating high volumes of.* complaints from AOL/ mode=backoff
reply /Excessive unknown recipients - possible Open Relay/ mode=backoff
reply /^421 .* too many errors/ mode=backoff
reply /blocked.*spamhaus/ mode=backoff
reply /451 Rejected/ mode=backoff
</smtp-pattern-list>

############################################################################
# END: BACKOFF RULES
############################################################################


############################################################################
# BEGIN: BOUNCE RULES
############################################################################

<bounce-category-patterns>
/spam/ spam-related
/junk mail/ spam-related
/blacklist/ spam-related
/blocked/ spam-related
/\bU\.?C\.?E\.?\b/ spam-related
/\bAdv(ertisements?)?\b/ spam-related
/unsolicited/ spam-related
/\b(open)?RBL\b/ spam-related
/realtime blackhole/ spam-related
/http:\/\/basic.wirehub.nl\/blackholes.html/ spam-related
/\bvirus\b/ virus-related
/message +content/ content-related
/content +rejected/ content-related
/quota/ quota-issues
/limit exceeded/ quota-issues
/mailbox +(is +)?full/ quota-issues
/sender ((verify|verification) failed|could not be verified|address rejected|domain must exist)/ invalid-sender
/unable to verify sender/ invalid-sender
/requires valid sender domain/ invalid-sender
/bad sender's system address/ invalid-sender
/No MX for envelope sender domain/ invalid-sender
/^[45]\.4\.4/ routing-errors
/no mail hosts for domain/ invalid-sender
/Your domain has no(t)? DNS\/MX entries/ invalid-sender
/REQUESTED ACTION NOT TAKEN: DNS FAILURE/ invalid-sender
/Domain of sender address/ invalid-sender
/return MX does not exist/ invalid-sender
/Invalid sender domain/ invalid-sender
/Verification failed/ invalid-sender
/\bstorage\b/ quota-issues
/(user|mailbox|recipient|rcpt|local part|address|account|mail drop|ad(d?)ressee)
(has|has been|is)? *(currently|temporarily+)?(disabled|expired|inactive|not activated)
/ inactive-mailbox
/(conta|usu.rio) inativ(a|o)
/ inactive-mailbox
/Too many (bad|invalid|unknown|illegal|unavailable) (user|mailbox|recipient|rcpt|local part|address|account|mail drop|ad(d?)ressee)/other
/(No such|bad|invalid|unknown|illegal|unavailable) (local +)?(user|mailbox|recipient|rcpt|local part|address|account|mail drop|ad(d?)ressee)
/ bad-mailbox
/(user|mailbox|recipient|rcpt|local part|address|account|mail drop|ad(d?)ressee) +(\S+@\S+ +)?(not (a +)?valid|not known|not here|not
found|does not exist|bad|invalid|unknown|illegal|unavailable)/ bad-mailbox
/\S+@\S+ +(is +)?(not (a +)?valid|not known|not here|not found|does not exist|bad|invalid|unknown|illegal|unavailable)/ bad-mailbox
/no mailbox here by that name/ bad-mailbox
/my badrcptto list/ bad-mailbox
/not our customer/ bad-mailbox
/no longer (valid|available)/ bad-mailbox
/have a \S+ account/ bad-mailbox
/\brelay(ing)?/ relaying-issues
/domain (retired|bad|invalid|unknown|illegal|unavailable)/ bad-domain
/domain no longer in use/ bad-domain
/domain (\S+ +)?(is +)?obsolete/ bad-domain
/denied/ policy-related
/prohibit/ policy-related
/refused/ policy-related
/allowed/ policy-related
/banned/ policy-related
/policy/ policy-related
/suspicious activity/ policy-related
/bad sequence/ protocol-errors
/syntax error/ protocol-errors
/\broute\b/ routing-errors
/\bunroutable\b/ routing-errors
/\bunrouteable\b/ routing-errors
#additions by krish
/Recipient address rejected/ invalid-mailbox
/DYN:T1/ ploicy-related
/Service unavailable/ ploicy-related
/DNSBL/ spam-related
/ccount has been disabled or discontinued/ bad-mailbox
/oo many recip/ policy-related
/no valid recipie/ invalid-mailbox
/Account Inactive/ invalid-mailbox
/service provider since part of their network is on our block list/ spam-related

/Invalid 7bit DATA/ content-related
/^2.\d+.\d+;/ success
/^[45]\.1\.[1346];/ bad-mailbox
/^[45]\.1\.2/ bad-domain
/^[45]\.1\.[78];/ invalid-sender
/^[45]\.2\.0;/ bad-mailbox
/^[45]\.2\.1;/ inactive-mailbox
/^[45]\.2\.2;/ quota-issues
/^[45]\.3\.3;/ content-related
/^[45]\.3\.5;/ bad-configuration
/^[45]\.4\.1;/ no-answer-from-host
/^[45]\.4\.2;/ bad-connection
/^[45]\.4\.[36];/ routing-errors
/^[45]\.4\.7;/ message-expired
/^[45]\.5\.3;/ policy-related
/^[45]\.5\.\d+;/ protocol-errors
/^[45]\.6\.\d+;/ content-related
/^[45]\.7\.[012];/ policy-related
/^[45]\.7\.7;/ content-related
// other # catch-all
</bounce-category-patterns>

现在,在您的 PowerMTA 监控控制台中,单击“编辑配置文件”并用此代码替换所有编写的代码。

*将 yourdomain.com 替换为您的域名,类似地将 your_server_ip 替换为您的 IP 地址。

并保存

重新启动 POWERMTA

通过运行以下命令重新启动 pmta 服务:

service pmta restart

通过运行以下命令重新启动 pmtahttp 服务:

service pmtahttp restart

测试连接

现在是测试我们的 PowerMTA 的时候了,为此我们必须需要 SMTP 凭据。为此,我使用两个平台; SMTPer.net 用于测试我们的 smtp 连接和 Mail-tester.com检查垃圾邮件分数。

1. 您可以从这里找到主机名/IP:

smtp-source-host your_server_ip subdomain.yourdomain.com

2. 用户名和密码从这里找到(您可以更改):

<smtp-user adminjkm>
password dlogicsjkm
source {pmta-auth}
</smtp-user>

3. Port Number: 2525

smtp-listener your_server_ip:2525

4. From email: mail@yourdomain.com

postmaster mail@yourdomain.com

提高垃圾邮件分数

现在我们所做的是我们刚刚将我们的域名与 PowerMTA SMTP 连接起来,正如我在开始时告诉您的,如果我们在没有控制面板的情况下安装 PowerMTA,那么我们必须自己生成和配置所有域名验证记录。

1. To setup MX record:

Type: MX | Name: @ | Value: mail.yourdomain.com | Priority: 10 | TTL: Auto

2. To setup SPF record:

Type: TXT | Name: @ | Value: v=spf1 a mx a:yourdomain.com ip4:your_IPv4 ~all | TTL: Auto

3. To setup DMARC:

Type: TXT | Name: _dmarc | Value: v=DMARC1; p=none | TTL: Auto

*再次,不要忘记将 yourdomain.com 替换为您的域名,将 your_ip 替换为您的 IP 地址。

再检查一遍

有所改善,但不是百分之百,因为很明显我们没有安装 SSL,但我们没有添加 DKIM,最重要的是,我们在更新记录后立即进行了检查,而且我们都知道 DNS 记录需要一些时间来传播。但本文仍然是关于独立安装和设置 PowerMTA 的。您很快就会在这个网站和频道上找到另一个关于使用任何控制面板安装 PowerMTA 的教程,然后我们将其设为 10/10 mailtester 分数。但现在,这就是本文的全部内容。

 

原文链接:https://vuesite.cn/37933.html,转载请注明出处。
0
显示验证码
没有账号?注册  忘记密码?