From d2472e04d4bc46bcf131846661b509a753148309 Mon Sep 17 00:00:00 2001 From: luis Date: Thu, 1 Feb 2007 15:13:18 +0000 Subject: firma: REQUIRE_SIGNATURE e REPLAY_PROTECTION are now set/unset using 1/0, no longer yes/no README, GUIDELINES: Small fixes --- firma | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'firma') diff --git a/firma b/firma index 9f2705d..427eebd 100755 --- a/firma +++ b/firma @@ -188,17 +188,17 @@ WARNING: $LIST_NAME: Removing this address from LIST_ADMIN." done LIST_ADMIN="$valid_admins" - if [[ "$REQUIRE_SIGNATURE" != "yes" && "$REQUIRE_SIGNATURE" != "no" ]]; then - REQUIRE_SIGNATURE="yes" + if [[ "$REQUIRE_SIGNATURE" != "0" ]]; then + REQUIRE_SIGNATURE="1" fi if [[ -z "$LIST_REQUEST_ADDRESS" ]]; then LIST_REQUEST_ADDRESS="$(echo $LIST_ADDRESS | cut -d @ -f 1)-request@$(echo $LIST_ADDRESS | cut -d @ -f 2)" fi - if [[ "$REPLAY_PROTECTION" == "yes" ]]; then + if [[ "$REPLAY_PROTECTION" == "1" ]]; then if [[ -z "$REPLAY_COUNT" ]]; then - REPLAY_COUNT="10" + REPLAY_COUNT="150" fi if [[ -z "$REPLAY_FILE" ]]; then REPLAY_FILE="$REPLAY_DEFAULT_FILE" @@ -749,7 +749,7 @@ function ProcessMessage { # else, if the message was correctly encrypted but its signature is invalid, #+send a warning about this to the list administrator(s) and to sender - elif [[ "$ENCRYPTED_TO_LIST" == "1" && "$BAD_SIGNATURE" == "1" && "$REQUIRE_SIGNATURE" == "yes" ]]; then + elif [[ "$ENCRYPTED_TO_LIST" == "1" && "$BAD_SIGNATURE" == "1" && "$REQUIRE_SIGNATURE" == "1" ]]; then GetSenderAddress @@ -761,17 +761,17 @@ function ProcessMessage { else # if bounce processing is enabled, continue - if [[ "$SILENTLY_DISCARD_INVALID_MESSAGES" != 1 ]]; then + if [[ "$SILENTLY_DISCARD_INVALID_MESSAGES" != "1" ]]; then GetSenderAddress if [[ -n "$SENDER_ADDRESS" ]]; then # if the message was encrypted with the list's public key - if [[ $ENCRYPTED_TO_LIST == 1 ]]; then + if [[ $ENCRYPTED_TO_LIST == "1" ]]; then # then, if signature can't be checked, then probably the sender is not subscribed to the list # send a bounce, if possible - if [[ "$SIGNATURE_CHECKING_FAILED" == "1" && "$REQUIRE_SIGNATURE" == "yes" ]]; then + if [[ "$SIGNATURE_CHECKING_FAILED" == "1" && "$REQUIRE_SIGNATURE" == "1" ]]; then # this is the body of the message to be sent, so no indentation here MESSAGE_BODY="\ @@ -782,7 +782,7 @@ function ProcessMessage { # or, if message can be decrypted but its signature can't be checked, then message wasn't signed # send a bounce, if possible - elif [[ $MESSAGE_DECRYPTION_OKAY == 1 ]]; then + elif [[ $MESSAGE_DECRYPTION_OKAY == "1" ]]; then # this is the body of the message to be sent, so no indentation here MESSAGE_BODY="\ @@ -791,7 +791,7 @@ function ProcessMessage { questions." ComposeAndSendBounceMessage - elif [[ "$SIGNATURE_MADE_BY_SENDER" != "1" && "$REQUIRE_SIGNATURE" == "yes" ]]; then + elif [[ "$SIGNATURE_MADE_BY_SENDER" != "1" && "$REQUIRE_SIGNATURE" == "1" ]]; then # this is the body of the message to be sent, so no indentation here MESSAGE_BODY="\ @@ -1846,7 +1846,7 @@ function AllowMessageProcessing { local -i return_code=0 if [[ "$MODE" == "admin-non-interactive" ]]; then - REQUIRE_SIGNATURE="yes" + REQUIRE_SIGNATURE="1" fi if [[ "$ENCRYPTED_TO_LIST" == "1" ]]; then @@ -2099,8 +2099,8 @@ function SourceListConfig { keyserver="$(EvalConfigParameter $LIST_CONFIG_FILE KEYSERVER)" [[ -n "$keyserver" ]] && KEYSERVER="$keyserver" - [[ "$1" == "help" ]] && echo -e "\tREQUIRE_SIGNATURE= wheter messages sent to the list should be (yes) or dont -\t need to be signed to be processed (no); defaults to yes; + [[ "$1" == "help" ]] && echo -e "\tREQUIRE_SIGNATURE= whether messages sent to the list should be (1) or dont +\t need to be (0) signed to be processed; defaults to '1'; \t this doesnt affect the way email administration works, \t when signature is mandatory." || \ REQUIRE_SIGNATURE="$(EvalConfigParameter $LIST_CONFIG_FILE REQUIRE_SIGNATURE)" @@ -2115,7 +2115,7 @@ function SourceListConfig { \t all randomizing its delivery." || \ DELIVERY_RANDOMIZATION="$(EvalConfigParameter $LIST_CONFIG_FILE DELIVERY_RANDOMIZATION)" - [[ "$1" == "help" ]] && echo -e "\tREPLAY_PROTECTION= when set to \"yes\", stores sha1sums + [[ "$1" == "help" ]] && echo -e "\tREPLAY_PROTECTION= when set to '1', stores sha1sums \t of the last REPLAY_COUNT received messages; then, \t if some message with an already stored sha1sum, then \t its bounced back to the sender and considered as an attempt @@ -2123,12 +2123,12 @@ function SourceListConfig { REPLAY_PROTECTION="$(EvalConfigParameter $LIST_CONFIG_FILE REPLAY_PROTECTION)" [[ "$1" == "help" ]] && echo -e "\tREPLAY_COUNT= number of messages to store sha1sums; -\t defaults to 10 and only used when -\t REPLAY_PROTECTION is set to \"yes\"." || \ +\t defaults to 150 and only used when +\t REPLAY_PROTECTION is set to '1'." || \ REPLAY_COUNT="$(EvalConfigParameter $LIST_CONFIG_FILE REPLAY_COUNT)" [[ "$1" == "help" ]] && echo -e "\tREPLAY_FILE= file to store sha1sums of messages; -\t only used when REPLAY_PROTECTION is set to \"yes\"; +\t only used when REPLAY_PROTECTION is set to '1'; \t defaults to $REPLAY_DEFAULT_FILE." || \ REPLAY_FILE="$(EvalConfigParameter $LIST_CONFIG_FILE REPLAY_FILE)" } @@ -2200,7 +2200,7 @@ function ReplayProtectionFlush { # returns: 0 #------------------------------------------------------------- - if [[ "$REPLAY_PROTECTION" == "yes" ]]; then + if [[ "$REPLAY_PROTECTION" == "1" ]]; then if [[ -f "$REPLAY_FILE" ]]; then if [[ "$(wc -l $REPLAY_FILE | cut -d " " -f 1)" -gt "$REPLAY_COUNT" ]]; then sed -i -e '1d' $REPLAY_FILE @@ -2229,7 +2229,7 @@ function ReplayProtectionCheck { local sha1 - if [[ "$REPLAY_PROTECTION" == "yes" ]]; then + if [[ "$REPLAY_PROTECTION" == "1" ]]; then ReplayProtectionFlush sha1="$(echo $GPG_MESSAGE | sha1sum | cut -d " " -f 1)" if grep -q "^$sha1$" $REPLAY_FILE; then -- cgit v1.2.3