Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: Mark Alexander <marka@pobox.com>
To: Alfredo Palhares <masterkorp@masterkorp.net>
Cc: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] Filters doesn't work
Date: Fri, 18 Nov 2011 16:21:41 -0500	[thread overview]
Message-ID: <1321650946-sup-2613@bloovis.org> (raw)
In-Reply-To: <1321648096-sup-3340@masterkorp.net>

Excerpts from Alfredo Palhares's message of Fri Nov 18 15:32:20 -0500 2011:

> Hello, i made a hook that adds labels, as referenced in the wiki[1]
> i created a before-add-message.rb into ~/.sip/hooks. it don't get
> anything in the logs, can anyone help me ? 

Are you sure the file is in ~/.sup/hooks, not ~/.sip/hooks?

> As attachement i send the script.

The script looks OK to me, except for this line:

  message.add_label = "texhax"

Try removing the '=' character.  It might be causing a syntax
error that prevents your script from loading.

Just as a reference, here is my ~/.sup/hooks/before-add-message.rb,
somewhat sanitized:

# Label by subject.  This is useful for messages
# generated automatically by Bugzilla or cron jobs.
case message.subj
when /\[FDBuilders/
  message.add_label :fd
when /\[P4 SUBMIT/
  message.add_label :p4
when /\[Bug/
  message.add_label :bugs
end

# Label by recipients.  This is useful for mailing lists.
to_string = message.recipients.map { |t| t.email }.join(" ")
case to_string
# Personal labels
when /\bsup-(devel|talk)@rubyforge.org\b/
  message.add_label :sup
# WIDGET labels
when /pi@widget/
  message.add_label :pi
when /tipsandtricks/
  message.add_label :tips
when /git-users/
  message.add_label :git
when /monitor-list/
  message.add_label :mon
when /acpi-dudes/
  message.add_label :acpi
end

# Label from from.  This is useful for personal emails.
case message.from.email
when /@amazon/
  message.add_label :amazon
when /@facebook/
  message.add_label :facebook
when /@netflix/
  message.add_label :netflix
end
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


      reply	other threads:[~2011-11-18 22:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 20:32 Alfredo Palhares
2011-11-18 21:21 ` Mark Alexander [this message]

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=1321650946-sup-2613@bloovis.org \
    --to=marka@pobox.com \
    --cc=masterkorp@masterkorp.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