Commit 7dc9c294 authored by Paul Cammish's avatar Paul Cammish
Browse files

Configuration fixes for Exim 4.94

parent 4bdd1ae8
sympl-mail (11.210211.0) stable; urgency=medium
* Fixes for Exim4 on Bullseye
-- Paul Cammish <sympl@kelduum.net> Thu, 11 Feb 2021 15:18:03 +0000
sympl-mail (11.210209.0) stable; urgency=medium
* Updated version for Debian Bullseye
......
......@@ -3,12 +3,12 @@
# acl_m0 hasn't previously been set to "tag"
warn domains = +vhost_domains
condition = ${if and{ \
{exists{VHOST_DIR/${domain}/VHOST_CONFIG_DIR/antispam}} \
{exists{VHOST_DIR/${domain_data}/VHOST_CONFIG_DIR/antispam}} \
{!eq{$acl_m0}{tag}} \
}}
# This variable contains the user ID of the owner of the vhost directory
set acl_m0 = ${extract{uid}{${stat:VHOST_DIR/${domain}}}}
set acl_m0 = ${extract{uid}{${stat:VHOST_DIR/${domain_data}}}}
# This variable then contains the username (or nobody if grep fails, or the userid < 1000)
set acl_m1 = ${if <{$acl_m0}{1000}{DEFAULT_SPAMD_USER}\
......@@ -23,7 +23,7 @@
# then the message will be accepted, and tagged, else we reject the
# mail.
set acl_m0 = ${if match{${extract{smode}{${stat:VHOST_DIR/${domain}/VHOST_CONFIG_DIR/antispam}}}}{\Nr..$\N}{\
${if match{${readfile{VHOST_DIR/${domain}/VHOST_CONFIG_DIR/antispam}}}{^tag}{tag}{reject}}\
set acl_m0 = ${if match{${extract{smode}{${stat:VHOST_DIR/${domain_data}/VHOST_CONFIG_DIR/antispam}}}}{\Nr..$\N}{\
${if match{${readfile{VHOST_DIR/${domain_data}/VHOST_CONFIG_DIR/antispam}}}{^tag}{tag}{reject}}\
}{reject}}
# Test to see if a domain needs virus scanning,
warn domains = +vhost_domains
condition = ${if and{\
{exists{VHOST_DIR/${domain}/VHOST_CONFIG_DIR/antivirus}} \
{exists{VHOST_DIR/${domain_data}/VHOST_CONFIG_DIR/antivirus}} \
{!eq{$acl_m2}{tag}} \
}}
set acl_m2 = ${if match{${extract{smode}{${stat:VHOST_DIR/${domain}/VHOST_CONFIG_DIR/antivirus}}}}{\Nr..$\N}{\
${if match{${readfile{VHOST_DIR/${domain}/VHOST_CONFIG_DIR/antivirus}}}{^tag}{tag}{reject}}\
set acl_m2 = ${if match{${extract{smode}{${stat:VHOST_DIR/${domain_data}/VHOST_CONFIG_DIR/antivirus}}}}{\Nr..$\N}{\
${if match{${readfile{VHOST_DIR/${domain_data}/VHOST_CONFIG_DIR/antivirus}}}{^tag}{tag}{reject}}\
}{reject}}
......@@ -5,11 +5,13 @@ vhost_mailbox:
domains = +vhost_domains
local_part_suffix = +*
local_part_suffix_optional
# Define local_parts, which fills in local_part_data
local_parts = dsearch;VHOST_DIR/$domain_data/VHOST_MAILBOX_DIR
condition = ${if exists{VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part/}}
# Set the home directory for any routers/transports.
router_home_directory = VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part
transport_home_directory = VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part
data = VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part/Maildir/${if eqi{$h_X-Spam-Status:}{spam}{.Spam/}{}}
router_home_directory = VHOST_DIR/$domain_data/VHOST_MAILBOX_DIR/$local_part_data
transport_home_directory = VHOST_DIR/$domain_data/VHOST_MAILBOX_DIR/$local_part_data
data = VHOST_DIR/$domain_data/VHOST_MAILBOX_DIR/$local_part_data/Maildir/${if eqi{$h_X-Spam-Status:}{spam}{.Spam/}{}}
user = ${extract{uid}{${stat:VHOST_DIR/$domain}}}
group = ${extract{gid}{${stat:VHOST_DIR/$domain}}}
directory_transport = address_directory
......
......@@ -4,16 +4,16 @@ vhost_default_forward:
driver = redirect
domains = +vhost_domains
condition = ${if exists{VHOST_DIR/$domain/VHOST_CONFIG_DIR/default_forward}}
file = VHOST_DIR/$domain/VHOST_CONFIG_DIR/default_forward
file = VHOST_DIR/$domain_data/VHOST_CONFIG_DIR/default_forward
# Set permissions
user = ${extract{uid}{${stat:VHOST_DIR/$domain/VHOST_CONFIG_DIR}}}
group = ${extract{gid}{${stat:VHOST_DIR/$domain/VHOST_CONFIG_DIR}}}
# Ignore if world writable
modemask = 002
# Set the router/transport home directory
router_home_directory = ${if exists{VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part}{VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part}{VHOST_DIR/$domain}}
router_home_directory = ${if exists{VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part}{VHOST_DIR/$domain_data/VHOST_MAILBOX_DIR/$local_part}{VHOST_DIR/$domain_data}}
transport_home_directory = ${if exists{VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part}{VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part}{VHOST_DIR/$domain}}
transport_home_directory = ${if exists{VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part}{VHOST_DIR/$domain_data/VHOST_MAILBOX_DIR/$local_part}{VHOST_DIR/$domain_data}}
directory_transport = address_directory
file_transport = address_file
pipe_transport = address_pipe
......@@ -34,4 +34,3 @@ vhost_default_forward_check:
driver = accept
condition = ${if exists{VHOST_DIR/$domain/VHOST_CONFIG_DIR/default_forward}}
verify_only
......@@ -172,26 +172,35 @@ Testing 1.2.3..
Sympl Test
EOF
smtp.start do
assert_nothing_raised("AUTH PLAIN failed for a user with crypt'd password") do
smtp.auth_login(@mailbox_crypt.username, @mailbox_crypt_password)
end
assert_nothing_raised do
3.times do
smtp.send_message msg, @mailbox_crypt.username, @mailbox.username
end
end
# send 3 messages
smtp.send_message msg, @mailbox_crypt.username, @mailbox.username
smtp.send_message msg, @mailbox_crypt.username, @mailbox.username
smtp.send_message msg, @mailbox_crypt.username, @mailbox.username
# enable rate limit
Symbiosis::Utils.set_param("mailbox-ratelimit","1000000",@domain.config_dir)
Symbiosis::Utils.set_param("mailbox-ratelimit","2",@domain.config_dir)
# send one more message which should be fine
smtp.send_message msg, @mailbox_crypt.username, @mailbox.username
# drop the limit to 1 message
Symbiosis::Utils.set_param("mailbox-ratelimit","1",@domain.config_dir)
# send more messages which should now fail
assert_raise(Net::SMTPFatalError) do
3.times do
smtp.send_message msg, @mailbox_crypt.username, @mailbox.username
end
smtp.send_message msg, @mailbox_crypt.username, @mailbox.username
smtp.send_message msg, @mailbox_crypt.username, @mailbox.username
end
# send another message which should be fine
Symbiosis::Utils.set_param("mailbox-ratelimit","100",@domain.config_dir)
smtp.send_message msg, @mailbox_crypt.username, @mailbox.username
end
ensure
10.times do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment