Install and Config PowerMTA (PMTA)

Free PowerMTA Multiple Virtual PMTA config file sample for free

host-name domain.com
postmaster [email protected]

http-mgmt-port 1111
# http-access xxx.xxx.xxx.xxx admin
http-access 0/0 monitor

smtp-listener 0/0:2525

total-max-smtp-in 1000
total-max-smtp-out 1000

sync-msg-create false
sync-msg-update false
run-as-root no

log-file /var/log/pmta/pmta.log
log-rotate 10

<acct-file /var/log/pmta/acct.csv>
delete-after 3d
max-size 50M
</acct-file>

<acct-file /var/log/pmta/diag.csv>
delete-after 3d
max-size 50M
records t
</acct-file>

<acct-file /var/log/pmta/bounce.csv>
delete-after 3d
max-size 50M
records b
record-fields b timeQueued, bounceCat, vmta, orig, rcpt, srcMta, dlvSourceIp, jobId, dsnStatus, dsnMta, dsnDiag
</acct-file>

<acct-file /var/log/pmta/rb.csv>
delete-after 3d
max-size 50M
records rb
</acct-file>

<acct-file /var/log/pmta/rs.csv>
delete-after 3d
max-size 50M
records rs
</acct-file>

spool /var/spool/pmta

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

# default domain settings

<domain *>
retry-after 30m
max-msg-rate 100000/h
deliver-local-dsn YES
use-starttls yes
require-starttls no
bounce-after 7d
dk-sign yes
dkim-sign yes
</domain>

# domains that resolve to bounce domains
domain-macro bouncing elvisuzoma.com

<domain $bouncing>
max-msg-rate 100000/h
retry-after 5m
use-starttls no
deliver-local-dsn yes
</domain>

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

<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>
#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 /Delivery report/ 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
reply /421rlynw/ mode=backoff
reply /permanently deferred/ mode=backoff
reply /\d+\.\d+\.\d+\.\d+ blocked/ mode=backoff
reply /www\.spamcop\.net\/bl\.shtml/ mode=backoff
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>

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

<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
/\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) +(\[email protected]\S+ +)?(not (a +)?valid|not known|not here|not found|does not exist|bad|invalid|unknown|illegal|unavailable)/ bad-mailbox
/\[email protected]\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
/rejected/ 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
/^2.\d.\d/ success
/^[45]\.1\.1/ bad-mailbox
/^[45]\.1\.2/ bad-domain
/^[45]\.3\.5/ bad-configuration
/^[45]\.4\.1/ no-answer-from-host
/^[45]\.4\.2/ bad-connection
/^[45]\.4\.4/ routing-errors
/^[45]\.4\.6/ routing-errors
/^[45]\.4\.7/ message-expired
/^[45]\.7\.1/ policy-related
// other # catch-all
</bounce-category-patterns>

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

<smtp-user pmtauser>
password oktpw1
source {smtpuser-auth}
</smtp-user>

<source {smtpuser-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
allow-starttls yes
</source>

<source 0/0>
jobid-header Message-ID
process-x-job yes
hide-message-source yes
allow-unencrypted-plain-auth yes
hide-message-source yes
always-allow-relaying yes # allow feeding
add-received-header no
process-x-virtual-mta yes # allow selection of a virtual MTA
max-message-size unlimited # 0 implies no cap, in bytes
smtp-service yes # allow SMTP service
require-auth true
add-message-id-header yes
</source>

#BEGIN VIRTUAL MTAS
<virtual-mta pmta-vmta1>
smtp-source-host 1.1.1.140 app1.yourdomain.com
domain-key dkim,yourdomain.com,/root/dkim.private.key

<virtual-mta pmta-vmta2>
smtp-source-host 1.1.1.141 app2.yourdomain.com
domain-key dkim,yourdomain.com,/root/dkim.private.key
</virtual-mta>

<virtual-mta pmta-vmta3>
smtp-source-host 1.1.1.142 app3.yourdomain.com
domain-key dkim,yourdomain.com,/root/dkim.private.key
</virtual-mta>

<virtual-mta pmta-vmta4>
smtp-source-host 1.1.1.144 app4.yourdomain.com
domain-key dkim,yourdomain.com,/root/dkim.private.key
</virtual-mta>

<virtual-mta pmta-vmta5>
smtp-source-host 1.1.1.146 app5.yourdomain.com
domain-key dkim,yourdomain.com,/root/dkim.private.key
</virtual-mta>

<virtual-mta pmta-vmta6>
smtp-source-host 1.1.1.147 app6.yourdomain.com
domain-key dkim,yourdomain.com,/root/dkim.private.key
</virtual-mta>

<virtual-mta pmta-vmta7>
smtp-source-host 1.1.1.148 app7.yourdomain.com
domain-key dkim,yourdomain.com,/root/dkim.private.key
</virtual-mta>

<virtual-mta pmta-vmta8>
smtp-source-host 1.1.1.149 app8.yourdomain.com
domain-key dkim,yourdomain.com,/root/dkim.private.key
</virtual-mta>

#END VIRTUAL MTAS
<virtual-mta-pool pmta-pool>
virtual-mta pmta-vmta1
virtual-mta pmta-vmta2
virtual-mta pmta-vmta3
virtual-mta pmta-vmta4
virtual-mta pmta-vmta5
virtual-mta pmta-vmta6
virtual-mta pmta-vmta7
virtual-mta pmta-vmta8
</virtual-mta-pool>

Leave a Reply