Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Filters doesn't work
@ 2011-11-18 20:32 Alfredo Palhares
  2011-11-18 21:21 ` Mark Alexander
  0 siblings, 1 reply; 2+ messages in thread
From: Alfredo Palhares @ 2011-11-18 20:32 UTC (permalink / raw)
  To: sup-talk

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

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 ?
As attachement i send the script.

	[1] http://sup.rubyforge.org/wiki/wiki.pl?AutoAddLabelsToNewMessages


----
Regards,
Alfredo Palhares

[-- Attachment #2: before-add-message.rb --]
[-- Type: application/x-ruby, Size: 529 bytes --]

[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [sup-talk] Filters doesn't work
  2011-11-18 20:32 [sup-talk] Filters doesn't work Alfredo Palhares
@ 2011-11-18 21:21 ` Mark Alexander
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Alexander @ 2011-11-18 21:21 UTC (permalink / raw)
  To: Alfredo Palhares; +Cc: sup-talk

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-18 22:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-18 20:32 [sup-talk] Filters doesn't work Alfredo Palhares
2011-11-18 21:21 ` Mark Alexander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox