#!/bin/sh GREP="/usr/bin/grep" SED="/usr/bin/sed" SORT="/usr/bin/sort" AWK="/usr/bin/awk" ECHO="/bin/echo" WHOIS="/usr/bin/whois" SLEEP="/bin/sleep" EXIM="/usr/local/exim/exim" SERVERNAME="mail.llorien.org" HOST="/usr/sbin/host" $GREP "<>" /var/log/exim/rejectlog.01 | $GREP "sender verify fail" | $GREP -vi Account | $GREP -vi Unavailable | $GREP -vi "valid mailbox" | $GREP -vi $SERVERNAME | $GREP -vi "no such user" | $SED 's/[^@]*@//;s/>://' | $SORT -u | while read domain rest do $HOST -t txt $domain.dsn.rfc-ignorant.org > /dev/null || ( $ECHO "From: llorien rfc-ignorant robot " $ECHO "To: submit-dsn@rfc-ignorant.org" $ECHO "CC: postmaster@$domain" $ECHO "Subject: $domain" $ECHO $ECHO "Dear postmaster," $ECHO "At least one mail server for the domain $domain" $ECHO "refuses mail with an empty Reverse-Path. This is a bad idea, as it" $ECHO "prevents your users from being notified of mail delivery problems," $ECHO "it's very annoying to other postmasters and violates relevant standards." $ECHO "Please see for details." $ECHO $ECHO "Notes:" $ECHO "- This mail is sent from an unattended mailbox, do not attempt to reply." $ECHO " Please contact postmaster in case of trouble with this program." $ECHO "- After correction, you may have to remove your domain from the listing at" $ECHO " http://www.rfc-ignorant.org/tools/lookup.php?domain=$domain" $ECHO $ECHO "domain: $domain" $ECHO $ECHO "MX Record(s):" $HOST -t mx $domain $ECHO $ECHO "Response from remote server:" $ECHO "$rest" $ECHO $ECHO "MX tracing:" $HOST -t mx secureserver.net | $AWK '{print $7}' | $SED 's/\.$//' | $SORT -u | while read mx do $HOST -t A $mx done $ECHO $ECHO $ECHO $ECHO "Additional info:" $WHOIS $domain | $GREP "[:\@]" | $GREP -vi "terms of" | $GREP -vi notice | $GREP -vi "transmission of" | $GREP -vi "http:" $ECHO ) | ( $EXIM -t -f "" ) $SLEEP 5 done