man: Update conf file reading
[smailq.git] / sendmail
1 #!/bin/bash
2
3 # Copyright (c) 2013 Stefan Huber <shuber@sthu.org>
4
5 set -e
6
7 CMD="$(dirname $0)/smailq"
8 options=
9 list="0"
10
11 usage() {
12 cat << EOF
13 A wrapper script for smailq that behaves like sendmail.
14
15 USAGE:
16 $0 [OPTIONS] [recipient ...]
17 $0 --help
18
19 It simply calls '$CMD --send -- [OPTIONS] [recipient ...]'. In
20 particular, it passes all options as MSA options to smailq.
21 EOF
22 }
23
24
25 options=()
26 while [ $# -gt "0" ]; do
27 if [ "$1" == "-bp" ]; then
28 list="1"
29 else
30 options+=("$1")
31 fi
32 shift
33 done
34
35 if [ "$list" = "1" ]; then
36 smailq --list
37 else
38 smailq --send -- "${options[@]}"
39 fi
40