From: Robert Winkler <robert.winkler.mail@gmail.com>
To: The Sup email client <supmua@googlegroups.com>
Subject: Re: [sup] SpamAssassin (Spam/Ham) support for Sup
Date: Thu, 9 Jul 2020 15:20:12 -0700 (PDT) [thread overview]
Message-ID: <ae938a95-fe8e-4dfb-a2e6-1ca302fe63d1o@googlegroups.com> (raw)
In-Reply-To: <1594233819-sup-5407@ceres>
[-- Attachment #1.1: Type: text/plain, Size: 2650 bytes --]
Hi Iain,
Yes, this is a good option. I modified my workflow a bit (Spam/Ham are not
watched by Sup anymore. The mails should be copied to the Spam/Ham IMAP
server for learning and are automatically deleted after 5 days).
Moving the mail from the | pipe in the thread view with
cat > ~/Maildir/SpamAssassin/Spam/cur/$(cat /proc/sys/kernel/random/uuid)
works; The mail is synced to the IMAP server with OfflineIMAP. However, how
can I pass the mail below the cursor directly to a pipe command?
The following code causes an error:
class Redwood::InboxMode
def label_spamassassin_spam
t = cursor_thread or return
t.apply_label :spam
t.remove_label :inbox
multi_toggle_new [t]
hide_thread t
pipe_to_process('cat > ~/Maildir/SpamAssassin/Spam/cur/$(cat
/proc/sys/kernel/random/uuid)')
regen_text
Index.save_thread t
flush_index
end
end
--- LocalJumpError from thread: main
no block given (yield)
/usr/local/sup/lib/sup/mode.rb:125:in `block in pipe_to_process'
/usr/lib/ruby/2.5.0/open3.rb:205:in `popen_run'
/usr/lib/ruby/2.5.0/open3.rb:95:in `popen3'
/usr/local/sup/lib/sup/mode.rb:107:in `pipe_to_process'
/home/rob/.sup/hooks/startup.rb:8:in `label_spamassassin_spam'
/usr/local/sup/lib/sup/mode.rb:59:in `handle_input'
/usr/local/sup/lib/sup/buffer.rb:222:in `handle_input'
/usr/local/sup/bin/sup:257:in `<module:Redwood>'
/usr/local/sup/bin/sup:76:in `<main>'
Best regards,
Robert
On Wednesday, 8 July 2020 13:53:23 UTC-5, Iain Parris wrote:
>
> Hi Robert,
>
> Excerpts from Robert Winkler's message of 2020-07-08 10:06:55 -0700:
> > Thanks, Good hint, Iain!
>
> Thank you!
>
> > I want to move the mails in a second step (yet to be resolved).
> >
> > Any hints on possible external programs/ scripts for moving mails with a
> > particular label to a special /Maildir folder (e.g.
> > ~/Maildir/SpamAssassin/Spam)?
>
> Question: do the mails need to be moved, or can they be copied?
>
> (Side note: Sup should de-duplicate copies of mails that appear in more
> than one source, i.e., should recognise that it is a duplicate of the
> same message, and not show it twice. Or for simplicity, don't tell Sup
> to index the SpamAssassin Maildirs!)
>
> If making a copy is sufficient, then you can write the email to a new
> file in the appropriate Maildir (since a Maildir is just a collection of
> files, with each file being one email). All you need is a random
> filename. For example, you could pipe to cat to create with a random
> filename (a UUID), using something like:
>
> cat >~/Maildir/SpamAssassin/Spam/$(cat /proc/sys/kernel/random/uuid)
>
> Kind regards,
> Iain
>
[-- Attachment #1.2: Type: text/html, Size: 13031 bytes --]
next prev parent reply other threads:[~2020-07-09 22:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-06 18:36 Robert Winkler
2020-07-06 23:27 ` [sup] " Iain Parris
2020-07-08 17:06 ` Robert Winkler
2020-07-08 18:53 ` Iain Parris
2020-07-09 22:20 ` Robert Winkler [this message]
2020-07-10 20:26 ` Iain Parris
2020-07-10 20:29 ` Iain Parris
2020-07-10 21:58 ` Robert Winkler
2020-07-11 13:48 ` Iain Parris
2020-07-24 10:38 ` Robert Winkler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ae938a95-fe8e-4dfb-a2e6-1ca302fe63d1o@googlegroups.com \
--to=robert.winkler.mail@gmail.com \
--cc=supmua@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox