change queries for new vmail db schema, changes for exim 4.94+ compat

This commit is contained in:
Matthew Saunders Brown 2022-12-05 15:20:48 -08:00
parent ceb0a589ec
commit 1107d9e7f0

View File

@ -463,31 +463,34 @@ acl_rcpt_to:
# Recipent Address Checks # Recipent Address Checks
###################################################################### ######################################################################
# Ensure only valid SRS prefixed bounce message get accepted # SRS configs taken from: https://ente.limmat.ch/kb/exim/exim_v4_srs.html
deny ## SRS checks are temporarily disabled. srsd is currently broken on Ubuntu 22.04.
senders = : ## These could be updated to use "run{/usr/bin/srs" instead of readsocket.
domains = +local_domains ## # Ensure only valid SRS prefixed bounce message get accepted
local_parts = ${if match {$local_part} {(?i)\N^SRS[01][=+-]\N} {$local_part}} ## deny
control = caseful_local_part ## senders = :
condition = ${if match{${readsocket{/run/srsd/srsd.sock}{REVERSE $local_part@$domain}{5s}{\n}}}{^ERROR: .* Invalid hash at .*}} ## domains = +local_domains
message = Invalid reverse path (SRS check failed on $local_part@$domain). ## local_parts = ${if match {$local_part} {(?i)\N^SRS[01][=+-]\N} {$local_part}}
## control = caseful_local_part
warn ## condition = ${if match{${readsocket{/run/srsd/srsd.sock}{REVERSE $local_part@$domain}{5s}{\n}}}{^ERROR: .* Invalid hash at .*}}
senders = : ## message = Invalid reverse path (SRS check failed on $local_part@$domain).
domains = +local_domains ##
local_parts = ${if match {$local_part} {\N^srs[01][=+-]\N} {$local_part}} ## warn
control = caseful_local_part ## senders = :
condition = ${if match{${readsocket{/run/srsd/srsd.sock}{REVERSE $local_part@$domain}{5s}{ }}}{^SRS: Case insensitive hash match detected. Someone smashed case in the local-part. .*}} ## domains = +local_domains
log_message = SRS hash smashed on the way for $local_part@$domain by case insensitive MTA. ## local_parts = ${if match {$local_part} {\N^srs[01][=+-]\N} {$local_part}}
## control = caseful_local_part
# this is for debugging only. can be safely removed any time ## condition = ${if match{${readsocket{/run/srsd/srsd.sock}{REVERSE $local_part@$domain}{5s}{ }}}{^SRS: Case insensitive hash match detected. Someone smashed case in the local-part. .*}}
warn ## log_message = SRS hash smashed on the way for $local_part@$domain by case insensitive MTA.
senders = : ##
domains = +local_domains ## # this is for debugging only. can be safely removed any time
local_parts = ${if match {$local_part} {(?i)\N^SRS[01][=+-]\N} {$local_part}} ## warn
control = caseful_local_part ## senders = :
condition = ${if !match{${readsocket{/run/srsd/srsd.sock}{REVERSE $local_part@$domain}{5s}{\n}}}{^ERROR: .* Invalid hash at .*}} ## domains = +local_domains
log_message = Incoming SRS bounce to $local_part@$domain ## local_parts = ${if match {$local_part} {(?i)\N^SRS[01][=+-]\N} {$local_part}}
## control = caseful_local_part
## condition = ${if !match{${readsocket{/run/srsd/srsd.sock}{REVERSE $local_part@$domain}{5s}{\n}}}{^ERROR: .* Invalid hash at .*}}
## log_message = Incoming SRS bounce to $local_part@$domain
# Deny if the local part contains @ or % or / or | or !. These are # Deny if the local part contains @ or % or / or | or !. These are
# rarely found in genuine local parts, but are often tried by people # rarely found in genuine local parts, but are often tried by people
@ -757,7 +760,9 @@ srs_bounce:
allow_defer allow_defer
local_part_prefix = srs0+ : srs0- : srs0= : srs1+ : srs1- : srs1= local_part_prefix = srs0+ : srs0- : srs0= : srs1+ : srs1- : srs1=
caseful_local_part caseful_local_part
address_data = ${readsocket{/run/srsd/srsd.sock}{REVERSE $local_part_prefix$local_part@$domain}{5s}{ }{:defer: SRS daemon failure}} address_data = ${run{/usr/bin/srs --secretfile=/etc/exim4/srsd.secret --hashlength=24 --reverse --address=$local_part_prefix$local_part@$domain}{$value}{:defer: SRS failure}}
## srsd is broken on ubuntu 22.04. using above "run" command instead
# address_data = ${readsocket{/run/srsd/srsd.sock}{REVERSE $local_part_prefix$local_part@$domain}{5s}{ }{:defer: SRS daemon failure}}
data = ${sg {$address_data} {^SRS: Case insensitive hash match detected. Someone smashed case in the local-part\. .* ([^ ]+)@([^ ]+)\$} {\N$1@$2\N} } data = ${sg {$address_data} {^SRS: Case insensitive hash match detected. Someone smashed case in the local-part\. .* ([^ ]+)@([^ ]+)\$} {\N$1@$2\N} }
headers_add = X-SRS: Decoded valid SRS return address to ${quote_local_part:${local_part:$address_data}}@${domain:$address_data} by $primary_hostname headers_add = X-SRS: Decoded valid SRS return address to ${quote_local_part:${local_part:$address_data}}@${domain:$address_data} by $primary_hostname
@ -766,9 +771,11 @@ srs_forward:
senders = ! : ! *@+local_domains senders = ! : ! *@+local_domains
domains = ! +local_domains : ! +relay_to_domains domains = ! +local_domains : ! +relay_to_domains
condition = ${lookup mysql{SELECT vm_domains.id FROM vm_domains WHERE vm_domains.domain='${original_domain}' AND vm_domains.status = '1'}} condition = ${lookup mysql{SELECT vm_domains.id FROM vm_domains WHERE vm_domains.domain='${original_domain}' AND vm_domains.status = '1'}}
address_data = ${readsocket{/run/srsd/srsd.sock}\ address_data = ${run{/usr/bin/srs --secretfile=/etc/exim4/srsd.secret --hashlength=24 --forward --address=$sender_address_local_part@$sender_address_domain --alias=$original_domain}{$value}{:defer: SRS failure}}
{FORWARD $sender_address_local_part@$sender_address_domain $original_domain\n}\ ## srsd is broken on ubuntu 22.04. using above "run" command instead
{5s}{\n}{:defer: SRS daemon failure}} # address_data = ${readsocket{/run/srsd/srsd.sock}\
# {FORWARD $sender_address_local_part@$sender_address_domain $original_domain\n}\
# {5s}{\n}{:defer: SRS daemon failure}}
errors_to = ${quote_local_part:${local_part:$address_data}}@${domain:$address_data} errors_to = ${quote_local_part:${local_part:$address_data}}@${domain:$address_data}
data = ${quote_local_part:$local_part}@$domain data = ${quote_local_part:$local_part}@$domain
headers_add = X-SRS-Forward: from $sender_address to $original_local_part@$original_domain forwarded to $local_part@$domain by $primary_hostname headers_add = X-SRS-Forward: from $sender_address to $original_local_part@$original_domain forwarded to $local_part@$domain by $primary_hostname
@ -799,19 +806,17 @@ virtual_alias:
local_part_suffix = +* local_part_suffix = +*
local_part_suffix_optional = true local_part_suffix_optional = true
condition = ${if !eq {$received_protocol}{spam-scanned}} condition = ${if !eq {$received_protocol}{spam-scanned}}
data = ${lookup mysql{SELECT CONCAT(vm_aliases.mbox,'@${domain}') FROM vm_aliases, vm_mboxes, vm_domains WHERE vm_aliases.alias='${local_part}' AND vm_aliases.domain='${domain}' AND vm_aliases.mbox=vm_mboxes.mbox AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_domains.domain='${domain}' AND vm_domains.status = '1'}} data = ${lookup mysql{SELECT CONCAT(vm_aliases.mbox,'@','${domain}') FROM vm_mboxes, vm_aliases WHERE vm_mboxes.mbox=vm_aliases.mbox AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_aliases.alias='${local_part}' AND vm_aliases.domain='${domain}'}}
junk_filter: junk_filter:
driver = accept driver = accept
domains = +local_domains domains = +local_domains
local_part_suffix = +* local_part_suffix = +*
local_part_suffix_optional = true local_part_suffix_optional = true
condition = ${if and { \ local_parts = ${lookup mysql{SELECT vm_mboxes.mbox FROM vm_mboxes WHERE vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_mboxes.filter > '0'}}
{ !eq {$received_protocol}{spam-scanned}} \ condition = ${if eq {$header_X-Junk-Flag:}{YES}}
{ eq {$header_X-Junk-Flag:}{YES}} \ condition = ${if !eq {$header_X-Whitelist-Flag:}{YES}}
{ !eq {$header_X-Whitelist-Flag:}{YES}} \ condition = ${if !eq {$received_protocol}{spam-scanned}}
} {yes}{no}}
condition = ${lookup mysql{SELECT vm_mboxes.id FROM vm_mboxes, vm_domains WHERE vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_mboxes.filter > '0' AND vm_domains.domain=vm_mboxes.domain AND vm_domains.status='1'}}
transport = junk_delivery transport = junk_delivery
spam_filter: spam_filter:
@ -819,25 +824,24 @@ spam_filter:
domains = +local_domains domains = +local_domains
local_part_suffix = +* local_part_suffix = +*
local_part_suffix_optional = true local_part_suffix_optional = true
condition = ${if and { \ local_parts = ${lookup mysql{SELECT vm_mboxes.mbox FROM vm_mboxes WHERE vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_mboxes.filter = '2'}}
{ eq {$received_protocol}{spam-scanned}} \ condition = ${if eq {$received_protocol}{spam-scanned}}
{ eq {$header_X-Spam-Flag:}{YES}} \ condition = ${if eq {$header_X-Spam-Flag:}{YES}}
{ !eq {$header_X-Whitelist-Flag:}{YES}} \ condition = ${if !eq {$header_X-Whitelist-Flag:}{YES}}
} {yes}{no}}
condition = ${lookup mysql{SELECT id FROM vm_domains, vm_mboxes WHERE vm_domains.domain='${domain}' vm_domains.status='1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status>'0'}}
transport = junk_delivery transport = junk_delivery
virtual_vacation: virtual_vacation:
driver = accept driver = accept
domains = +local_domains domains = +local_domains
# currently configured to *not* autorespond to + aliases
#local_part_suffix = +*
#local_part_suffix_optional = true
local_parts = ${lookup mysql{SELECT vm_mboxes.mbox FROM vm_mboxes, vm_autoresponders WHERE vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.mode='Vacation' AND vm_autoresponders.status='1'}}
# add options for start & end date fields to above query
# do not reply to errors or lists or spam-scanned messages, require vacation message in db # do not reply to errors or lists or spam-scanned messages, require vacation message in db
condition = ${if and { \ condition = ${if !match {$h_precedence:} {(?i)junk|bulk|list}}
{ !match {$h_precedence:} {(?i)junk|bulk|list}} \ condition = ${if !eq {$received_protocol}{spam-scanned}}
{ !eq {$received_protocol}{spam-scanned}} \ condition = ${if !eq {$sender_address} {}}
{ !eq {$sender_address} {}} \
{ eq {${lookup mysql{SELECT vm_autoresponders.mode FROM vm_domains, vm_mboxes, vm_autoresponders WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.status='1'}{$value}fail}}{Vacation}} \
} {yes} {no}}
# add options for start & end date fields
no_expn no_expn
# do not reply to errors and bounces or lists # do not reply to errors and bounces or lists
senders = " ! ^.*-request@.*:\ senders = " ! ^.*-request@.*:\
@ -856,14 +860,12 @@ virtual_autoresponder:
# currently configured to *not* autorespond to + aliases # currently configured to *not* autorespond to + aliases
#local_part_suffix = +* #local_part_suffix = +*
#local_part_suffix_optional = true #local_part_suffix_optional = true
local_parts = ${lookup mysql{SELECT vm_mboxes.mbox FROM vm_mboxes, vm_autoresponders WHERE vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.mode='Autoresponder' AND vm_autoresponders.status='1'}}
# add options for start & end date fields to above query
# do not reply to errors or lists or spam-scanned messages, require autoresponder message in db # do not reply to errors or lists or spam-scanned messages, require autoresponder message in db
condition = ${if and { \ condition = ${if !match {$h_precedence:} {(?i)junk|bulk|list}}
{ !match {$h_precedence:} {(?i)junk|bulk|list}} \ condition = ${if !eq {$received_protocol}{spam-scanned}}
{ !eq {$received_protocol}{spam-scanned}} \ condition = ${if !eq {$sender_address} {}}
{ !eq {$sender_address} {}} \
{ eq {${lookup mysql{SELECT vm_autoresponders.mode FROM vm_domains, vm_mboxes, vm_autoresponders WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.status='1'}{$value}fail}}{Autoresponder} } \
} {yes} {no}}
# add options for start & end date fields
no_expn no_expn
# do not reply to errors and bounces or lists # do not reply to errors and bounces or lists
senders = " ! ^.*-request@.*:\ senders = " ! ^.*-request@.*:\
@ -882,7 +884,7 @@ virtual_forward_and_drop:
condition = ${if !eq {$received_protocol}{spam-scanned}} condition = ${if !eq {$received_protocol}{spam-scanned}}
local_part_suffix = +* local_part_suffix = +*
local_part_suffix_optional = true local_part_suffix_optional = true
data = ${lookup mysql{SELECT vm_forwards.forward_to FROM vm_domains, vm_mboxes, vm_forwards WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_forwards.mbox='${local_part}' AND vm_forwards.domain='${domain}' AND vm_forwards.save_local='0'}} data = ${lookup mysql{SELECT vm_forwards.forward_to FROM vm_mboxes, vm_forwards WHERE vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_forwards.mbox='${local_part}' AND vm_forwards.domain='${domain}' AND vm_forwards.save_local='0'}}
virtual_forward_and_keep: virtual_forward_and_keep:
driver = redirect driver = redirect
@ -890,22 +892,20 @@ virtual_forward_and_keep:
condition = ${if !eq {$received_protocol}{spam-scanned}} condition = ${if !eq {$received_protocol}{spam-scanned}}
local_part_suffix = +* local_part_suffix = +*
local_part_suffix_optional = true local_part_suffix_optional = true
data = ${lookup mysql{SELECT CONCAT('${local_part}@${domain}\n', vm_forwards.forward_to) FROM vm_domains, vm_mboxes, vm_forwards WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_forwards.mbox='${local_part}' AND vm_forwards.domain='${domain}' AND vm_forwards.save_local='1'}} data = ${lookup mysql{SELECT CONCAT('${local_part}@${domain}\n', vm_forwards.forward_to) FROM vm_mboxes, vm_forwards WHERE vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_forwards.mbox='${local_part}' AND vm_forwards.domain='${domain}' AND vm_forwards.save_local='1'}}
spamcheck_router: spamcheck_router:
driver = accept driver = accept
# uncomment next line to bypass spamcheck when testing address routing with "exim -bt user@example.com"
#address_test = false
domains = +local_domains domains = +local_domains
local_part_suffix = +* local_part_suffix = +*
local_part_suffix_optional = true local_part_suffix_optional = true
condition = ${if and { \ local_parts = ${lookup mysql{SELECT vm_mboxes.mbox FROM vm_mboxes WHERE vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0'}}
{ !eq {$received_protocol}{spam-scanned}} \ condition = ${if !eq {$received_protocol}{spam-scanned}}
{ !eq {$sender_address_domain}{$domain}} \ condition = ${if !eq {$sender_address_domain}{$domain}}
{ < {$message_size}{512k}} \ condition = ${if !eq {$header_X-Whitelist-Flag:}{YES}}
{ !eq {$header_X-Junk-Flag:}{YES}} \ condition = ${if < {$message_size}{512k}}
{ !eq {$header_X-Whitelist-Flag:}{YES}} \
{ gt {${lookup mysql{SELECT vm_mboxes.filter FROM vm_domains, vm_mboxes WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0'}{$value}fail}}{0} } \
} {yes} {no}}
# Check for other headers too? Blacklist, SPF, DKIM failers go directly to Spam folder without spam scan??? - actually they should go to spam folder before this router is hit?
headers_remove = X-Spam-Checker-Version:X-Spam-Flag:X-Spam-Level:X-Spam-Status:X-Spam-Score:X-Spam-Report headers_remove = X-Spam-Checker-Version:X-Spam-Flag:X-Spam-Level:X-Spam-Status:X-Spam-Score:X-Spam-Report
transport = spamcheck transport = spamcheck
@ -914,7 +914,7 @@ user_filter:
domains = +local_domains domains = +local_domains
local_part_suffix = +* local_part_suffix = +*
local_part_suffix_optional = true local_part_suffix_optional = true
data = ${lookup mysql{SELECT vm_filters.filter FROM vm_domains, vm_mboxes, vm_filters WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_filters.mbox='${local_part}' AND vm_filters.domain='${domain}'}} data = ${lookup mysql{SELECT vm_filters.filter FROM vm_mboxes, vm_filters WHERE vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_filters.mbox='${local_part}' AND vm_filters.domain='${domain}'}}
user = vmail user = vmail
no_verify no_verify
no_expn no_expn
@ -931,8 +931,7 @@ lmtp_localuser:
domains = +local_domains domains = +local_domains
local_part_suffix = +* local_part_suffix = +*
local_part_suffix_optional = true local_part_suffix_optional = true
condition = ${lookup mysql{SELECT vm_mboxes.id FROM vm_domains, vm_mboxes WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0'}} condition = ${lookup mysql{SELECT vm_mboxes.id FROM vm_mboxes WHERE vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0'}}
# add checks to query for domain & mbox being active
transport = dovecot_lmtp transport = dovecot_lmtp
cannot_route_message = Unknown user cannot_route_message = Unknown user
@ -941,7 +940,7 @@ virtual_alias_catchall:
driver = redirect driver = redirect
domains = +local_domains domains = +local_domains
condition = ${if !eq {$received_protocol}{spam-scanned}} condition = ${if !eq {$received_protocol}{spam-scanned}}
data = ${lookup mysql{SELECT CONCAT(vm_aliases.mbox,'@${domain}') FROM vm_aliases, vm_mboxes, vm_domains WHERE vm_aliases.alias='catchall' AND vm_aliases.domain='${domain}' AND vm_aliases.mbox=vm_mboxes.mbox AND vm_mboxes.domain='${domain} AND vm_mboxes.status > '0' AND vm_domains.domain='${domain}' AND vm_domains.status = '1'}} data = ${lookup mysql{SELECT CONCAT(vm_aliases.mbox,'@','${domain}') FROM vm_mboxes, vm_aliases WHERE vm_mboxes.mbox=vm_aliases.mbox AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_aliases.alias='catchall' AND vm_aliases.domain='${domain}'}}
# This router handles aliasing using a linearly searched alias file with the # This router handles aliasing using a linearly searched alias file with the
# name SYSTEM_ALIASES_FILE. When this configuration is installed automatically, # name SYSTEM_ALIASES_FILE. When this configuration is installed automatically,
@ -1030,7 +1029,8 @@ begin transports
remote_smtp: remote_smtp:
driver = smtp driver = smtp
dkim_domain = ${lc:${domain:$h_from:}} # run{/bin/echo part is required to de-taint the domain
dkim_domain = ${run{/bin/echo ${lc:${domain:$h_from:}}}{$value}}
dkim_canon = relaxed dkim_canon = relaxed
dkim_selector = ${if exists{/etc/ssl/dkim/${dkim_domain}.selector}{${readfile{/etc/ssl/dkim/${dkim_domain}.selector}{}}}{0}} dkim_selector = ${if exists{/etc/ssl/dkim/${dkim_domain}.selector}{${readfile{/etc/ssl/dkim/${dkim_domain}.selector}{}}}{0}}
dkim_private_key = ${if exists{/etc/ssl/dkim/${dkim_domain}.pem}{/etc/ssl/dkim/${dkim_domain}.pem}{0}} dkim_private_key = ${if exists{/etc/ssl/dkim/${dkim_domain}.pem}{/etc/ssl/dkim/${dkim_domain}.pem}{0}}
@ -1042,14 +1042,19 @@ remote_smtp:
# particular group instead of using the sticky bit. The commented options below # particular group instead of using the sticky bit. The commented options below
# show how this can be done. # show how this can be done.
local_delivery: #local_delivery:
driver = appendfile # driver = appendfile
file = /var/mail/$local_part ## file = /var/vmail/$local_part_data
delivery_date_add # maildir_format = true
envelope_to_add # directory = /home/$local_part_data/Maildir
return_path_add # create_directory = true
group = vmail # directory_mode = 770
mode = 0660 # delivery_date_add
# envelope_to_add
# return_path_add
# user = $local_part
# group = $local_part
# mode = 0660
dovecot_lmtp: dovecot_lmtp:
driver = lmtp driver = lmtp
@ -1060,61 +1065,47 @@ dovecot_lmtp:
#allow suffixes/prefixes (default unset) #allow suffixes/prefixes (default unset)
#rcpt_include_affixes #rcpt_include_affixes
#local_delivery:
# driver = appendfile
## file = /var/vmail/$local_part
# maildir_format = true
# directory = /home/$local_part/Maildir
# create_directory
# directory_mode = 770
# delivery_date_add
# envelope_to_add
# return_path_add
# user = $local_part
# group = $local_part
# mode = 0660
## for vacation mail ## for vacation mail
vacation_transport: vacation_transport:
driver = autoreply driver = autoreply
log = /var/vmail/${domain}/${local_part}/vacation_log log = /var/vmail/${domain_data}/${local_part_data}/vacation_log
once = /var/vmail/${domain}/${local_part}/vacation_once_db once = /var/vmail/${domain_data}/${local_part_data}/vacation_once_db
return_path = ${local_part}@${domain} return_path = ${local_part}@${domain}
to = ${sender_address} to = ${sender_address}
from = ${local_part}@${domain} from = ${local_part}@${domain}
subject = ${lookup mysql{SELECT vm_autoresponders.subject FROM vm_domains, vm_mboxes, vm_autoresponders WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.status='1' AND vm_autoresponders.mode='Vacation'}{$value}{"Auto Reply"}} subject = ${lookup mysql{SELECT vm_autoresponders.subject FROM vm_autoresponders WHERE vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.status='1' AND vm_autoresponders.mode='Vacation'}{$value}{"Auto Reply"}}
text = ${lookup mysql{SELECT vm_autoresponders.body FROM vm_domains, vm_mboxes, vm_autoresponders WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.status='1' AND vm_autoresponders.mode='Vacation'}{$value}fail} text = ${lookup mysql{SELECT vm_autoresponders.body FROM vm_autoresponders WHERE vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.status='1' AND vm_autoresponders.mode='Vacation'}{$value}fail}
user = vmail user = vmail
## for autoresponder ## for autoresponder
autoresponder_transport: autoresponder_transport:
driver = autoreply driver = autoreply
log = /var/vmail/${domain}/${local_part}/autoresponder_log log = /var/vmail/${domain_data}/${local_part_data}/autoresponder_log
return_path = ${local_part}@${domain} return_path = ${local_part}@${domain}
to = ${sender_address} to = ${sender_address}
from = ${local_part}@${domain} from = ${local_part}@${domain}
subject = ${lookup mysql{SELECT vm_autoresponders.subject FROM vm_domains, vm_mboxes, vm_autoresponders WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.status='1' AND vm_autoresponders.mode='Autoresponder'}{$value}{"Auto Reply"}} subject = ${lookup mysql{SELECT vm_autoresponders.subject FROM vm_autoresponders WHERE vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.status='1' AND vm_autoresponders.mode='Autoresponder'}{$value}{"Auto Reply"}}
text = ${lookup mysql{SELECT vm_autoresponders.body FROM vm_domains, vm_mboxes, vm_autoresponders WHERE vm_domains.domain='${domain}' AND vm_domains.status = '1' AND vm_mboxes.mbox='${local_part}' AND vm_mboxes.domain='${domain}' AND vm_mboxes.status > '0' AND vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.status='1' AND vm_autoresponders.mode='Autoresponder'}{$value}fail} text = ${lookup mysql{SELECT vm_autoresponders.body FROM vm_autoresponders WHERE vm_autoresponders.mbox='${local_part}' AND vm_autoresponders.domain='${domain}' AND vm_autoresponders.status='1' AND vm_autoresponders.mode='Autoresponder'}{$value}fail}
user = vmail user = vmail
maildir_delivery: #maildir_delivery:
driver = appendfile # driver = appendfile
maildir_format # maildir_format = true
directory = /var/vmail/${domain}/${local_part}/Maildir # directory = /var/vmail/${domain_data}/${local_part_data}/Maildir
create_directory # create_directory = true
directory_mode = 750 # directory_mode = 750
user = vmail # user = vmail
user_filter_maildir_delivery: user_filter_maildir_delivery:
driver = appendfile driver = appendfile
maildir_format maildir_format = true
user = vmail user = vmail
junk_delivery: junk_delivery:
driver = appendfile driver = appendfile
maildir_format maildir_format = true
directory = /var/vmail/${domain}/${local_part}/Maildir/.Junk directory = /var/vmail/${domain_data}/${local_part_data}/Maildir/.Junk
create_directory create_directory = true
directory_mode = 750 directory_mode = 750
user = vmail user = vmail