Hello,
I'm trying to modify functions for registering mail as spam/ham with
Spamassassin posted in the list some time ago, to work with Bogofilter spam
filter...
The code looks as follows:
;; handling spam with Bogofilter
(defun mark-message-as (type)
(let* ((path (mu4e-message-field-at-point :path))
(command (format "/usr/bin/bogofilter %s < %s" type path)))
(shell-command command)))
(defun mark-message-as-spam ()
(interactive)
(mark-message-as "-s")
(mu4e~proc-move (mu4e-message-field-at-point :message-id) "../spam"))
(defun mark-message-as-ham ()
(interactive)
(mark-message-as "-n")
(mu4e~proc-move (mu4e-messsage-field-at-point :message-id) "../inbox"))
(add-to-list 'mu4e-headers-actions
'("Mark as spam" . mark-message-as-spam) t)
The first problem which I encounter is that when I invoke
mark-message-as-spam, I can confirm that the Bogofilter's wordlist.db is
updated, but at the end I get:
mu4e-error: [mu4e] Target dir does not exist
and in Messages buffer I also see the line:
(Shell command succeeded with no output)
My setup looks as follows:
(setq mu4e-maildir "~/Maildir")
and the multiple accounts are setup as:
(defvar my-mu4e-account-alist
'(("gour"
(msmtp-account "gour")
(mu4e-sent-folder "/gour/sent")
(mu4e-drafts-folder "/gour/drafts")
(mu4e-trash-folder "/gour/trash")
(mu4e-refile-folder "/archive")
(user-mail-address "
go...@atmarama.net")
(user-full-name "Gour")
(mu4e-compose-signature-auto-include t)
(message-cite-reply-position above)
(message-cite-style message-cite-style-outlook))
...
))
There is e.g. ~/Maildir/gour/spam folder, so I do not have clue why there is
error saying the 'Target dir does not exist' ?
Another problem is that despite having "Mark as spam" action added as header
actions (it's according to the
http://www.djcbsoftware.nl/code/mu/mu4e/Adding-an-action-in-the-headers-view.html
doc), still it's not listed in the Headers menu withing mu4e?
Any help is welcome...
Sincerely,
Gour
--
In this endeavor there is no loss or diminution,
and a little advancement on this path can protect
one from the most dangerous type of fear.