Skip to content

Instantly share code, notes, and snippets.

@ei-grad
Created March 30, 2019 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ei-grad/769f6726564e4588f15d0fd9ef6381cd to your computer and use it in GitHub Desktop.
Save ei-grad/769f6726564e4588f15d0fd9ef6381cd to your computer and use it in GitHub Desktop.
Some exim ugly hacks
#!/usr/bin/env perl
use open qw(:std :utf8);
use Encode qw(decode);
while (my $line = <STDIN>) {
print decode("MIME-Header", $line);
}
#!/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
[Unit]
Description=Kick bounced mails to be sent
[Service]
ExecStart=/usr/local/bin/kick-bounce-mails.sh
[Install]
WantedBy=multi-user.target
#!/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