mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-20 15:07:03 +00:00
This patch implements some measures against email loops, such as keeping a limit on the lenght of an address, and rejecting email that has too many Received headers. It's not perfect (a server could be actively removing Received headers), but it should cover the normal accidents and misconfigurations.
44 lines
914 B
Bash
Executable File
44 lines
914 B
Bash
Executable File
#!/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
|