Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] filter question
@ 2008-02-23 21:34 Guillaume Quintard
  2008-02-24 22:58 ` William Morgan
  0 siblings, 1 reply; 8+ messages in thread
From: Guillaume Quintard @ 2008-02-23 21:34 UTC (permalink / raw)


w00t, I finally switched to sup (and this is my first mail to the list using it).
I still have a little problem about filters though. they don't seem to do anything. I have this in my before-add-message.rb :

message.add_label "sent" if message.from =~ /guillaume.quintard at gmail.com/

but, when I send mail to myself, it doesn't label the mail.
I know that it reads the hook (tried some say + sleep calls), but for a reason I don't understand it does nothing.

and yes, this time, I read the FAQ before ;-)

-- 
Guillaume


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

* [sup-talk] filter question
  2008-02-23 21:34 [sup-talk] filter question Guillaume Quintard
@ 2008-02-24 22:58 ` William Morgan
  2008-02-25  0:12   ` Guillaume Quintard
  0 siblings, 1 reply; 8+ messages in thread
From: William Morgan @ 2008-02-24 22:58 UTC (permalink / raw)


Reformatted excerpts from Guillaume Quintard's message of 2008-02-23:
> I still have a little problem about filters though. they don't seem to
> do anything. I have this in my before-add-message.rb :
> 
> message.add_label "sent" if message.from =~ /guillaume.quintard at gmail.com/
> 
> but, when I send mail to myself, it doesn't label the mail.

Yep, there was a bug where the before-add-message hook wasn't being
called on sent messages. I've fixed this in git next. Update and try
now.

But you shouldn't have to write that hook, because the sent label is
applied to all sent messages anyways!

(Also, you'd need to use message.from.email because message.from is a
Person object).

-- 
William <wmorgan-sup at masanjin.net>


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

* [sup-talk] filter question
  2008-02-24 22:58 ` William Morgan
@ 2008-02-25  0:12   ` Guillaume Quintard
  2008-02-25  5:13     ` William Morgan
  0 siblings, 1 reply; 8+ messages in thread
From: Guillaume Quintard @ 2008-02-25  0:12 UTC (permalink / raw)


Excerpts from William Morgan's message of Sun Feb 24 14:58:00 -0800 2008:
> But you shouldn't have to write that hook, because the sent label is
> applied to all sent messages anyways!
>
actually, the idea was to label mail sent by me from gmail.

> (Also, you'd need to use message.from.email because message.from is a
> Person object).

message.add_label "test" if message.from.email =~ /guillaume.quintard at gmail.com/
doesn't seem to do a thing either :-(

-- 
Guillaume


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

* [sup-talk] filter question
  2008-02-25  0:12   ` Guillaume Quintard
@ 2008-02-25  5:13     ` William Morgan
  2008-02-25  6:28       ` shivan
  0 siblings, 1 reply; 8+ messages in thread
From: William Morgan @ 2008-02-25  5:13 UTC (permalink / raw)


Reformatted excerpts from guillaume.quintard's message of 2008-02-24:
> message.add_label "test" if message.from.email =~ /guillaume.quintard at gmail.com/
> doesn't seem to do a thing either :-(

That should work. What if you add some logging information, like:

  log "called"
  log "email is #{message.from.email.inspect}"
  match = message.from.email =~ /guillaume\.quintard at gmail\.com/
  log "match is #{match.inspect}"
  message.add_label :test if match
  log "message labels now #{message.labels.inspect}"


-- 
William <wmorgan-sup at masanjin.net>


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

* [sup-talk] filter question
  2008-02-25  5:13     ` William Morgan
@ 2008-02-25  6:28       ` shivan
  2008-02-25 17:02         ` William Morgan
  0 siblings, 1 reply; 8+ messages in thread
From: shivan @ 2008-02-25  6:28 UTC (permalink / raw)


ok, I got it, this line was causing problem :
message.add_label "server" if message.from.email =~ /@server.com/

replacing @ with \@ did the trick

thanks !

PS : in fact, I'd have another questio : is there an way to switch the "from" field, like it is done in gmail ? I entered two additionnal email addresses with sup-config but found no option to use them.
anyway, kudos to you people, sup is really great !

-- 
Guillaume


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

* [sup-talk] filter question
  2008-02-25  6:28       ` shivan
@ 2008-02-25 17:02         ` William Morgan
  2008-02-25 17:42           ` Guillaume Quintard
  0 siblings, 1 reply; 8+ messages in thread
From: William Morgan @ 2008-02-25 17:02 UTC (permalink / raw)


Reformatted excerpts from kingshivan's message of 2008-02-24:
> ok, I got it, this line was causing problem :
> message.add_label "server" if message.from.email =~ /@server.com/
> 
> replacing @ with \@ did the trick

Weird. That shouldn't make a difference. @ doesn't require escaping in
regexes. E.g.:

  $ irb
  irb(main):001:0> "bob at server.com" =~ /@server.com/
  => 3
  irb(main):002:0> "bob at server.com" =~ /\@server.com/
  => 3

Well, if it works, it works.

> PS : in fact, I'd have another questio : is there an way to switch the
> "from" field, like it is done in gmail ? I entered two additionnal
> email addresses with sup-config but found no option to use them.

There's no way in the GUI, at least currently. I would like to have a
way, but I'm not sure what the interface would look like.

You have two options: you can overwrite the From: line in the editor
when you compose an email, or you can use the before-edit hook to
programmatically set the From address based on the to address, etc.

-- 
William <wmorgan-sup at masanjin.net>


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

* [sup-talk] filter question
  2008-02-25 17:02         ` William Morgan
@ 2008-02-25 17:42           ` Guillaume Quintard
  2008-02-28 17:43             ` William Morgan
  0 siblings, 1 reply; 8+ messages in thread
From: Guillaume Quintard @ 2008-02-25 17:42 UTC (permalink / raw)


Excerpts from William Morgan's message of Mon Feb 25 09:02:19 -0800 2008:
> There's no way in the GUI, at least currently. I would like to have a
> way, but I'm not sure what the interface would look like.

why not using the same bar as for encryption, and reply-to choices ?

-- 
Guillaume


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

* [sup-talk] filter question
  2008-02-25 17:42           ` Guillaume Quintard
@ 2008-02-28 17:43             ` William Morgan
  0 siblings, 0 replies; 8+ messages in thread
From: William Morgan @ 2008-02-28 17:43 UTC (permalink / raw)


Reformatted excerpts from Guillaume Quintard's message of 2008-02-25:
> Excerpts from William Morgan's message of Mon Feb 25 09:02:19 -0800 2008:
> > There's no way in the GUI, at least currently. I would like to have
> > a way, but I'm not sure what the interface would look like.
> 
> why not using the same bar as for encryption, and reply-to choices ?

Well, the user might have 20 different accounts... horizontal scrolling
just isn't going to cut it. Now that I've thought about it, the right
interface is probably to have a keystroke in edit-message-mode that
brings up a modal buffer with a list of all your account default email
addresses and allows you to select one. Then we can leverage Sup's
existing "vertical scrolling technology".

Patches welcome. :)

-- 
William <wmorgan-sup at masanjin.net>


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

end of thread, other threads:[~2008-02-28 17:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-23 21:34 [sup-talk] filter question Guillaume Quintard
2008-02-24 22:58 ` William Morgan
2008-02-25  0:12   ` Guillaume Quintard
2008-02-25  5:13     ` William Morgan
2008-02-25  6:28       ` shivan
2008-02-25 17:02         ` William Morgan
2008-02-25 17:42           ` Guillaume Quintard
2008-02-28 17:43             ` William Morgan

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