mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-27 20:45:56 +00:00
test: Add a test for Exim interactions
This patch adds a new test which makes chasquid send and receive email to/from Exim. To make it work we need to add two testing flags to the SMTP courier, which is not ideal but doesn't muddle the code much. The test is not very portable, and assumes an exim binary is available, but does not have to be installed in the system. It includes a helper script to fetch one from the Debian archives.
This commit is contained in:
5
test/t-exim/config/chasquid.conf
Normal file
5
test/t-exim/config/chasquid.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
address: ":1025"
|
||||
monitoring_address: ":1099"
|
||||
|
||||
mail_delivery_agent_bin: "test-mda"
|
||||
mail_delivery_agent_args: "%user%@%domain%"
|
||||
2
test/t-exim/config/domains/srv-chasquid/users
Normal file
2
test/t-exim/config/domains/srv-chasquid/users
Normal file
@@ -0,0 +1,2 @@
|
||||
#chasquid-userdb-v1
|
||||
user SCRYPT@n:14,r:8,p:1,l:32,r00XqNmRkV505R2X6KT8+Q== aAiBBIVNNzmDXwxLLdJezFuxGtc2/wcHsy3FiOMAH4c=
|
||||
62
test/t-exim/config/exim4.in
Normal file
62
test/t-exim/config/exim4.in
Normal file
@@ -0,0 +1,62 @@
|
||||
CONFDIR = ${EXIMDIR}
|
||||
|
||||
spool_directory = CONFDIR/spool
|
||||
exim_path = CONFDIR/exim4
|
||||
|
||||
# No need to keep anything on the environment.
|
||||
# This is the default, but exim emits a warning if it's not set
|
||||
# (https://www.exim.org/static/doc/CVE-2016-1531.txt).
|
||||
keep_environment =
|
||||
|
||||
# Disable TLS for now.
|
||||
tls_advertise_hosts =
|
||||
|
||||
# Run as the current user.
|
||||
# TODO: obviously do not hard-code it!
|
||||
exim_group = ${USER}
|
||||
exim_user = ${USER}
|
||||
|
||||
# Listen on a non-privileged port.
|
||||
daemon_smtp_port = 2025
|
||||
|
||||
# ACLs to let anyone send mail (for testing, obviously).
|
||||
acl_smtp_rcpt = acl_check_rcpt
|
||||
acl_smtp_data = acl_check_data
|
||||
|
||||
begin acl
|
||||
acl_check_rcpt:
|
||||
accept
|
||||
|
||||
acl_check_data:
|
||||
accept
|
||||
|
||||
|
||||
# Forward all incoming email to chasquid (running on :1025 in this test).
|
||||
begin routers
|
||||
|
||||
rewritedst:
|
||||
driver = redirect
|
||||
data = someone@srv-chasquid
|
||||
|
||||
forwardall:
|
||||
driver = accept
|
||||
transport = tochasquid
|
||||
|
||||
begin transports
|
||||
|
||||
tochasquid:
|
||||
driver = smtp
|
||||
|
||||
# exim4 will by default detect and special-case deliveries to localhost;
|
||||
# this avoids that behaviour and tells it to go ahead anyway.
|
||||
allow_localhost
|
||||
hosts_override
|
||||
|
||||
# chasquid will be listening on localhost:1025
|
||||
hosts = localhost
|
||||
port = 1025
|
||||
|
||||
# Add headers to help debug failures.
|
||||
delivery_date_add
|
||||
envelope_to_add
|
||||
return_path_add
|
||||
Reference in New Issue
Block a user