This commit is contained in:
temasky
2020-07-31 12:45:56 +00:00
commit 5d419635ed
306 changed files with 26949 additions and 0 deletions
@@ -0,0 +1,3 @@
# Work around clients that send `RCPT TO:<'user@domain'>` (Outlook 2003/2007).
# WARNING: do not lose the parameters that follow the address.
/^(RCPT\s+TO:\s*<)'([^[:space:]]+)'(>.*)/ $1$2$3
@@ -0,0 +1,9 @@
#
# /etc/mail/mailer.cf
#
# Execute the Postfix sendmail program, named /usr/local/sbin/sendmail
#
sendmail /usr/local/sbin/sendmail
send-mail /usr/local/sbin/sendmail
mailq /usr/local/sbin/sendmail
newaliases /usr/local/sbin/sendmail
+182
View File
@@ -0,0 +1,182 @@
#---------------------------------------------------------------------
# This file is part of iRedMail, which is an open source mail server
# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
#
# iRedMail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# iRedMail is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with iRedMail. If not, see <http://www.gnu.org/licenses/>.
#---------------------------------------------------------------------
#
# Sample Postfix check_helo_access rule. It should be located at:
# /etc/postfix/check_helo_access.pcre
#
# Shipped within iRedMail project:
# * http://www.iredmail.org/
# Prepend HELO hostname of sender server
#/(.*)/ PREPEND X-Original-Helo: $1 (iRedMail: http://www.iredmail.org/)
# No one will use these in helo command.
/^(localhost)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/^(localhost.localdomain)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(\.local)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
# Reject who use IP address as helo.
# Correct: [xxx.xxx.xxx.xxx]
# Incorrect: xxx.xxx.xxx.xxx
/^([0-9\.]+)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server sent non RFC compliant HELO identity (${1})
#
# This is the real HELO identify of these ISPs:
# sohu.com websmtp.sohu.com relay2nd.mail.sohu.com
# 126.com m15-78.126.com
# 163.com m31-189.vip.163.com m13-49.163.com
# sina.com mail2-209.sinamail.sina.com.cn
# gmail.com xx-out-NNNN.google.com
/^(126\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server seems to be impersonating another mail server (${1})
/^(163\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server seems to be impersonating another mail server (${1})
/^(163\.net)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server seems to be impersonating another mail server (${1})
/^(sohu\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server seems to be impersonating another mail server (${1})
/^(gmail\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server seems to be impersonating another mail server (${1})
/^(google\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server seems to be impersonating another mail server (${1})
/^(yahoo\.com\.cn)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server seems to be impersonating another mail server (${1})
/^(yahoo\.co\.jp)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server seems to be impersonating another mail server (${1})
#
# Spammers.
#
/^(728154EA470B4AA\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(taj-co\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(CF8D3DB045C1455\.net)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(dsgsfdg\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(se\.nit7-ngbo\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(mail\.goo\.ne\.jp)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(n-ong_an\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(meqail\.teamefs-ine5tl\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(zzg\.jhf-sp\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(din_glo-ng\.net)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(fda-cnc\.ie\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(yrtaj-yrco\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(m\.am\.biz\.cn)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(xr_haig\.roup\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(hjn\.cn)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(we_blf\.com\.cn)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(netvigator\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(mysam\.biz)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(mail\.teams-intl\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(seningbo\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(nblf\.com\.cn)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(kdn\.ktguide\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(zzsp\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(nblongan\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(dpu\.cn)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(nbalton\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(cncie\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(xinhaigroup\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(wz\.com)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/(\.zj\.cn)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/(\.kornet)$/ REJECT ACCESS DENIED. Your email was rejected because it appears to come from a known spamming mail server (${1})
/^(dsldevice\.lan)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/^(system\.mail)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/^(speedtouch\.lan)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/^(dsldevice\.lan)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
#
# Reject adsl spammers.
#
# match word `adsl` with word boundary `\b`.
/(\badsl\b)/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
# bypass "[IP_ADDRESS]"
/^\[(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\]$/ DUNNO
# bypass some HELOs which contains IP address
/^o\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}\.outbound-mail\.sendgrid\.net$/ DUNNO
/^\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}\.mail-mail\.facebook\.com$/ DUNNO
/^outbound-\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}\.pinterestmail\.com$/ DUNNO
# reject HELO which contains IP address
/(\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3})/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(\d{1,3}\.ip\.-\d{1,3}-\d{1,3}-\d{1,3}\.eu)/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(pppoe)/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(dsl\.brasiltelecom\.net\.br)/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(dsl\.optinet\.hr)/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(dsl\.telesp\.net\.br)/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(dialup)/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(dhcp)/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(static-pool-[\d\.-]*\.flagman\.zp\.ua)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(speedy\.com\.ar)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(speedyterra\.com\.br)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(static\.sbb\.rs)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(static\.vsnl\.net\.in)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server appears to be on a dynamic IP address that should not be doing direct mail delivery (${1})
/(advance\.com\.ar)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(airtelbroadband\.in)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(bb\.netvision\.net\.il)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(broadband3\.iol\.cz)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(cable\.net\.co)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(catv\.broadband\.hu)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(chello\.nl)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(chello\.sk)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(client\.mchsi\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(comunitel\.net)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(coprosys\.cz)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(dclient\.hispeed\.ch)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(dip0\.t-ipconnect\.de)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(domain\.invalid)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(dyn\.centurytel\.net)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(embarqhsd\.net)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(emcali\.net\.co)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(epm\.net\.co)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(fibertel\.com\.ar)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(freedom2surf\.net)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(hgcbroadband\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(HINET-IP\.hinet\.net)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(infonet\.by)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(is74\.ru)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(kievnet\.com\.ua)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(metrotel\.net\.co)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(nw\.nuvox\.net)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(pldt\.net)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(pool\.invitel\.hu)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(pool\.ukrtel\.net)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(pools\.arcor-ip\.net)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(pppoe\.avangarddsl\.ru)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(retail\.telecomitalia\.it)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(revip2\.asianet\.co\.th)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(tim\.ro)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(tsi\.tychy\.pl)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(ttnet\.net\.tr)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(tttmaxnet\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(user\.veloxzone\.com\.br)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(utk\.ru)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(veloxzone\.com\.br)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(virtua\.com\.br)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(wanamaroc\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(wbt\.ru)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(wireless\.iaw\.on\.ca)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(business\.telecomitalia\.it)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(cotas\.com\.bo)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(marunouchi\.tokyo\.ocn\.ne\.jp)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(amedex\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/(aageneva\.com)$/ REJECT ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (${1})
/^ylmf-pc/ REJECT ACCESS DENIED
/(\.*wideragents\.com)$/ REJECT ACCESS DENIED (${1})
/(\.*resumekeep\.net)$/ REJECT ACCESS DENIED (${1})
/(\.*terracedrink\.com)$/ REJECT ACCESS DENIED (${1})
/(\.*sincemessage\.com)$/ REJECT ACCESS DENIED (${1})
/(\.*ordertranquility\.com)$/ REJECT ACCESS DENIED (${1})
/(\.*terracedrink\.com)$/ REJECT ACCESS DENIED (${1})
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = sub
query_filter = (&(objectClass=mailUser)(accountStatus=active)(!(domainStatus=disabled))(|(mail=%s)(shadowAddress=%s)))
result_attribute= mailForwardingAddress
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = one
query_filter = (&(objectClass=mailDomain)(|(domainName=%d)(domainAliasName=%d))(accountStatus=active)(enabledService=mail)(enabledService=recipientbcc))
result_attribute= domainRecipientBccAddress
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = ou=PH_LDAP_ATTR_GROUP_USERS,domainName=%d,PH_LDAP_BASEDN
scope = one
query_filter = (&(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s)))(objectClass=mailUser)(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail)(enabledService=recipientbcc))
result_attribute= userRecipientBccAddress
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = one
query_filter = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(domainBackupMX=yes)(accountStatus=active)(enabledService=mail))
result_attribute= domainName
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = one
query_filter = (&(objectClass=mailDomain)(|(domainName=%d)(domainAliasName=%d))(accountStatus=active)(enabledService=mail)(enabledService=senderbcc))
result_attribute= domainSenderBccAddress
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = ou=PH_LDAP_ATTR_GROUP_USERS,domainName=%d,PH_LDAP_BASEDN
scope = one
query_filter = (&(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s)))(objectClass=mailUser)(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail)(enabledService=senderbcc))
result_attribute= userSenderBccAddress
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = one
query_filter = (&(objectClass=mailDomain)(accountStatus=active)(enabledService=mail)(|(domainName=%d)(domainAliasName=%d)))
result_attribute= senderRelayHost
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = ou=PH_LDAP_ATTR_GROUP_USERS,domainName=%d,PH_LDAP_BASEDN
scope = one
query_filter = (&(objectClass=mailUser)(mail=%s)(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail))
result_attribute= senderRelayHost
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = sub
query_filter = (&(objectClass=mailUser)(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail)(enabledService=smtp)(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s))))
result_attribute= mail
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = one
query_filter = (&(objectClass=mailDomain)(accountStatus=active)(enabledService=mail)(|(domainName=%s)(domainAliasName=%s)))
result_attribute= mtaTransport
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = domainName=%d,PH_LDAP_BASEDN
scope = sub
query_filter = (&(|(objectClass=mailUser)(&(objectClass=mailList)(enabledService=mlmmj)))(|(mail=%s)(shadowAddress=%s))(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail))
result_attribute= mtaTransport
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = sub
query_filter = (&(|(mail=%s)(shadowAddress=%s))(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail)(enabledService=deliver)(|(objectClass=mailAlias)(&(objectClass=mailUser)(enabledService=forward))))
result_attribute= mailForwardingAddress
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = sub
query_filter = (&(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail)(enabledService=deliver)(|(&(|(memberOfGroup=%s)(shadowAddress=%s))(|(objectClass=mailUser)(objectClass=mailExternalUser)))(&(memberOfGroup=%s)(!(shadowAddress=%s))(|(objectClass=mailAlias)(&(objectClass=mailList)(!(enabledService=mlmmj)))))(&(objectClass=mailList)(enabledService=mlmmj)(|(mail=%s)(shadowAddress=%s)))))
result_attribute= mail
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = sub
query_filter = (&(objectClass=mailUser)(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail)(enabledService=deliver)(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s))))
result_attribute= mail
debuglevel = 0
@@ -0,0 +1,11 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = one
query_filter = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(!(domainBackupMX=yes))(accountStatus=active)(enabledService=mail))
result_attribute= domainName
debuglevel = 0
@@ -0,0 +1,12 @@
server_host = PH_LDAP_SERVER_HOST:PH_LDAP_SERVER_PORT
version = PH_LDAP_BIND_VERSION
bind = yes
start_tls = no
bind_dn = PH_LDAP_BINDDN
bind_pw = PH_LDAP_BINDPW
search_base = PH_LDAP_BASEDN
scope = sub
query_filter = (&(objectClass=mailUser)(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s)))(accountStatus=active)(!(domainStatus=disabled))(enabledService=mail)(enabledService=deliver))
result_attribute= mailMessageStore
result_format = %s/Maildir/
debuglevel = 0
+274
View File
@@ -0,0 +1,274 @@
# --------------------
# INSTALL-TIME CONFIGURATION INFORMATION
#
# location of the Postfix queue. Default is /var/spool/postfix.
queue_directory = PH_QUEUE_DIRECTORY
# location of all postXXX commands. Default is /usr/sbin.
command_directory = PH_COMMAND_DIRECTORY
# location of all Postfix daemon programs (i.e. programs listed in the
# master.cf file). This directory must be owned by root.
# Default is /usr/libexec/postfix
daemon_directory = PH_DAEMON_DIRECTORY
# location of Postfix-writable data files (caches, random numbers).
# This directory must be owned by the mail_owner account (see below).
# Default is /var/lib/postfix.
data_directory = PH_DATA_DIRECTORY
# owner of the Postfix queue and of most Postfix daemon processes.
# Specify the name of a user account THAT DOES NOT SHARE ITS USER OR GROUP ID
# WITH OTHER ACCOUNTS AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM.
# In particular, don't specify nobody or daemon. PLEASE USE A DEDICATED USER.
# Default is postfix.
mail_owner = PH_MAIL_OWNER
# The following parameters are used when installing a new Postfix version.
#
# sendmail_path: The full pathname of the Postfix sendmail command.
# This is the Sendmail-compatible mail posting interface.
#
sendmail_path = PH_SENDMAIL_PATH
# newaliases_path: The full pathname of the Postfix newaliases command.
# This is the Sendmail-compatible command to build alias databases.
#
newaliases_path = PH_NEWALIASES_PATH
# full pathname of the Postfix mailq command. This is the Sendmail-compatible
# mail queue listing command.
mailq_path = PH_MAILQ_PATH
# group for mail submission and queue management commands.
# This must be a group name with a numerical group ID that is not shared with
# other accounts, not even with the Postfix account.
setgid_group = PH_SETGID_GROUP
# external command that is executed when a Postfix daemon program is run with
# the -D option.
#
# Use "command .. & sleep 5" so that the debugger can attach before
# the process marches on. If you use an X-based debugger, be sure to
# set up your XAUTHORITY environment variable before starting Postfix.
#
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
debug_peer_level = 2
# --------------------
# CUSTOM SETTINGS
#
# SMTP server response code when recipient or domain not found.
unknown_local_recipient_reject_code = 550
# Do not notify local user.
biff = no
# Disable the rewriting of "site!user" into "user@site".
swap_bangpath = no
# Disable the rewriting of the form "user%domain" to "user@domain".
allow_percent_hack = no
# Allow recipient address start with '-'.
allow_min_user = no
# Disable the SMTP VRFY command. This stops some techniques used to
# harvest email addresses.
disable_vrfy_command = yes
# Enable both IPv4 and/or IPv6: ipv4, ipv6, all.
inet_protocols = all
# Enable all network interfaces.
inet_interfaces = all
#
# TLS settings.
#
# SSL key, certificate, CA
#
smtpd_tls_key_file = PH_SSL_KEY_FILE
smtpd_tls_cert_file = PH_SSL_CERT_FILE
smtpd_tls_CAfile = PH_SSL_CERT_FILE
smtpd_tls_CApath = PH_SSL_CERT_DIR
#
# Disable SSLv2, SSLv3
#
smtpd_tls_protocols = !SSLv2 !SSLv3
smtpd_tls_mandatory_protocols = !SSLv2 !SSLv3
smtp_tls_protocols = !SSLv2 !SSLv3
smtp_tls_mandatory_protocols = !SSLv2 !SSLv3
lmtp_tls_protocols = !SSLv2 !SSLv3
lmtp_tls_mandatory_protocols = !SSLv2 !SSLv3
#
# Fix 'The Logjam Attack'.
#
smtpd_tls_exclude_ciphers = aNULL, eNULL, EXPORT, DES, RC4, MD5, PSK, aECDH, EDH-DSS-DES-CBC3-SHA, EDH-RSA-DES-CDC3-SHA, KRB5-DE5, CBC3-SHA
smtpd_tls_dh512_param_file = PH_SSL_DH512_PARAM_FILE
smtpd_tls_dh1024_param_file = PH_SSL_DH1024_PARAM_FILE
tls_random_source = dev:/dev/urandom
# Log only a summary message on TLS handshake completion — no logging of client
# certificate trust-chain verification errors if client certificate
# verification is not required. With Postfix 2.8 and earlier, log the summary
# message, peer certificate summary information and unconditionally log
# trust-chain verification errors.
smtp_tls_loglevel = 1
smtpd_tls_loglevel = 1
# Opportunistic TLS: announce STARTTLS support to remote SMTP clients, but do
# not require that clients use TLS encryption.
smtpd_tls_security_level = may
# Produce `Received:` message headers that include information about the
# protocol and cipher used, as well as the remote SMTP client CommonName and
# client certificate issuer CommonName.
# This is disabled by default, as the information may be modified in transit
# through other mail servers. Only information that was recorded by the final
# destination can be trusted.
#smtpd_tls_received_header = yes
# Opportunistic TLS, used when Postfix sends email to remote SMTP server.
# Use TLS if this is supported by the remote SMTP server, otherwise use
# plaintext.
# References:
# - http://www.postfix.org/TLS_README.html#client_tls_may
# - http://www.postfix.org/postconf.5.html#smtp_tls_security_level
smtp_tls_security_level = may
# Use the same CA file as smtpd.
smtp_tls_CApath = PH_SSL_CERT_DIR
smtp_tls_CAfile = $smtpd_tls_CAfile
smtp_tls_note_starttls_offer = yes
# Enable long, non-repeating, queue IDs (queue file names).
# The benefit of non-repeating names is simpler logfile analysis and easier
# queue migration (there is no need to run "postsuper" to change queue file
# names that don't match their message file inode number).
enable_long_queue_ids = yes
# Reject unlisted sender and recipient
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
# Header and body checks with PCRE table
header_checks = pcre:PH_POSTFIX_FILE_HEADER_CHECKS
body_checks = pcre:PH_POSTFIX_FILE_BODY_CHECKS
# A mechanism to transform commands from remote SMTP clients.
# This is a last-resort tool to work around client commands that break
# interoperability with the Postfix SMTP server. Other uses involve fault
# injection to test Postfix's handling of invalid commands.
# Requires Postfix-2.7+.
smtpd_command_filter = pcre:PH_POSTFIX_FILE_SMTPD_COMMAND_FILTER
# HELO restriction
smtpd_helo_required = yes
smtpd_helo_restrictions =
permit_mynetworks
permit_sasl_authenticated
check_helo_access pcre:PH_POSTFIX_FILE_HELO_ACCESS
reject_non_fqdn_helo_hostname
reject_unknown_helo_hostname
# Sender restrictions
smtpd_sender_restrictions =
reject_non_fqdn_sender
reject_unlisted_sender
permit_mynetworks
permit_sasl_authenticated
check_sender_access pcre:PH_POSTFIX_FILE_SENDER_ACCESS
reject_unknown_sender_domain
# Recipient restrictions
smtpd_recipient_restrictions =
reject_non_fqdn_recipient
reject_unlisted_recipient
check_policy_service inet:PH_IREDAPD_SERVER_ADDRESS:PH_IREDAPD_LISTEN_PORT
permit_mynetworks
permit_sasl_authenticated
reject_unauth_destination
check_policy_service inet:127.0.0.1:PH_DOVECOT_SERVICE_QUOTA_STATUS_PORT
# END-OF-MESSAGE restrictions
smtpd_end_of_data_restrictions =
check_policy_service inet:PH_IREDAPD_SERVER_ADDRESS:PH_IREDAPD_LISTEN_PORT
# Data restrictions
smtpd_data_restrictions = reject_unauth_pipelining
# SRS (Sender Rewriting Scheme) support
#sender_canonical_maps = tcp:PH_IREDAPD_SERVER_ADDRESS:PH_IREDAPD_SRS_FORWARD_PORT
#sender_canonical_classes = envelope_sender
#recipient_canonical_maps = tcp:PH_IREDAPD_SERVER_ADDRESS:PH_IREDAPD_SRS_REVERSE_PORT
#recipient_canonical_classes= envelope_recipient,header_recipient
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions $sender_dependent_relayhost_maps
# Avoid duplicate recipient messages. Default is 'yes'.
enable_original_recipient = no
# Virtual support.
virtual_minimum_uid = PH_SYS_USER_VMAIL_UID
virtual_uid_maps = static:PH_SYS_USER_VMAIL_UID
virtual_gid_maps = static:PH_SYS_GROUP_VMAIL_GID
virtual_mailbox_base = PH_STORAGE_BASE_DIR
# Do not set virtual_alias_domains.
virtual_alias_domains =
#
# Enable SASL authentication on port 25 and force TLS-encrypted SASL authentication.
# WARNING: NOT RECOMMENDED to enable smtp auth on port 25, all end users should
# be forced to submit email through port 587 instead.
#
#smtpd_sasl_auth_enable = yes
#smtpd_sasl_security_options = noanonymous
#smtpd_tls_auth_only = yes
# hostname
myhostname = PH_HOSTNAME
myorigin = PH_HOSTNAME
mydomain = PH_HOSTNAME
# trusted SMTP clients which are allowed to relay mail through Postfix.
#
# Note: additional IP addresses/networks listed in mynetworks should be listed
# in iRedAPD setting 'MYNETWORKS' (in `/opt/iredapd/settings.py`) too.
# for example:
#
# MYNETWORKS = ['xx.xx.xx.xx', 'xx.xx.xx.0/24', ...]
#
mynetworks = 127.0.0.1
# Accepted local emails
mydestination = $myhostname, localhost, localhost.localdomain
alias_maps = hash:PH_POSTFIX_FILE_ALIASES
alias_database = hash:PH_POSTFIX_FILE_ALIASES
# Default message_size_limit.
message_size_limit = PH_MESSAGE_SIZE_LIMIT_BYTES
# The set of characters that can separate a user name from its extension
# (example: user+foo), or a .forward file name from its extension (example:
# .forward+foo).
# Postfix 2.11 and later supports multiple characters.
recipient_delimiter = +
# The time after which the sender receives a copy of the message headers of
# mail that is still queued. Default setting is disabled (0h) by Postfix.
#delay_warning_time = 1h
# Do not display the name of the recipient table in the "User unknown" responses.
# The extra detail makes trouble shooting easier but also reveals information
# that is nobody elses business.
show_user_unknown_table_name = no
+7
View File
@@ -0,0 +1,7 @@
#
# Amavisd + SpamAssassin + ClamAV
#
content_filter = smtp-amavis:[PH_SMTP_SERVER]:10024
# Concurrency per recipient limit.
smtp-amavis_destination_recipient_limit = 1
+8
View File
@@ -0,0 +1,8 @@
#
# Dovecot SASL support.
#
smtpd_sasl_type = dovecot
smtpd_sasl_path = PH_DOVECOT_SASL_AUTH_SOCKET
virtual_transport = PH_TRANSPORT
dovecot_destination_recipient_limit = 1
+39
View File
@@ -0,0 +1,39 @@
#
# Lookup virtual mail accounts
#
transport_maps =
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/transport_maps_user.cf
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/transport_maps_domain.cf
sender_dependent_relayhost_maps =
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/sender_dependent_relayhost_maps_user.cf
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/sender_dependent_relayhost_maps_domain.cf
# Lookup table with the SASL login names that own the sender (MAIL FROM) addresses.
smtpd_sender_login_maps =
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/sender_login_maps.cf
virtual_mailbox_domains =
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/virtual_mailbox_domains.cf
relay_domains =
$mydestination
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/relay_domains.cf
virtual_mailbox_maps =
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/virtual_mailbox_maps.cf
virtual_alias_maps =
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/virtual_alias_maps.cf
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/virtual_group_maps.cf
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/virtual_group_members_maps.cf
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/catchall_maps.cf
sender_bcc_maps =
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/sender_bcc_maps_user.cf
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/sender_bcc_maps_domain.cf
recipient_bcc_maps =
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/recipient_bcc_maps_user.cf
proxy:ldap:PH_POSTFIX_LOOKUP_DIR/recipient_bcc_maps_domain.cf
+5
View File
@@ -0,0 +1,5 @@
#
# mlmmj - mailing list manager
#
mlmmj_destination_recipient_limit = 1
+39
View File
@@ -0,0 +1,39 @@
#
# Lookup virtual mail accounts
#
transport_maps =
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/transport_maps_user.cf
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/transport_maps_maillist.cf
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/transport_maps_domain.cf
sender_dependent_relayhost_maps =
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/sender_dependent_relayhost_maps.cf
# Lookup table with the SASL login names that own the sender (MAIL FROM) addresses.
smtpd_sender_login_maps =
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/sender_login_maps.cf
virtual_mailbox_domains =
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/virtual_mailbox_domains.cf
relay_domains =
$mydestination
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/relay_domains.cf
virtual_mailbox_maps =
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/virtual_mailbox_maps.cf
virtual_alias_maps =
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/virtual_alias_maps.cf
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/domain_alias_maps.cf
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/catchall_maps.cf
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/domain_alias_catchall_maps.cf
sender_bcc_maps =
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/sender_bcc_maps_user.cf
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/sender_bcc_maps_domain.cf
recipient_bcc_maps =
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/recipient_bcc_maps_user.cf
proxy:mysql:PH_POSTFIX_LOOKUP_DIR/recipient_bcc_maps_domain.cf
+39
View File
@@ -0,0 +1,39 @@
#
# Lookup virtual mail accounts
#
transport_maps =
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/transport_maps_user.cf
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/transport_maps_maillist.cf
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/transport_maps_domain.cf
sender_dependent_relayhost_maps =
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/sender_dependent_relayhost_maps.cf
# Lookup table with the SASL login names that own the sender (MAIL FROM) addresses.
smtpd_sender_login_maps =
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/sender_login_maps.cf
virtual_mailbox_domains =
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/virtual_mailbox_domains.cf
relay_domains =
$mydestination
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/relay_domains.cf
virtual_mailbox_maps =
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/virtual_mailbox_maps.cf
virtual_alias_maps =
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/virtual_alias_maps.cf
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/domain_alias_maps.cf
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/catchall_maps.cf
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/domain_alias_catchall_maps.cf
sender_bcc_maps =
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/sender_bcc_maps_user.cf
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/sender_bcc_maps_domain.cf
recipient_bcc_maps =
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/recipient_bcc_maps_user.cf
proxy:pgsql:PH_POSTFIX_LOOKUP_DIR/recipient_bcc_maps_domain.cf
@@ -0,0 +1,30 @@
#
# Postscreen
#
postscreen_greet_action = drop
postscreen_blacklist_action = drop
postscreen_dnsbl_action = drop
postscreen_dnsbl_threshold = 2
# Attention:
# - zen.spamhaus.org free tire has 3 limits
# (https://www.spamhaus.org/organization/dnsblusage/):
#
# 1) Your use of the Spamhaus DNSBLs is non-commercial*, and
# 2) Your email traffic is less than 100,000 SMTP connections per day, and
# 3) Your DNSBL query volume is less than 300,000 queries per day.
#
# - FAQ: "Your DNSBL blocks nothing at all!"
# https://www.spamhaus.org/faq/section/DNSBL%20Usage#261
#
# It's strongly recommended to use a local DNS server for cache.
postscreen_dnsbl_sites =
zen.spamhaus.org=127.0.0.[2..11]*3
b.barracudacentral.org=127.0.0.2*2
postscreen_dnsbl_reply_map = texthash:PH_POSTSCREEN_FILE_DNSBL_REPLY
postscreen_access_list = permit_mynetworks cidr:PH_POSTSCREEN_FILE_ACCESS_CIDR
# Require Postfix-2.11+
#postscreen_dnsbl_whitelist_threshold = -2
+76
View File
@@ -0,0 +1,76 @@
# Submission, port 587, force TLS connection.
submission inet n - n - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o content_filter=PH_AMAVISD_CONTENT_FILTER_ORIGINATING
# Use dovecot's `deliver` program as LDA.
dovecot unix - n n - - pipe
flags=DRh user=PH_SYS_USER_VMAIL:PH_SYS_GROUP_VMAIL argv=PH_DOVECOT_DELIVER_BIN -f ${sender} -d ${user}@${domain} -m ${extension}
# mlmmj - mailing list manager
# ${nexthop} is '%d/%u' in transport ('mlmmj:%d/%u')
mlmmj unix - n n - - pipe
flags=ORhu user=PH_SYS_USER_MLMMJ:PH_SYS_GROUP_MLMMJ argv=PH_CMD_MLMMJ_AMIME_RECEIVE -L PH_MLMMJ_SPOOL_DIR/${nexthop}
# Amavisd integration.
smtp-amavis unix - - n - PH_AMAVISD_MAX_SERVERS smtp
-o syslog_name=postfix/amavis
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
# smtp port used by Amavisd to re-inject scanned email back to Postfix
PH_LOCAL_ADDRESS:PH_POSTFIX_MAIL_REINJECT_PORT inet n - n - - smtpd
-o syslog_name=postfix/PH_POSTFIX_MAIL_REINJECT_PORT
-o content_filter=
-o mynetworks_style=host
-o mynetworks=PH_AMAVISD_MYNETWORKS
-o local_recipient_maps=
-o relay_recipient_maps=
-o strict_rfc821_envelopes=yes
-o smtp_tls_security_level=none
-o smtpd_tls_security_level=none
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_end_of_data_restrictions=
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings
# smtp port used by mlmmj to re-inject scanned email back to Postfix, with
# address mapping support
PH_LOCAL_ADDRESS:PH_POSTFIX_MLMMJ_REINJECT_PORT inet n - n - - smtpd
-o syslog_name=postfix/PH_POSTFIX_MLMMJ_REINJECT_PORT
-o content_filter=
-o mynetworks_style=host
-o mynetworks=PH_AMAVISD_MYNETWORKS
-o local_recipient_maps=
-o relay_recipient_maps=
-o strict_rfc821_envelopes=yes
-o smtp_tls_security_level=none
-o smtpd_tls_security_level=none
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_end_of_data_restrictions=
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT forwardings.forwarding FROM forwardings,domain WHERE forwardings.address='%d' AND '%u' NOT LIKE '%%+%%' AND forwardings.address=domain.domain AND forwardings.active=1 AND domain.active=1 AND domain.backupmx=0
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT forwardings.forwarding FROM forwardings,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND forwardings.address=alias_domain.target_domain AND alias_domain.target_domain=domain.domain AND forwardings.active=1 AND alias_domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT forwardings.forwarding FROM forwardings,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND forwardings.address=CONCAT('%u', '@', alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND forwardings.active=1 AND alias_domain.active=1 AND domain.backupmx=0
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT bcc_address FROM recipient_bcc_domain WHERE domain='%d' AND active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT recipient_bcc_user.bcc_address FROM recipient_bcc_user,domain WHERE recipient_bcc_user.username='%s' AND recipient_bcc_user.domain='%d' AND recipient_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND recipient_bcc_user.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT domain FROM domain WHERE domain='%s' AND backupmx=1 AND active=1 LIMIT 1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT bcc_address FROM sender_bcc_domain WHERE domain='%d' AND active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT sender_bcc_user.bcc_address FROM sender_bcc_user,domain WHERE sender_bcc_user.username='%s' AND sender_bcc_user.domain='%d' AND sender_bcc_user.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND sender_bcc_user.active=1
@@ -0,0 +1,6 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
# '%s' will be replaced by the envelope sender address or @domain.
query = SELECT relayhost FROM sender_relayhost WHERE account='%s' LIMIT 1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT mailbox.username FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.enablesmtp=1 AND mailbox.active=1 AND domain.backupmx=0 AND domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT transport FROM domain WHERE domain='%s' AND active=1 LIMIT 1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT maillists.transport FROM maillists,domain WHERE maillists.address='%s' AND maillists.active=1 AND maillists.domain = domain.domain AND domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT mailbox.transport FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.transport<>'' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.backupmx=0 AND domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT forwardings.forwarding FROM forwardings,domain WHERE forwardings.address='%s' AND forwardings.domain=domain.domain AND forwardings.active=1 AND domain.backupmx=0 AND domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = (SELECT domain FROM domain WHERE domain='%s' AND backupmx=0 AND active=1 LIMIT 1) UNION (SELECT alias_domain.alias_domain FROM alias_domain,domain WHERE alias_domain.alias_domain='%s' AND alias_domain.active=1 AND alias_domain.target_domain=domain.domain AND domain.active=1 AND domain.backupmx=0 LIMIT 1)
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT CONCAT(mailbox.storagenode, '/', mailbox.maildir, '/Maildir/') FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.domain = mailbox.domain AND domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT forwardings.forwarding FROM forwardings,domain WHERE forwardings.address='%d' AND '%u' NOT LIKE '%%+%%' AND forwardings.address=domain.domain AND forwardings.active=1 AND domain.active=1 AND domain.backupmx=0
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT forwardings.forwarding FROM forwardings,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND forwardings.address=alias_domain.target_domain AND alias_domain.target_domain=domain.domain AND forwardings.active=1 AND alias_domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT forwardings.forwarding FROM forwardings,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND forwardings.address=('%u' || '@' || alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND forwardings.active=1 AND alias_domain.active=1 AND domain.backupmx=0
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT bcc_address FROM recipient_bcc_domain WHERE domain='%d' AND active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT recipient_bcc_user.bcc_address FROM recipient_bcc_user,domain WHERE recipient_bcc_user.username='%s' AND recipient_bcc_user.domain='%d' AND recipient_bcc_user.domain=domain.domain AND recipient_bcc_user.active=1 AND domain.backupmx=0 AND domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT domain FROM domain WHERE domain='%s' AND backupmx=1 AND active=1 LIMIT 1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT bcc_address FROM sender_bcc_domain WHERE domain='%d' AND active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT sender_bcc_user.bcc_address FROM sender_bcc_user,domain WHERE sender_bcc_user.username='%s' AND sender_bcc_user.domain='%d' AND sender_bcc_user.domain=domain.domain AND sender_bcc_user.active=1 AND domain.backupmx=0 AND domain.active=1
@@ -0,0 +1,6 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
# '%s' will be replaced by the envelope sender address or @domain.
query = SELECT relayhost FROM sender_relayhost WHERE account='%s' LIMIT 1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT mailbox.username FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.enablesmtp=1 AND mailbox.active=1 AND domain.backupmx=0 AND domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT transport FROM domain WHERE domain='%s' AND active=1 LIMIT 1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT maillists.transport FROM maillists,domain WHERE maillists.address='%s' AND maillists.active=1 AND maillists.domain = domain.domain AND domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT mailbox.transport FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.transport<>'' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.backupmx=0 AND domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT forwardings.forwarding FROM forwardings,domain WHERE forwardings.address='%s' AND forwardings.domain=domain.domain AND forwardings.active=1 AND domain.backupmx=0 AND domain.active=1
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = (SELECT domain FROM domain WHERE domain='%s' AND backupmx=0 AND active=1 LIMIT 1) UNION (SELECT alias_domain.alias_domain FROM alias_domain,domain WHERE alias_domain.alias_domain='%s' AND alias_domain.active=1 AND alias_domain.target_domain=domain.domain AND domain.active=1 AND domain.backupmx=0 LIMIT 1)
@@ -0,0 +1,5 @@
hosts = PH_SQL_SERVER_ADDRESS:PH_SQL_SERVER_PORT
user = PH_VMAIL_DB_BIND_USER
password = PH_VMAIL_DB_BIND_PASSWD
dbname = PH_VMAIL_DB_NAME
query = SELECT (mailbox.storagenode || '/' || mailbox.maildir || '/Maildir/') FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.domain = mailbox.domain AND domain.active=1
@@ -0,0 +1,6 @@
# Rules are evaluated in the order as specified.
#1.2.3.4 permit
#2.3.4.5 reject
# Permit local clients
127.0.0.0/8 permit