You can use hooks to add labels:

my "~/.sup/hooks/before-add-message.rb":

  def matchR(email)
    not message.recipients.find{ |to|  /^#{email}$/i =~ to.email}.nil?
  end

  def matchRAddLabel(email, label, inbox = 0)
    if matchR email then
      message.add_label label 
      message.remove_label :inbox unless inbox
    end
  end

  def importantFrom(email)
    message.add_label :Starred if message.from.email == email
  end

  importantFrom "[email protected]"


  matchRAddLabel("[email protected]","mod-python", 1)
  matchRAddLabel("[email protected]","mod-python", 0)

  if message.subj =~ /^Project Notification$/ && message.from.email == 
"[email protected]" then
    message.add_label "GURU_PROJECT_NOTIFICATION"
    message.add_label "delete_after_one_month"
  end

  if message.subj =~ /^WEBKOS_/ then
    message.remove_label :inbox
    message.add_label "WEBKOS_"
  end


So adding labels onle if a contsraint is met is easy.
About deleting mails: There is sup-sync-back. So there must be a way to delete
"old" / whatever mails. I haven't used it yet.

I'm new to sup myself.

Yours
Marc Weber
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk

Reply via email to