summaryrefslogtreecommitdiff
path: root/sendmailadvanced
blob: 64a01526f5de7534e1fcb4d2c70ec1f1b288850f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

(
  . /etc/sendmailadvanced.conf

  tos=""
  while read s
  do
    echo "${s}"
    if [ "${s:0:3}" == "To:" ] || [ "${s:0:3}" == "Cc:" ]
    then
      tos="${tos} ${s:4}"
    fi
    if [ "${s:0:8}" == "Subject:" ]
    then
      break
    fi
  done
  hashcash -b ${hashcash_bits} -Xm ${tos}
  while read s
  do
    echo "${s}"
    if [ "${s}" == "" ]
    then
      break
    fi
  done
  (
    body_header_hook $@
    cat
    body_footer_hook $@
  ) | gpg -e -a -s -r ${gpg_recipient}
) | /usr/sbin/sendmail -t