From 151a5ddb244143d69116a6fcd884c94cdefd70dd Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 2 Feb 2014 11:08:41 +0100 Subject: procmailrc: Add X-Original-From to all emails Add an X-Original-From to all emails touched by procmail(1). All emails are forwarded (as long as there's no loop), so that header line might always be interesting. diff --git a/etc/procmailrc b/etc/procmailrc index ea35845..c587f7f 100644 --- a/etc/procmailrc +++ b/etc/procmailrc @@ -3,8 +3,12 @@ PATH = /usr/bin:/bin LOGFILE = $HOME/log/procmail.log GITHUB_FILTER = $HOME/libexec/filter-github-emails DEFAULT_RECIPIENT = admin@monitoring-plugins.org +FROM = `formail -c -x 'From ' | cut -d ' ' -f 1` EXTENSION = $1 +:0 fhw +| formail -A "X-Original-From: $FROM" + # # Handle emails sent to . # @@ -29,11 +33,8 @@ EXTENSION = $1 :0 * ! ^X-Loop: plugins@monitoring-plugins\.org { - FROM = `formail -c -x 'From ' | cut -d ' ' -f 1` - :0 fhw - | formail -A 'X-Loop: plugins@monitoring-plugins.org' \ - -A "X-Original-From: $FROM" + | formail -A 'X-Loop: plugins@monitoring-plugins.org' :0 ! $DEFAULT_RECIPIENT -- cgit v0.10-9-g596f