Created
March 30, 2019 22:14
-
-
Save ei-grad/769f6726564e4588f15d0fd9ef6381cd to your computer and use it in GitHub Desktop.
Some exim ugly hacks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use open qw(:std :utf8); | |
use Encode qw(decode); | |
while (my $line = <STDIN>) { | |
print decode("MIME-Header", $line); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in `exim -bp | grep frozen | awk '{print $3}'`; do | |
echo --- $i | |
exim -Mvc $i | grep -e Subj -e ^Date -e ^From -e ^To | |
echo | |
done | decode-mime-headers.pl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Kick bounced mails to be sent | |
[Service] | |
ExecStart=/usr/local/bin/kick-bounce-mails.sh | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
tail -F -n0 /var/log/exim4/mainlog \ | |
| grep --line-buffered "MAIL FROM:<>" \ | |
| awk '{print $3; system("")}' \ | |
| while read -r i; do | |
sleep 1 | |
exim -Mes $i $BOUNCE_MAIL_FROM | |
exim -M $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment