It's possible that the user has instructed message-mode to use some
other separator. If so, then that's what we should look for when
looking for the signature.
Thanks to David Edmondson <dme@dme.org> for pointing this out.
;; insert the message body - but put it in front of the signature
;; if one is present
(goto-char (point-max))
- (if (re-search-backward "-- " nil t)
+ (if (re-search-backward message-signature-separator nil t)
(forward-line -1)
(goto-char (point-max)))
(insert body))