#!/bin/bash
if [ $# -ne 2 ]
then
echo "Usage: $0 name@from.xy name@to.xy"
else
for i in $(cat /var/log/mail.log | grep -i $1 | grep from | awk '{ print $6 }');
do
cat /var/log/mail.log | grep $i | grep -i $2 | grep to
done
fi
Edit:Will noch flags für -to, -from und -log hinzufügen - hatte aber keine Lust mehr. Hatte erstmal den Zweck erfüllt.
