Currently the --to/--cc/--bcc options add "user@example.com, " to the
message headers, with the the unnecessary ", " separator after the
last address, regardless of how many addresses are being added.
This used to be fine, but with recent emacs mm, trying to send the
email with the trailing commas leads to prompt:
Email address looks invalid; send anyway? (y or n)
Fix this by only adding the commas between addresses, avoiding the
trailing commas.
ELISP=
MAILTO=
HELLO=
+TO_SEP=
+CC_SEP=
+BCC_SEP=
# Short options compatible with mutt(1).
while getopts :s:c:b:i:h opt; do
ELISP="${ELISP} (message-goto-subject) (insert \"${OPTARG}\")"
;;
--to)
- ELISP="${ELISP} (message-goto-to) (insert \"${OPTARG}, \")"
+ ELISP="${ELISP} (message-goto-to) (insert \"${TO_SEP}${OPTARG}\")"
+ TO_SEP=", "
;;
--cc|c)
- ELISP="${ELISP} (message-goto-cc) (insert \"${OPTARG}, \")"
+ ELISP="${ELISP} (message-goto-cc) (insert \"${CC_SEP}${OPTARG}\")"
+ CC_SEP=", "
;;
--bcc|b)
- ELISP="${ELISP} (message-goto-bcc) (insert \"${OPTARG}, \")"
+ ELISP="${ELISP} (message-goto-bcc) (insert \"${BCC_SEP}${OPTARG}\")"
+ BCC_SEP=", "
;;
--body|i)
ELISP="${ELISP} (message-goto-body) (insert-file \"${OPTARG}\")"