From: Tero Tilus <tero@tilus.net>
To: Sup users <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] New User Hooks Details
Date: Fri, 04 Feb 2011 01:01:39 +0200 [thread overview]
Message-ID: <1296771606-sup-3188@tilus.net> (raw)
In-Reply-To: <1296746458-sup-2021@plc.intranet.plecavalier.com>
Philippe LeCavalier, 2011-02-03 17:58:
> One bit of info that seems odd to me is when I issue 'sup -l' the
> hooks listed are nowhere to be found in the hooks folder yet they
> appear to be working. Is that normal?
The `sup -l` lists all the hooks sup looks for upon start. If a hook
file exists, sup loads it and calls the ruby code in the file the way
documented in `sup -l`.
> # Mark Lists <lists>
> addressfile = File.open("/home/plecavalier/.sup/hooks/label.lists","r")
> if ! addressfile.grep(/#{message.list_address}/).empty?
> message.add_label :lists
> end
Looks sound on the surface. This is your
~/.sup/hooks/before-add-message.rb? New mails coming from
mailinglists listed in label.lists don't get lists-tag? You could add
some logging and see whats going on.
debug "before-add-message"
File.open("/home/plecavalier/.sup/hooks/label.lists") do |addressfile|
unless addressfile.grep(/#{message.list_address}/).empty?
debug "list message #{message.id.inspect}"
message.add_label :lists
else
debug "non-list message #{message.id.inspect}"
end
end
Then
$ SUP_LOG_LEVEL=debug sup
and wait for incoming mail or temporarily use another SUP_BASE (than
$HOME/.sup) with a sources.yaml pointing to a test corpus of mails.
Debug output goes to log buffer.
--
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
next prev parent reply other threads:[~2011-02-04 0:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-03 15:58 Philippe LeCavalier
2011-02-03 23:01 ` Tero Tilus [this message]
2011-02-03 23:48 ` Hamish D
2011-02-04 1:28 ` Antono Vasiljev
2011-02-05 2:15 ` Philippe LeCavalier
2011-02-05 2:54 ` Blake Sweeney
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=1296771606-sup-3188@tilus.net \
--to=tero@tilus.net \
--cc=sup-talk@rubyforge.org \
/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