git » chasquid » commit b6248f3

hooks: Fix output of command -v dkimsign added to message

author Thor77
2020-06-01 11:09:33 UTC
committer Alberto Bertogli
2020-06-01 13:18:11 UTC
parent d781b3f403ac1c1d2d1028a39aafb6a51749134b

hooks: Fix output of command -v dkimsign added to message

When checking if the dkimsign command exists, the default hook doesn't
redirect the output to /dev/null, so if the command is present it will
emit unwanted output (interpreted as message headers, as expected).

This patch adds the missing redirection.

Amended-by: Alberto Bertogli <albertito@blitiri.com.ar>
  Extended commit message.

etc/chasquid/hooks/post-data +1 -1

diff --git a/etc/chasquid/hooks/post-data b/etc/chasquid/hooks/post-data
index ae24315..87fa507 100755
--- a/etc/chasquid/hooks/post-data
+++ b/etc/chasquid/hooks/post-data
@@ -80,7 +80,7 @@ fi
 #  - certs/$DOMAIN/dkim_privkey.pem file exists.
 #
 # Note this has not been thoroughly tested, so might need further adjustments.
-if [ "$AUTH_AS" != "" ] && command -v dkimsign; then
+if [ "$AUTH_AS" != "" ] && command -v dkimsign >/dev/null; then
 	DOMAIN=$( echo "$MAIL_FROM" | cut -d '@' -f 2 )
 	if [ -f "domains/$DOMAIN/dkim_selector" ] \
 			&& [ -f "certs/$DOMAIN/dkim_privkey.pem" ]; then