]> gitweb.fluxo.info Git - firma.git/commitdiff
Introducing HIDE_SENDER
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 5 Sep 2013 16:01:02 +0000 (13:01 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 5 Sep 2013 16:01:02 +0000 (13:01 -0300)
firma

diff --git a/firma b/firma
index f4697b4a0be5747579aec09a53c8155339f29317..3e70e9888b96c15e8c061000877c1c51a6e0dbc9 100755 (executable)
--- 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.)