From df18d0c7060007aaa757ea749bcbb66814d1f4ce Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 5 Sep 2013 13:01:02 -0300 Subject: Introducing HIDE_SENDER --- firma | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/firma b/firma index f4697b4..3e70e98 100755 --- a/firma +++ b/firma @@ -329,6 +329,21 @@ WARNING: $LIST_NAME: Setting REPLIES_SHOULD_GO_TO_LIST to '0' for this run." REPLIES_SHOULD_GO_TO_LIST="0" fi + # check HIDE_SENDER value + if [[ -n "$HIDE_SENDER" && \ + "$HIDE_SENDER" != "0" && \ + "$HIDE_SENDER" != "1" + ]]; then + + LogMessage "\ +WARNING: $LIST_NAME: HIDE_SENDER should be set either to '0' or '1'. +WARNING: $LIST_NAME: Setting HIDE_SENDER to '0' for this run." + HIDE_SENDER="0" + + elif [[ -z "$HIDE_SENDER" ]]; then + HIDE_SENDER="0" + fi + # check REPLAY_PROTECTION value if [[ -n "$REPLAY_PROTECTION" && \ "$REPLAY_PROTECTION" != "0" && \ @@ -693,6 +708,14 @@ Reply-To: $LIST_ADDRESS" fi fi + # hide the sender + if [[ "$HIDE_SENDER" == "1" ]]; then + MESSAGE_HEADERS="$( + echo "$MESSAGE_HEADERS" | \ + sed -e "s/^From:.*$/From: $LIST_ADDRESS/I" + )" + fi + # insert the Subject prefix, if any if [[ -n "$SUBJECT_PREFIX" ]]; then @@ -2328,6 +2351,9 @@ function SourceListConfig { [[ "$1" == "help" ]] && echo -e "\tREPLIES_SHOULD_GO_TO_LIST= set to '1' to add a Reply-To header containing the list address." || \ REPLIES_SHOULD_GO_TO_LIST="$(EvalConfigParameter $LIST_CONFIG_FILE REPLIES_SHOULD_GO_TO_LIST)" + [[ "$1" == "help" ]] && echo -e "\tHIDE_SENDER= set to '1' to add replace the sender address with list address on list messages." || \ + HIDE_SENDER="$(EvalConfigParameter $LIST_CONFIG_FILE HIDE_SENDER)" + [[ "$1" == "help" ]] && echo -e "\tSILENTLY_DISCARD_INVALID_MESSAGES= set to '1' to silently discard invalid \t messages (message not signed/encrypted, \t sender not subscribed to the list, etc.) -- cgit v1.2.3