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

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



At Thu, 30 Jun 2011 22:03:45 +0200,
Michael Lex wrote:
>
> 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.

Nice, thanks. I'll check it this weekend and see if we could
incorporate it into CVS trunk.

Best,
  -- David

--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

Attachment: pgpD6tsAKtUL4.pgp
Description: PGP signature