PowerMTA Advance Configuration

0
PowerMTA Advance Configuration

The configuration file of PowerMTA is /etc/pmta/config. After modifying the configuration file, you need to restart the PMTA service (that is, execute the /etc/init.d/pmta restart command)

  1. Smtp account creation The
    following is a fixed format username and password that can be modified by yourself
<smtp-user alan>
        password alanhou
        source {smtpuser-auth}
</smtp-user>
<source {smtpuser-auth}>
        smtp-service yes
        always-allow-relaying yes
        require-auth true
        process-x-virtual-mta yes
        remove-received-headers true
        add-received-header false
        hide-message-source true
</source>

2.host-name setting Appears in the
received mail header, the default is to display the IP, and the domain name is modified to be more friendly
host-name mail.alanhou.org

3. http-mgmt-port settings The
default web port access port is 8080, which can be modified by yourself , such as 8000
http-mgmt-port 8000

3.
smtp -port set the default port number of smtp is 25, which can be modified by yourself , such as 2525
smtp-port 2525
can be viewed through the netstat -lnpt command

4. http-access authorization configuration
There are three levels of authority: monitor, none, admin, where 0/0 represents all IP
http-access 0/0 monitor
http-access 10.1.0.10 none
http-access 10.1.0/24 admin

5.Source configuration
By modifying 0/0 in the following code to configure to restrict access to only trusted client IP

<source 127.0.0.1>
    always-allow-relaying yes   # allow feeding from 127.0.0.1
    process-x-virtual-mta yes   # allow selection of a virtual MTA
    max-message-size 0          # 0 implies no cap, in bytes
    smtp-service yes            # allow SMTP service
</source>
 
<source 0/0>                 # matches all
    log-connections no
    log-commands    no       # WARNING: verbose!
    log-data        no       # WARNING: even more verbose!
</source>

6.domain configuration
Configure the relevant settings for the specified sending domain name

<domain yahoo.com>
max-smtp-out 50
max-msg-per-connection 5
max-msg-rate 100/h
smtp-greeting-timeout 5m # added in v3.2r17
mx-connection-attempts 10 # added in v3.2r16
smtp-pattern-list backoff
# backoff-to-normal-after 2h #added in v3.5
# backoff-max-msg-per-hour 600 # Use with PowerMTA 3.2
# backoff-max-msg-rate 600/h # Use with PowerMTA 3.5
# backoff-retry-after 30m
# backoff-notify postmaster@yourdomain.com
</domain>

7.vmta configuration Configure
the sending domain name and IP, especially for the configuration of multiple IP and multiple domain names. The following domain names and IPs need to be configured for domain name A records. The mail in the following code can be customized

<virtual-mta mail>
smtp-source-host 107.191.61.102    e.alanhou.org
domain-key alanhou,*,/etc/pmta/dkim/alanhou.pem
</virtual-mta>

8. vmta-pool configuration
Set the virtual MTA pool, for example, there are two MTAs, mail (namely the custom name mail in the above code) and test

<virtual-mta-pool alanhou.org>
  virtual-mta mail
  virtual-mta test
</virtual-mta-pool>

9.acct-file configuration
Log file storage configuration

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

Gmail, Yahoo, Hotmail, Aol mailbox delivery strategy

<domain gmail.com>
max-smtp-out 50
max-msg-per-connection 20
max-rcpt-per-message 100
max-msg-rate 250/h
smtp-pattern-list backoff #normal
... ...
</domain>
<domain aol.com>
max-smtp-out 50
max-msg-per-connection 20
max-rcpt-per-message 100
max-msg-rate 1500/h
smtp-pattern-list backoff #normal
... ...
</domain>
<domain yahoo.com>
max-smtp-out 50
max-msg-per-connection 5
max-msg-rate 2000/h
smtp-greeting-attempts 5m
mx-connection-attempts 10
smtp-pattern-list backoff #normal
... ...
</domain>
<domain hotmail.com>
max-smtp-out 50
max-msg-per-connection 5
max-msg-rate 2000/h
421-means-mx-unavailable yes
smtp-pattern-list backoff #normal
... ...
</domain>