summaryrefslogtreecommitdiff
path: root/sendmailadvanced.in
diff options
context:
space:
mode:
Diffstat (limited to 'sendmailadvanced.in')
-rwxr-xr-xsendmailadvanced.in16
1 files changed, 12 insertions, 4 deletions
diff --git a/sendmailadvanced.in b/sendmailadvanced.in
index 5904f46..5e5a58e 100755
--- a/sendmailadvanced.in
+++ b/sendmailadvanced.in
@@ -4,7 +4,7 @@ verwendung() {
>&2 echo 'sendmailadvanced encrypts emails and generates stamps either in situ or in a pipe. For that it uses hashcash and gnupg.'
>&2 echo ''
>&2 echo 'Usage: sendmailadvanced [OPTIONS]'
- >&2 echo ' -h,--hook=hook activate hook'
+ >&2 echo ' -h,--hook=hook activate hook; "ALL" chooses all available hooks'
>&2 echo ' -i,--inline=file enhance email file in situ.'
>&2 echo ' "--inline -" has the same effect as "-t".'
>&2 echo ' Conflicts with -t|--no-inline.'
@@ -108,7 +108,15 @@ while true; do
case "$1" in
-h|--hook)
shift
- hooks[${#hooks[@]}]="$1"
+ if [ "x$1" = 'xALL' ]; then
+ for hook in $(find '#ETCDIR#/sendmailadvanced.hooks' -type f); do
+ if [ -x "#ETCDIR#/sendmailadvanced.hooks/${hook}" ]; then
+ hooks[${#hooks[@]}]="${hook}"
+ fi
+ done
+ else
+ hooks[${#hooks[@]}]="$1"
+ fi
;;
--help)
verwendung 0
@@ -219,11 +227,11 @@ fi
body=$(
(
for hookParam in "${hooks[@]}"; do
- body_header_hook "${hookParam}"
+ "#ETCDIR#/sendmailadvanced.hooks/${hookParam}" head
done
cat
for hookParam in "${hooks[@]}"; do
- body_footer_hook "${hookParam}"
+ "#ETCDIR#/sendmailadvanced.hooks/${hookParam}" foot
done
) | \
if ${encrypt}; then