Chris Hall <[email protected]> ha escrit:
> No, the intent is to move it from inbox to folder.
Aha, then something along these lines should do:
(use-modules (mailutils mailutils))
(let ((source-mbox (mu-mailbox-open "mbox:///home/gray/test-mbox/source" "rw"))
; Open dest mailbox. The "c" flags creates it if it does not exist.
(dest-mbox (mu-mailbox-open "mbox:///home/gray/test-mbox/dest" "cwr")))
; Get the first message
(let ((msg (mu-mailbox-get-message source-mbox 1)))
; Append it to the destination mailbox.
(mu-mailbox-append-message dest-mbox msg)
; Get back the appended message and modify its header.
; Note the call to mu-mailbox-messages-count: apart from its
; mail purpose it also flushes the message cache, which is essential
; in this case.
(let ((msg (mu-mailbox-get-message dest-mbox
(mu-mailbox-messages-count dest-mbox))))
(mu-message-set-header msg "X-Filed-By" "Guile" #t)))
; That's a bit of kludge: Guile API misses mu-mailbox-flush
; function. I'll add it ASAP. Meanwhile use this:
(mu-mailbox-expunge dest-mbox)
; Close both mailboxes.
(mu-mailbox-close dest-mbox)
(mu-mailbox-close source-mbox))
Regards,
Sergey
_______________________________________________
Bug-mailutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-mailutils