1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-20 15:07:03 +00:00
Files
go-chasquid-smtp/test/t-10-hooks/config/hooks/post-data.good
Alberto Bertogli ac7f32c2ce smtpsrv: Implement a post-DATA hook
This patch implements a post-DATA hook, which is run after receiving the
data but before sending a reply.

It can be used to implement content filtering when receiving email, for
example for passing the email through an anti-spam or an anti-virus.
2016-10-21 22:18:53 +01:00

15 lines
217 B
Bash
Executable File

#!/bin/bash
env > ../.data/post-data.out
echo >> ../.data/post-data.out
cat >> ../.data/post-data.out
if [ "$RCPT_TO" == "blockme@testserver" ]; then
echo "¡No pasarán!"
exit 1
fi
echo "X-Post-Data: success"