mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-08 17:51:57 +00:00
chasquid: Load and resolve aliases
This patch integrates the aliases resolution into the daemon and queue. The queue now will resolve aliases at Put time.
This commit is contained in:
11
test/t-04-aliases/config/chasquid.conf
Normal file
11
test/t-04-aliases/config/chasquid.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
smtp_address: ":1025"
|
||||
submission_address: ":1587"
|
||||
monitoring_address: ":1099"
|
||||
|
||||
mail_delivery_agent_bin: "test-mda"
|
||||
mail_delivery_agent_args: "%user%@%domain%"
|
||||
|
||||
data_dir: "../.data"
|
||||
|
||||
suffix_separators: "+-"
|
||||
drop_characters: "._"
|
||||
12
test/t-04-aliases/config/domains/testserver/aliases
Normal file
12
test/t-04-aliases/config/domains/testserver/aliases
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
# Easy aliases.
|
||||
pepe: jose
|
||||
joan: juan
|
||||
|
||||
# UTF-8 aliases.
|
||||
pitanga: ñangapirí
|
||||
añil: azul, índigo
|
||||
|
||||
# Pipe aliases.
|
||||
tubo: | writemailto ../.data/pipe_alias_worked
|
||||
|
||||
4
test/t-04-aliases/content
Normal file
4
test/t-04-aliases/content
Normal file
@@ -0,0 +1,4 @@
|
||||
Subject: Prueba desde el test
|
||||
|
||||
Crece desde el test el futuro
|
||||
Crece desde el test
|
||||
1
test/t-04-aliases/hosts
Normal file
1
test/t-04-aliases/hosts
Normal file
@@ -0,0 +1 @@
|
||||
testserver localhost
|
||||
14
test/t-04-aliases/msmtprc
Normal file
14
test/t-04-aliases/msmtprc
Normal file
@@ -0,0 +1,14 @@
|
||||
account default
|
||||
|
||||
host testserver
|
||||
port 1587
|
||||
|
||||
tls on
|
||||
tls_trust_file config/domains/testserver/cert.pem
|
||||
|
||||
from user@testserver
|
||||
|
||||
auth on
|
||||
user user@testserver
|
||||
password secretpassword
|
||||
|
||||
43
test/t-04-aliases/run.sh
Executable file
43
test/t-04-aliases/run.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
. $(dirname ${0})/../util/lib.sh
|
||||
|
||||
init
|
||||
|
||||
generate_certs_for testserver
|
||||
add_user testserver user secretpassword
|
||||
|
||||
mkdir -p .logs
|
||||
chasquid -v=2 --log_dir=.logs --config_dir=config &
|
||||
wait_until_ready 1025
|
||||
|
||||
function send_and_check() {
|
||||
run_msmtp $1@testserver < content
|
||||
shift
|
||||
for i in $@; do
|
||||
wait_for_file .mail/$i@testserver
|
||||
mail_diff content .mail/$i@testserver
|
||||
rm -f .mail/$i@testserver
|
||||
done
|
||||
}
|
||||
|
||||
# Test email aliases.
|
||||
send_and_check pepe jose
|
||||
send_and_check joan juan
|
||||
send_and_check pitanga ñangapirí
|
||||
send_and_check añil azul índigo
|
||||
|
||||
# Test suffix separators and drop characters.
|
||||
send_and_check a.ñi_l azul índigo
|
||||
send_and_check añil-blah azul índigo
|
||||
send_and_check añil+blah azul índigo
|
||||
|
||||
# Test the pipe alias separately.
|
||||
rm -f .data/pipe_alias_worked
|
||||
run_msmtp tubo@testserver < content
|
||||
wait_for_file .data/pipe_alias_worked
|
||||
mail_diff content .data/pipe_alias_worked
|
||||
|
||||
|
||||
success
|
||||
Reference in New Issue
Block a user