[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fcc ignored when using sendmail-send-it (with msmtp)



Hi,
I use wanderlust in conjunction with msmtp. For this I set the variable wl-draft-send-mail-function to sendmail-send-it:

(setq 
    wl-draft-send-mail-function 'sendmail-send-it
    sendmail-program "/usr/bin/msmtp"
    message-sendmail-envelope-from 'header)

I noticed that the fcc-header was completely ignored with this
setup. Digging in the code, I found that wanderlust required log
entries of sent messages to be stored in the global variable
wl-sent-message-via. This of course is not done by
sendmail-send-it.

I wrote a little wrapper function to address this problem:

(defun wl-draft-send-mail-with-sendmail ()
    "Send the prepared message buffer with `sendmail-send-it'.
     The function `sendmail-send-it' uses the external program
    `sendmail-program'."
    (let ((id (std11-field-body "message-id"))
          (to (std11-field-body "to")))
      (require 'sendmail)
      (condition-case err
          (sendmail-send-it)
        (error 
         (wl-draft-write-sendlog 'failed 'sendmail nil (list to) id)
         (signal (car err) (cdr err))))
      (wl-draft-set-sent-message 'mail 'sent)
      (wl-draft-write-sendlog 'ok 'sendmail nil (list to) id)))

I have no expirience in programming lisp, but it works for me. Perhaps
it is useful for other people on this list, too.

Greetings,
Michael

PS: I already tried to send this message twice, but it never reached
the list (or at least it looked like this for me). I hope this time it
works. And I also hope I didnt annoy anybody because of sending this
mail so often.