From support@plecavalier.com Tue Feb 1 11:29:56 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Tue, 01 Feb 2011 11:29:56 -0500 Subject: [sup-talk] stripping label from msgs Message-ID: <1296577784-sup-6951@plc.intranet.plecavalier.com> Hi. I've only recently began using sup. As such, I've changed my mind on my labeling structure. Naturally, I thought I'll just open each label -there aren't that many yet-, tag all, apply to all, -label. But there must be something about '-label' I'm not understanding. I've tried -label:, just '-label' and a few other attempts at the syntax but nothing works. If I don't tag-all and just tag a single mail at a time I can delete/edit labels. But that's no solution -there may not be many labels but there's a ton of mail-. Also, why can't I use 'A' in the search mode? I like searching tagging and marking but I can only search, tag, mark read and then archive. Is that intentional? Lastly, and somewhat related to my above mentioned issue, how do I modify labels. The label list mode seems rather restricted. I'd like to do L and delete/edit the labels themselves. -- Thanks, Phil From michael+sup@stapelberg.de Tue Feb 1 12:26:15 2011 From: michael+sup@stapelberg.de (Michael Stapelberg) Date: Tue, 01 Feb 2011 18:26:15 +0100 Subject: [sup-talk] stripping label from msgs In-Reply-To: <1296577784-sup-6951@plc.intranet.plecavalier.com> References: <1296577784-sup-6951@plc.intranet.plecavalier.com> Message-ID: <1296581103-sup-6821@midna.zekjur.net> Hi Philippe, Excerpts from Philippe LeCavalier's message of 2011-02-01 17:29:56 +0100: > aren't that many yet-, tag all, apply to all, -label. But there must be > something about '-label' I'm not understanding. I've tried > -label:, just '-label' and a few other attempts at the syntax but Suppose you have labeled a mail 'sup'. To remove this label, use '-sup' In general, if you want to re-label a lot of mails, use sup-tweak-labels. > Lastly, and somewhat related to my above mentioned issue, how do I modify > labels. The label list mode seems rather restricted. I'd like to do L > and delete/edit the labels themselves. I don?t think you can. Again, use sup-tweak-labels to remove/add labels. Best regards, Michael From tero@tilus.net Tue Feb 1 12:31:59 2011 From: tero@tilus.net (Tero Tilus) Date: Tue, 01 Feb 2011 19:31:59 +0200 Subject: [sup-talk] stripping label from msgs In-Reply-To: <1296577784-sup-6951@plc.intranet.plecavalier.com> References: <1296577784-sup-6951@plc.intranet.plecavalier.com> Message-ID: <1296581380-sup-1179@tilus.net> Philippe LeCavalier, 2011-02-01 18:29: > I've only recently began using sup. As such, I've changed my mind on > my labeling structure. You probably want to make friends with sup-tweak-labels. And thats _after_ you have backed up label state dump. ;) sup-tweak-labels --help -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ From support@plecavalier.com Tue Feb 1 12:43:59 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Tue, 01 Feb 2011 12:43:59 -0500 Subject: [sup-talk] stripping label from msgs In-Reply-To: <1296581380-sup-1179@tilus.net> References: <1296577784-sup-6951@plc.intranet.plecavalier.com> <1296581380-sup-1179@tilus.net> Message-ID: <1296582225-sup-7780@plc.intranet.plecavalier.com> Excerpts from Tero Tilus's message of Tue Feb 01 12:31:59 -0500 2011: > Philippe LeCavalier, 2011-02-01 18:29: > > I've only recently began using sup. As such, I've changed my mind on > > my labeling structure. > > You probably want to make friends with sup-tweak-labels. And thats > _after_ you have backed up label state dump. ;) > > sup-tweak-labels --help > Perfect! -- Thanks, Phil From support@plecavalier.com Tue Feb 1 14:58:10 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Tue, 01 Feb 2011 14:58:10 -0500 Subject: [sup-talk] stripping label from msgs In-Reply-To: <1296581103-sup-6821@midna.zekjur.net> References: <1296577784-sup-6951@plc.intranet.plecavalier.com> <1296581103-sup-6821@midna.zekjur.net> Message-ID: <1296589333-sup-2413@plc.intranet.plecavalier.com> Excerpts from Michael Stapelberg's message of Tue Feb 01 12:26:15 -0500 2011: > Hi Philippe, > > Excerpts from Philippe LeCavalier's message of 2011-02-01 17:29:56 +0100: > > aren't that many yet-, tag all, apply to all, -label. But there must be > > something about '-label' I'm not understanding. I've tried > > -label:, just '-label' and a few other attempts at the syntax but > Suppose you have labeled a mail 'sup'. To remove this label, use '-sup' ah! Just about the only thing I didn't try...figures. > > In general, if you want to re-label a lot of mails, use sup-tweak-labels. > > > Lastly, and somewhat related to my above mentioned issue, how do I modify > > labels. The label list mode seems rather restricted. I'd like to do L > > and delete/edit the labels themselves. > I don?t think you can. Again, use sup-tweak-labels to remove/add labels. I had now idea this existed. We should plug that in the wiki somewhere. Or is it already and I didn't see it? > Best regards, > Michael -- Thanks, Phil From bogus@does.not.exist.com Tue Feb 1 15:18:11 2011 From: bogus@does.not.exist.com () Date: Tue, 01 Feb 2011 15:18:11 -0500 Subject: [sup-talk] stripping label from msgs In-Reply-To: <1296581103-sup-6821@midna.zekjur.net> References: <1296577784-sup-6951@plc.intranet.plecavalier.com> <1296581103-sup-6821@midna.zekjur.net> Message-ID: <1296591415-sup-1777@plc.intranet.plecavalier.com> Hi Michael. Excerpts from Michael Stapelberg's message of Tue Feb 01 12:26:15 -0500 2011: > Hi Philippe, > > Excerpts from Philippe LeCavalier's message of 2011-02-01 17:29:56 +0100: > > aren't that many yet-, tag all, apply to all, -label. But there must be > > something about '-label' I'm not understanding. I've tried > > -label:, just '-label' and a few other attempts at the syntax but > Suppose you have labeled a mail 'sup'. To remove this label, use '-sup' > > In general, if you want to re-label a lot of mails, use sup-tweak-labels. > > > Lastly, and somewhat related to my above mentioned issue, how do I modify > > labels. The label list mode seems rather restricted. I'd like to do L > > and delete/edit the labels themselves. > I don?t think you can. Again, use sup-tweak-labels to remove/add labels. Could you be so kind as to provide me with a working example of a query. I don't seem to "get it". :) > Best regards, > Michael From support@plecavalier.com Thu Feb 3 10:58:18 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Thu, 03 Feb 2011 10:58:18 -0500 Subject: [sup-talk] New User Hooks Details Message-ID: <1296746458-sup-2021@plc.intranet.plecavalier.com> I'm having a hard time using the hooks system. I'm trying to add the 'AutoAddLabelsToNewMessages'. I've followed the wiki and created '~/.sup/hooks/before-add-message.rb' with a few hooks but sup isn't calling them before polling. 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? ruby 1.8.7 (2010-08-16 patchlevel 302) [i486-linux] sup 0.12.1 sample hook: #Mark Lists addressfile = File.open("/home/plecavalier/.sup/hooks/label.lists","r") if ! addressfile.grep(/#{message.list_address}/).empty? message.add_label :lists end contents of ~/.sup.hooks/label.lists plecavalier at plc:~/.sup/hooks$ cat label.lists cups at easysw.com samba at lists.samba.org rsync at lists.samba.org offlineimap-project at lists.alioth.debian.org bind-users at lists.isc.org The only thing I can think of is possibly setting the execute bit but I wanted to checking here prior. -- Thanks, Phil From tero@tilus.net Thu Feb 3 18:01:39 2011 From: tero@tilus.net (Tero Tilus) Date: Fri, 04 Feb 2011 01:01:39 +0200 Subject: [sup-talk] New User Hooks Details In-Reply-To: <1296746458-sup-2021@plc.intranet.plecavalier.com> References: <1296746458-sup-2021@plc.intranet.plecavalier.com> Message-ID: <1296771606-sup-3188@tilus.net> 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 > 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/ From dmishd@gmail.com Thu Feb 3 18:48:56 2011 From: dmishd@gmail.com (Hamish D) Date: Thu, 3 Feb 2011 23:48:56 +0000 Subject: [sup-talk] New User Hooks Details In-Reply-To: <1296746458-sup-2021@plc.intranet.plecavalier.com> References: <1296746458-sup-2021@plc.intranet.plecavalier.com> Message-ID: > 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? sup -l will list the hooks you can use - it doesn't check what hooks you've actually created. > sample hook: > #Mark Lists > addressfile = File.open("/home/plecavalier/.sup/hooks/label.lists","r") > if ! addressfile.grep(/#{message.list_address}/).empty? > message.add_label :lists > end You can stick debug statements in - say: debug "list address is #{message.list_address.inspect}, type is #{message.list_address.class.to_s}" and then see it in the log (while using sup, press ";" and scroll down to the log buffer). I think that message.list_address is actually of class Person, so you would want to use message.list_address.email for your case. I've updated the wiki to correct that - I think I may have written the wrong information into the wiki to start with :/ so sorry for the mistake. Hamish From dmishd@gmail.com Thu Feb 3 18:52:41 2011 From: dmishd@gmail.com (Hamish D) Date: Thu, 3 Feb 2011 23:52:41 +0000 Subject: [sup-talk] issue after upgrading sup mainline In-Reply-To: References: Message-ID: The key line would be: > ./lib/sup/index.rb:17: Xapian version 1.2.1 or higher required gem upgrade should fix it. Hamish From dmishd@gmail.com Thu Feb 3 19:00:34 2011 From: dmishd@gmail.com (Hamish D) Date: Fri, 4 Feb 2011 00:00:34 +0000 Subject: [sup-talk] Custom cursor color In-Reply-To: <1295232827-sup-7356@ubook.local> References: <1295232827-sup-7356@ubook.local> Message-ID: > I trying to customize colors for sup and cannot find > any yaml key for cursor color (highlighted line moved by J/K). > Anyone can help me? Looking at lib/sup/colormap.rb it looks like you might want one of: :horizontal_selector_selected => { :fg => "yellow", :bg => "default", :attrs => ["bold"] }, :horizontal_selector_unselected => { :fg => "cyan", :bg => "default" }, Full list at http://gitorious.org/sup/mainline/blobs/next/lib/sup/colormap.rb#line28 Hamish Downer From self@antono.info Thu Feb 3 20:28:47 2011 From: self@antono.info (Antono Vasiljev) Date: Fri, 04 Feb 2011 03:28:47 +0200 Subject: [sup-talk] New User Hooks Details In-Reply-To: References: <1296746458-sup-2021@plc.intranet.plecavalier.com> Message-ID: <1296782927.5402.6.camel@localhost> On Thu, 2011-02-03 at 23:48 +0000, Hamish D wrote: > debug "list address is #{message.list_address.inspect}, type is > #{message.list_address.class.to_s}" > > and then see it in the log (while using sup, press ";" and scroll down > to the log buffer). > > I think that message.list_address is actually of class Person, so you > would want to use message.list_address.email for your case. I've > updated the wiki to correct that - I think I may have written the > wrong information into the wiki to start with :/ so sorry for the > mistake. Oh. Spent some hours debugging this issue. And list_address.to_s gives list address so it was kinda magic that list != list :) -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From support@plecavalier.com Fri Feb 4 21:15:58 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Fri, 04 Feb 2011 21:15:58 -0500 Subject: [sup-talk] New User Hooks Details In-Reply-To: References: <1296746458-sup-2021@plc.intranet.plecavalier.com> Message-ID: <1296871814-sup-3165@plc.intranet.plecavalier.com> Hi. Excerpts from Hamish D's message of Thu Feb 03 18:48:56 -0500 2011: > > 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? > > sup -l will list the hooks you can use - it doesn't check what hooks > you've actually created. > > > sample hook: > > #Mark Lists > > addressfile = File.open("/home/plecavalier/.sup/hooks/label.lists","r") > > if ! addressfile.grep(/#{message.list_address}/).empty? > > message.add_label :lists > > end > > You can stick debug statements in - say: > > debug "list address is #{message.list_address.inspect}, type is > #{message.list_address.class.to_s}" > > and then see it in the log (while using sup, press ";" and scroll down > to the log buffer). > > I think that message.list_address is actually of class Person, so you > would want to use message.list_address.email for your case. I've > updated the wiki to correct that - I think I may have written the > wrong information into the wiki to start with :/ so sorry for the > mistake. Thanks for this. And thanks to everyone else who posted suggestions. Suffice it to say, I would have never figured that out on my own. I'm also seeing allot more info now with debugs here there and everywhere and can work from that. One question came to mind while I was fixing my hooks...Does the email address have to be complete or can it be just the domain? (I'm referring to the email address list in the referenced file of course) -- Thanks, Phil From blakes.85@gmail.com Fri Feb 4 21:54:49 2011 From: blakes.85@gmail.com (Blake Sweeney) Date: Fri, 4 Feb 2011 21:54:49 -0500 Subject: [sup-talk] New User Hooks Details In-Reply-To: <1296871814-sup-3165@plc.intranet.plecavalier.com> References: <1296746458-sup-2021@plc.intranet.plecavalier.com> <1296871814-sup-3165@plc.intranet.plecavalier.com> Message-ID: On Fri, Feb 4, 2011 at 9:15 PM, Philippe LeCavalier wrote: > Hi. > > Excerpts from Hamish D's message of Thu Feb 03 18:48:56 -0500 2011: >> > 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? >> >> sup -l will list the hooks you can use - it doesn't check what hooks >> you've actually created. >> >> > sample hook: >> > #Mark Lists >> > addressfile = File.open("/home/plecavalier/.sup/hooks/label.lists","r") >> > if ! addressfile.grep(/#{message.list_address}/).empty? >> > message.add_label :lists >> > end >> >> You can stick debug statements in - say: >> >> debug "list address is #{message.list_address.inspect}, type is >> #{message.list_address.class.to_s}" >> >> and then see it in the log (while using sup, press ";" and scroll down >> to the log buffer). >> >> I think that message.list_address is actually of class Person, so you >> would want to use message.list_address.email for your case. I've >> updated the wiki to correct that - I think I may have written the >> wrong information into the wiki to start with :/ so sorry for the >> mistake. > Thanks for this. And thanks to everyone else who posted suggestions. Suffice it to say, I would have never figured that out on my own. > > I'm also seeing allot more info now with debugs here there and everywhere and can work from that. > > One question came to mind while I was fixing my hooks...Does the email address have to be complete or can it be just the domain? (I'm referring to the email address list in the referenced file of course) > > -- > Thanks, > Phil > _______________________________________________ > sup-talk mailing list > sup-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/sup-talk > I'm a bit biased but I think my gem sup_tag could help out. It makes tagging messages pretty easy. For example: tag do list_address /sup-talk/, :sup end tags all messages with sup-talk in the list address as sup. Checkout out: https://github.com/blakesweeney/sup_tag Blake From support@plecavalier.com Tue Feb 8 10:38:12 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Tue, 08 Feb 2011 10:38:12 -0500 Subject: [sup-talk] search and omit Message-ID: <1297179373-sup-7015@plc.intranet.plecavalier.com> Hi. How do I trim my search results in the refined-search mode? -- Thanks, Phil From john.wyzer@gmx.de Wed Feb 9 00:57:19 2011 From: john.wyzer@gmx.de (John Wyzer) Date: Wed, 09 Feb 2011 06:57:19 +0100 Subject: [sup-talk] message missing in source, sup v0.12.1, sup-sync no longer has --changed? Message-ID: <4D522CBF.4020203@gmx.de> Hi! I have my sent messages in a maildir and deleted one message. sup-sync used to have --changed to fix this in the index, but no longer has (the FAQ still says so). Sup only says that there was an error loading the message, but does not say how to fix the index. Is there a new method to do this? Thanks in advance and all the best, John From support@plecavalier.com Wed Feb 9 14:45:35 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Wed, 09 Feb 2011 14:45:35 -0500 Subject: [sup-talk] Loosing first line of body, intentional or bug? Message-ID: <1297277984-sup-9281@plc.intranet.plecavalier.com> If I forget to add an extra linebreak when top-posting the first line of my reply is brought back up into the headers(references) and therefore doesn't appear in the body. This is especially annoying if I reply with a one liner. -- Thanks, Phil From support@plecavalier.com Thu Feb 10 09:44:18 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Thu, 10 Feb 2011 09:44:18 -0500 Subject: [sup-talk] best method for before-add-message.rb Message-ID: <1297346751-sup-70@plc.intranet.plecavalier.com> Hi All. I'm still working on my initial labeling/hooks and best choices thereof. I'm torn between a few options. i)external file reference (would be my preferred method) -can't list anything other than full email addresses in the file @domain.com, wildcards...etc. would be nice -can't comment in the file. It would be nice to weed out comments -is it possible that when an address has a subdomain the example in the wiki breaks? ie list at list.domain.com none of my hooks for these types of addresses seem to work -is Sup caching the referenced file? if not, I presume this option significantly slows things down ii)not using an external file makes the hook file lengthy. However it seems to be the only safe way of adding multiple labels - which I feel crucial to making a strong searchable system. Perhaps a label(s)-markread-archive would be nice :) -using this method I find myself writing a ton of rules for the same thread. a)label the thread from a particular community/client/area b)label the thread from a particular person within said community/clientel/area c)label it something useful ie (not)important/archive/redirect/bounce(hehe)...etc. I'm assuming my difficulties spring from a few basic assumptions; I can't write any code let alone Ruby, if my life depended on it. The wiki has solid working examples for those who can work with Ruby. Again I don't speak Ruby. And mostly, I come form a world where things get filtered to folders :-( I'm really trying to keep an open mind and I know I'll get there but my inbox now has thousands of mails in it and I'm the type that kept a strict 0 count. In order for me to move to Sup I had to get *real* disorganized before getting *real* organized ;-) All that to say that for types like me, it's all about copying other, less ruby-challenged, peoples work. So for the past three weeks I've been living in the wiki....It's a pretty lonely place out there! In keeping an open mind about all this, I'm open to hearing examples of how others handle there workflow that are achieving the same goal I have in mind. ie label everything with individual labels and archive it all using the least/simplest/most efficient code possible. This way I can search for clients,client A,reports,after:tue-jan-18(I think the latter is prob. wrong but feel like looking up chronic's standards at the moment:-) ) My mail is really important to me so if the only response I get from this is "learn Ruby you lazy-ass-bastard!" I'll get the message(lousy pun eh?) ;-) -- Thanks, Phil From michael+sup@stapelberg.de Thu Feb 10 09:52:14 2011 From: michael+sup@stapelberg.de (Michael Stapelberg) Date: Thu, 10 Feb 2011 15:52:14 +0100 Subject: [sup-talk] Loosing first line of body, intentional or bug? In-Reply-To: <1297277984-sup-9281@plc.intranet.plecavalier.com> References: <1297277984-sup-9281@plc.intranet.plecavalier.com> Message-ID: <1297349497-sup-2501@midna.zekjur.net> Hi Philippe, Excerpts from Philippe LeCavalier's message of 2011-02-09 20:45:35 +0100: > If I forget to add an extra linebreak when top-posting the first line of my > reply is brought back up into the headers(references) and therefore doesn't > appear in the body. This is especially annoying if I reply with a one liner. Well, how would you distinguish text from an additional header? I would call the behaviour intentional. Best regards, Michael From support@plecavalier.com Thu Feb 10 10:31:39 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Thu, 10 Feb 2011 10:31:39 -0500 Subject: [sup-talk] Loosing first line of body, intentional or bug? In-Reply-To: <1297349497-sup-2501@midna.zekjur.net> References: <1297277984-sup-9281@plc.intranet.plecavalier.com> <1297349497-sup-2501@midna.zekjur.net> Message-ID: <1297351086-sup-7177@plc.intranet.plecavalier.com> Excerpts from Michael Stapelberg's message of Thu Feb 10 09:52:14 -0500 2011: > Hi Philippe, > > Excerpts from Philippe LeCavalier's message of 2011-02-09 20:45:35 +0100: > > If I forget to add an extra linebreak when top-posting the first line of my > > reply is brought back up into the headers(references) and therefore doesn't > > appear in the body. This is especially annoying if I reply with a one liner. > Well, how would you distinguish text from an additional header? I would call > the behaviour intentional. > I'm referring to the diff between this: -------- References: <1297277984-sup-9281 at plc.intranet.plecavalier.com> <1297349497-sup-2501 at midna.zekjur.net> Hi Michael --------- And this: --------- References: <1297277984-sup-9281 at plc.intranet.plecavalier.com> <1297349497-sup-2501 at midna.zekjur.net> Hi Michael -------- If I leave the latter the "Hi Michael" ends up looking like this: ---------- References: <1297277984-sup-9281 at plc.intranet.plecavalier.com> <1297349497-sup-2501 at midna.zekjur.net>Hi Michael ^here^ I suspect a rather obvious workaround is adding a linebreak to: /usr/bin/vim '+/^\s*\n' In config.yaml but shouldn't this be considered a bug? Or is this just happening to me? -- Thanks, Phil From marka@pobox.com Thu Feb 10 11:40:38 2011 From: marka@pobox.com (Mark Alexander) Date: Thu, 10 Feb 2011 11:40:38 -0500 Subject: [sup-talk] best method for before-add-message.rb In-Reply-To: <1297346751-sup-70@plc.intranet.plecavalier.com> References: <1297346751-sup-70@plc.intranet.plecavalier.com> Message-ID: <1297355619-sup-8657@bloovis.org> Excerpts from Philippe LeCavalier's message of Thu Feb 10 09:44:18 -0500 2011: > i)external file reference (would be my preferred method) > -can't list anything other than full email addresses in the file > @domain.com, wildcards...etc. would be nice I'm not sure if this will help (it's pretty primitive), but here's my before-add-message.rb, showing how to do regular expression matches on addresses: # Label by subject. This is useful for messages # generated automatically by Bugzilla or cron jobs. case message.subj when /\[P4 SUBMIT/ message.add_label :p4 when /\[Bug.*project:/ message.add_label :projbugs when /\[Bug/ message.add_label :bugs when /project.*suite results/ message.add_label :testing 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 # Work labels when /pi at widgets/ message.add_label :pi when /git-users at widgets/ message.add_label :git when /team-project at widgets/ message.add_label :project end # Label by 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 when /somebody at gmail.com|somebody at aol.com/ message.add_label :somebody end From support@plecavalier.com Thu Feb 10 12:37:14 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Thu, 10 Feb 2011 12:37:14 -0500 Subject: [sup-talk] time factor on before-poll.rb Message-ID: <1297359413-sup-688@plc.intranet.plecavalier.com> Is there any reasoning behind the time factor on the offlineimap before-poll.rb hook? I would prefer it allowing me to run the hook at any interval I wish... -- Thanks, Phil From support@plecavalier.com Thu Feb 10 14:19:49 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Thu, 10 Feb 2011 14:19:49 -0500 Subject: [sup-talk] best method for before-add-message.rb In-Reply-To: <1297357197-sup-5893@bloovis.org> References: <1297346751-sup-70@plc.intranet.plecavalier.com> <1297355619-sup-8657@bloovis.org> <1297356327-sup-9107@plc.intranet.plecavalier.com> <1297357197-sup-5893@bloovis.org> Message-ID: <1297364797-sup-8388@plc.intranet.plecavalier.com> Hi. I apologize in advance for the broken thread...Since I forgot a linebreak at the beginning of the body so everything got mangled upon exiting vim. I did my best to re-create the order. Excerpts from Mark Alexander's message of Thu Feb 10 12:00:17 -0500 2011: > Excerpts from Philippe LeCavalier's message of Thu Feb 10 11:52:53 -0500 2011: > > Hi Mark. > > Have you tried? > > > > case message.subj > > when /\[P4 SUBMIT/ > > message.add_label :p4 > > message.remove_label :inbox > > end > > No, I haven't tried remove_label. I did some testing and for some reason I cannot see, the above code automatically archives the msg without any obvious code telling sup to do so. If I: case message.from.email when /@plecavalier.com/ message.add_label :TEST message.add_label :TEST2 message.add_label :TEST3 end tests sent to myself are respectively labeled TEST TEST2 TEST3 but are also striped of the inbox label. Since this is exactly what I want this works for me but... -- Thanks, Phil From support@plecavalier.com Thu Feb 10 17:09:11 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Thu, 10 Feb 2011 17:09:11 -0500 Subject: [sup-talk] best method for before-add-message.rb In-Reply-To: <1297364797-sup-8388@plc.intranet.plecavalier.com> References: <1297346751-sup-70@plc.intranet.plecavalier.com> <1297355619-sup-8657@bloovis.org> <1297356327-sup-9107@plc.intranet.plecavalier.com> <1297357197-sup-5893@bloovis.org> <1297364797-sup-8388@plc.intranet.plecavalier.com> Message-ID: <1297375381-sup-2823@plc.intranet.plecavalier.com> Hi All. Excerpts from Philippe LeCavalier's message of Thu Feb 10 14:19:49 -0500 2011: > Hi. I apologize in advance for the broken thread...Since I forgot a linebreak at the beginning of the body so everything got mangled upon exiting vim. I did my best to re-create the order. > > > Excerpts from Mark Alexander's message of Thu Feb 10 12:00:17 -0500 2011: > > > Excerpts from Philippe LeCavalier's message of Thu Feb 10 11:52:53 -0500 2011: > > > > Hi Mark. > > > Have you tried? > > > > > case message.subj > > > when /\[P4 SUBMIT/ > > > message.add_label :p4 > > > message.remove_label :inbox > > > end > > > No, I haven't tried remove_label. > > I did some testing and for some reason I cannot see, the above code automatically archives the msg without any obvious code telling sup to do so. > > If I: > > case message.from.email > when /@plecavalier.com/ > message.add_label :TEST > message.add_label :TEST2 > message.add_label :TEST3 > end > > tests sent to myself are respectively labeled TEST TEST2 TEST3 but are also striped of the inbox label. Since this is exactly what I want this works for me but... Well, I don't know if this was the most efficient method but I took Mark's example and ran with it. This method accomplishes my goal to add(and remove!) multiple labels in one swish and is legible enough for the simple-minded like myself. Note: the above statement re. removing the inbox label without having specifying it explicitely is false...No idea why Sup was doing that but restarting sup completely, fixed that oddity. Perhaps my understanding of 'H' is incorrect!? Thanks a bunch Mark my inbox is well on it's way to 0 as it once was. -- Thanks, Phil From romain@univers-libre.net Fri Feb 11 08:08:29 2011 From: romain@univers-libre.net (Romain Dessort) Date: Fri, 11 Feb 2011 14:08:29 +0100 Subject: [sup-talk] Delete email from Sup index Message-ID: <1297428180-sup-8381@mail.univers-libre.net> Hi all, I use Sup for a while to manage a huge quantity of emails (~1000 emails per day, most of these are directly archived). In parallel, I have a cron job which remove (in my maildir) old emails and then do a sup-sync to update Sup index each day. But I notice Sup does not remove the correspondent entry from his index after sup-sync (even if I use --discard option). It is problematic for me because the Sup index contains now about 310,000 emails and the .sup/xapian/ directory takes about 4.4 GB disk space ! Is there a way to really remove emails from Index (and not mark them as 'deleted') ? Thanks for your help ! -- Romain Dessort Jabber ID : romain at univers-libre.net GnuPG : 3072D/724BC532 From sup@zevv.nl Fri Feb 11 09:24:57 2011 From: sup@zevv.nl (Ico Doornekamp) Date: Fri, 11 Feb 2011 15:24:57 +0100 Subject: [sup-talk] Feature request: remove 'no new messages' flashing Message-ID: <1297434100-sup-1912@pruts.nl> Hi, This might be a nitpicking request, but I would like to propose the removal of the 'No new messages' text flashing on screen after every poll. Apart from that this message is not really informational (the unix philosophy being 'no news is good news'), it also is distracting: when I'm working with a sup window open on screen, the flashing always seems to catch my attention and distract me for a second, only to find out that there is no mail. Thanks, Ico -- :wq ^X^Cy^K^X^C^C^C^C From thorsten@net.t-labs.tu-berlin.de Fri Feb 11 09:25:01 2011 From: thorsten@net.t-labs.tu-berlin.de (Thorsten Fischer) Date: Fri, 11 Feb 2011 14:25:01 +0000 Subject: [sup-talk] Delete email from Sup index In-Reply-To: <1297428180-sup-8381@mail.univers-libre.net> References: <1297428180-sup-8381@mail.univers-libre.net> Message-ID: <1297433878-sup-5263@mail.froschi.org> Excerpts from Romain Dessort's message of 2011-02-11 13:08:29 +0000: > Is there a way to really remove emails from Index (and not mark them as > 'deleted') ? I have been through exactly that about ten minutes ago to get rid of >40k index entries in my sup setup. Good timing! ;) What I did: * stopped the periodic polling of my offlineimap, just in case, to keep the sources from changing. * made a backup of my .sup/ folder, just in case. * created a label dump file using sup-dump. * deleted the .sup/xapian folder. * run sup-sync with the --restore option, pointing to the dump file. The index was re-created from the dump file, but only taking into account the files that were currently available from the sources. Worked like a charm. Better, in fact, since charms don't work at all. Ahem. Yes, it would be great if there were a less convoluted way to do this. Cheers, t -- Thorsten Fischer, BOWL Project Administrator Technische Universit?t Berlin, FG INET, TEL16, 18th floor Ernst-Reuter-Platz 7, 10587 Berlin, Germany Tel: +49 30 835358542, Fax: +49 391 53478347 From support@plecavalier.com Fri Feb 11 11:04:26 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Fri, 11 Feb 2011 11:04:26 -0500 Subject: [sup-talk] Feature request: remove 'no new messages' flashing In-Reply-To: <1297434100-sup-1912@pruts.nl> References: <1297434100-sup-1912@pruts.nl> Message-ID: <1297440178-sup-2287@plc.intranet.plecavalier.com> Hi Ico. Excerpts from Ico Doornekamp's message of Fri Feb 11 09:24:57 -0500 2011: > Hi, > > This might be a nitpicking request, but I would like to propose the > removal of the 'No new messages' text flashing on screen after every > poll. I'm pretty certain I've come across either a hook or a config option/tweak that does just that. Google is your friend on that one. > Thanks, > > Ico -- Thanks, Phil From romain@univers-libre.net Fri Feb 11 13:36:32 2011 From: romain@univers-libre.net (Romain Dessort) Date: Fri, 11 Feb 2011 19:36:32 +0100 Subject: [sup-talk] Delete email from Sup index In-Reply-To: <1297433878-sup-5263@mail.froschi.org> References: <1297428180-sup-8381@mail.univers-libre.net> <1297433878-sup-5263@mail.froschi.org> Message-ID: <1297448359-sup-6036@mail.univers-libre.net> Excerpts from Thorsten Fischer's message of ven f?v 11 15:25:01 +0100 2011: > I have been through exactly that about ten minutes ago to get rid of > >40k index entries in my sup setup. Good timing! ;) Yeah, but I receive too much cron output emails and other boring automatic daily reports, so it's easy to reach this value ;). > What I did: > > * stopped the periodic polling of my offlineimap, just in case, to keep > the sources from changing. > * made a backup of my .sup/ folder, just in case. > * created a label dump file using sup-dump. > * deleted the .sup/xapian folder. > * run sup-sync with the --restore option, pointing to the dump file. > > The index was re-created from the dump file, but only taking into > account the files that were currently available from the sources. Worked > like a charm. Better, in fact, since charms don't work at all. Ahem. Ok, this should be a good hack if I do this operation occasionally, but I can hardly automated it? But thank you anyway! -- Romain Dessort Jabber ID : romain at univers-libre.net GnuPG : 3072D/724BC532 From moritz+sup@wzff.de Sat Feb 12 20:34:27 2011 From: moritz+sup@wzff.de (Moritz Wilhelmy) Date: Sun, 13 Feb 2011 02:34:27 +0100 Subject: [sup-talk] best method for before-add-message.rb In-Reply-To: <1297375381-sup-2823@plc.intranet.plecavalier.com> References: <1297346751-sup-70@plc.intranet.plecavalier.com> <1297355619-sup-8657@bloovis.org> <1297356327-sup-9107@plc.intranet.plecavalier.com> <1297357197-sup-5893@bloovis.org> <1297364797-sup-8388@plc.intranet.plecavalier.com> <1297375381-sup-2823@plc.intranet.plecavalier.com> Message-ID: <1297560324-sup-4333@niflheimr> Hi, what would be the best way to match - for instance - the List-Id-Header in case it's present? I've been wondering about this for a long time, right now, I'm matching the raw-header against some regex, but it breaks if the line I'm matching contains a newline (i.e. the header field is longer than one line). Is there any way around this? Right now I'm doing something along the lines of this: # Mailing lists lids_re = { // => "foo", // => ["something", "devel"] } def add_labels message, labels labels.each do |l| message.add_label l end end if message.raw_header =~ /^List-I[dD]: ([^\n]+)/ #log "List ID: #{$1}" message.add_label "list" lids_re.keys.each do |re| add_labels message lids_re[re] if $1 =~ re end end Can I pull arbitrary, parsed headers directly out of the message object, or do I have to do my own parsing? Best regards, Moritz From fedzor@gmail.com Sat Feb 12 21:40:10 2011 From: fedzor@gmail.com (fedzor) Date: Sat, 12 Feb 2011 21:40:10 -0500 Subject: [sup-talk] Maildir and Sup Aren't Playing Well Together Message-ID: <9E6F6174-48AE-42F4-9DF4-D5848FCF64AF@gmail.com> Hey all, I have my maildir set up with offlineimap, and it produces a directory structure like this: drwx------ 5 ari staff 170B Feb 12 17:25 Bulk Mail drwx------ 5 ari staff 170B Feb 12 17:25 Deleted Messages drwx------ 5 ari staff 170B Feb 12 17:25 Drafts drwx------ 5 ari staff 170B Feb 12 17:25 Email_Templates drwx------ 5 ari staff 170B Feb 12 17:25 INBOX drwx------ 5 ari staff 170B Feb 12 17:25 Send_Later drwx------ 5 ari staff 170B Feb 12 17:25 Sent Items drwx------ 5 ari staff 170B Feb 12 17:25 Sent Messages drwx------ 5 ari staff 170B Feb 12 17:25 Trash However, sup complains about this when it tries to poll: [Sat Feb 12 21:38:52 -0500 2011] WARNING: problem getting messages from maildir:/Users/ari/.mail/aribrown.com: /Users/ari/.mail/aribrown.com/new not a directory What did I do wrong, and how do I fix it? Thanks, Ari From support@plecavalier.com Sat Feb 12 22:21:19 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Sat, 12 Feb 2011 22:21:19 -0500 Subject: [sup-talk] Maildir and Sup Aren't Playing Well Together In-Reply-To: <9E6F6174-48AE-42F4-9DF4-D5848FCF64AF@gmail.com> References: <9E6F6174-48AE-42F4-9DF4-D5848FCF64AF@gmail.com> Message-ID: <1297566894-sup-7979@plc.intranet.plecavalier.com> Excerpts from fedzor's message of Sat Feb 12 21:40:10 -0500 2011: > Hey all, > > I have my maildir set up with offlineimap, and it produces a directory structure like this: > drwx------ 5 ari staff 170B Feb 12 17:25 Bulk Mail > drwx------ 5 ari staff 170B Feb 12 17:25 Deleted Messages > drwx------ 5 ari staff 170B Feb 12 17:25 Drafts > drwx------ 5 ari staff 170B Feb 12 17:25 Email_Templates > drwx------ 5 ari staff 170B Feb 12 17:25 INBOX > drwx------ 5 ari staff 170B Feb 12 17:25 Send_Later > drwx------ 5 ari staff 170B Feb 12 17:25 Sent Items > drwx------ 5 ari staff 170B Feb 12 17:25 Sent Messages > drwx------ 5 ari staff 170B Feb 12 17:25 Trash > > However, sup complains about this when it tries to poll: > [Sat Feb 12 21:38:52 -0500 2011] WARNING: problem getting messages from maildir:/Users/ari/.mail/aribrown.com: /Users/ari/.mail/aribrown.com/new not a directory > > What did I do wrong, and how do I fix it? Based on the list above each would have to be a source. Also looks like you pointed sup to the parent dir and not INBOX where it will find new,cur,tmp. I would guess you were expecting sup to pick up each directory. Sup doesn't work that way. You'd have to specify each folder as a source in the config. > Thanks, > Ari -- Thanks, Phil From john.wyzer@gmx.de Sun Feb 13 03:20:13 2011 From: john.wyzer@gmx.de (John Wyzer) Date: Sun, 13 Feb 2011 09:20:13 +0100 Subject: [sup-talk] message missing in source, sup v0.12.1, sup-sync no longer has --changed? In-Reply-To: <1297452493-sup-3136@spade.spade-domain> References: <4D522CBF.4020203@gmx.de> <1297452493-sup-3136@spade.spade-domain> Message-ID: <1297584795-sup-2477@localhost> Excerpts from Jon Austin's message of Fri Feb 11 20:29:28 +0100 2011: > I think sup-sync -o may fix it. > > (I've been having a strange issue since .12 came out if I send a message and then quit sup, then relaunch, it'll show the first line of the message, ending in '.....' and then show the below error (inside the message), until I sup-sync -o) > > *********************************************************************** > An error occurred while loading this message. > *********************************************************************** > > I even spent several hours yesterday completely rebuilding the xapian index, but still happening...if anyone has a clue what could be causing this, I'd love to hear it :) Hmm. In lib/sup/index.rb it says: ## xapian-compact takes too long, so this is a no-op ## until we think of something better def optimize end And from what I understand, the -o optime does not do more at the moment. So the question remain - if messags are missing from one Maildir, is my only option to dump, reindex all and restore? That would be painful given the number of messages... -- From tero@tilus.net Sun Feb 13 04:51:02 2011 From: tero@tilus.net (Tero Tilus) Date: Sun, 13 Feb 2011 11:51:02 +0200 Subject: [sup-talk] best method for before-add-message.rb In-Reply-To: <1297560324-sup-4333@niflheimr> References: <1297346751-sup-70@plc.intranet.plecavalier.com> <1297355619-sup-8657@bloovis.org> <1297356327-sup-9107@plc.intranet.plecavalier.com> <1297357197-sup-5893@bloovis.org> <1297364797-sup-8388@plc.intranet.plecavalier.com> <1297375381-sup-2823@plc.intranet.plecavalier.com> <1297560324-sup-4333@niflheimr> Message-ID: <1297589599-sup-596@tilus.net> Moritz Wilhelmy, 2011-02-13 03:34: > what would be the best way to match - for instance - the > List-Id-Header in case it's present? List-Id is a whole separate kind of beast. My stragy dealing with it looks like this. Comments in finnish. Go google translate. ;) == clip from ~/.sup/hooks/before-add-message.rb == hdr = message.raw_header # Yritet??n hakea listalle label List-Id headerista ja jos sellaista # ei ole (mm. pipermail-arkistot) niin otsikkorivilt? [listanimest?]. # Listaheadereita on montaa sorttia # # List-Id: effi-alert.winston.effi.org # List-Id: # List-Id: EFFIn hallituksen keskusteluja # List-Id: =?iso-8859-1?q?Keski-Suomen_EFFIl=E4iset?= # List-Id: "Hear ry:n julkinen tiedotuslista: Radio Hear, Linnunlaulupubi, # List-Id: =?iso-8859-1?q?El=E4m=E4_on_peli=E4=2C_j=E4rjest=E4j=E4lista?= if m = (hdr.match(/^List-Id: +[^<]*<([^>\s]+)> *$/i) or # tyyppi 1 hdr.match(/^List-Id: +([^<>=\s]+) *$/i) or # tyypit 2-4 hdr.match(/^Subject: +\[ *([^\] ]+) *\]/i)) list_id = m[1] list_id = 'effi-hallitus' if list_id == 'board.effi.org' list_id = 'effi-asiantuntijat' if list_id == 'asiantuntijat.effi.org' list_id = 'maahinkainen-jasenet' if list_id == 'jasenet.maahinkainen.org' list_id = 'lev' if list_id == 'lev-list' list_id = list_id.split('.', 2)[0].downcase message.add_label list_id end == clip end == > Can I pull arbitrary, parsed headers directly out of the message > object, or do I have to do my own parsing? Uh, oh. Looks like no, but it is pretty close, berause Message#parse_header already builds parsed hash of arbitrary headers internally. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ From sascha-ml-reply-to-2011-2@silbe.org Sun Feb 13 06:27:16 2011 From: sascha-ml-reply-to-2011-2@silbe.org (Sascha Silbe) Date: Sun, 13 Feb 2011 12:27:16 +0100 Subject: [sup-talk] message missing in source, sup v0.12.1, sup-sync no longer has --changed? In-Reply-To: <4D522CBF.4020203@gmx.de> References: <4D522CBF.4020203@gmx.de> Message-ID: <1297596179-sup-1919@xo15-sascha.sascha.silbe.org> Excerpts from John Wyzer's message of Wed Feb 09 06:57:19 +0100 2011: > I have my sent messages in a maildir and deleted one message. > sup-sync used to have --changed to fix this in the index, but no longer > has (the FAQ still says so). > Sup only says that there was an error loading the message, but does not > say how to fix the index. Check out the recent thread "Delete email from Sup index" [1] on sup-talk and my patch [2] on sup-devel. Sascha [1] http://rubyforge.org/pipermail/sup-talk/2011-February/thread.html#4511 [2] http://rubyforge.org/pipermail/sup-devel/2011-February/thread.html#982 -- http://sascha.silbe.org/ http://www.infra-silbe.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 494 bytes Desc: not available URL: From moritz+sup@wzff.de Sun Feb 13 08:00:27 2011 From: moritz+sup@wzff.de (Moritz Wilhelmy) Date: Sun, 13 Feb 2011 14:00:27 +0100 Subject: [sup-talk] How to treat List-Id headers (Was: best method for before-add-message.rb) In-Reply-To: <1297589599-sup-596@tilus.net> References: <1297346751-sup-70@plc.intranet.plecavalier.com> <1297355619-sup-8657@bloovis.org> <1297356327-sup-9107@plc.intranet.plecavalier.com> <1297357197-sup-5893@bloovis.org> <1297364797-sup-8388@plc.intranet.plecavalier.com> <1297375381-sup-2823@plc.intranet.plecavalier.com> <1297560324-sup-4333@niflheimr> <1297589599-sup-596@tilus.net> Message-ID: <1297600750-sup-2275@niflheimr> Hello, Excerpts from Tero Tilus's message of Sun Feb 13 10:51:02 +0100 2011: > > what would be the best way to match - for instance - the > > List-Id-Header in case it's present? > List-Id is a whole separate kind of beast. My stragy dealing with it > looks like this. Comments in finnish. Go google translate. ;) Ah, well, the problem I have is something like this List-Id: "very long descriptive text on what the list is about" Because the actual List-Id is so long, it's sometimes wrapped into the next line per convention (i.e. when the descriptive text is already very long and the line needs to be wrapped because the actual List-Id would exceed the character limit per line, I think it's around 80 characters). Thus, my regexes don't match in all cases. I want to match the list by the part between the <>, not the descriptive text, which is a bit problematic because of the line-wrapping. However, if I could get the full List-Id line from the parsed headers hashtable, this would eliminate my parsing problems. > > Can I pull arbitrary, parsed headers directly out of the message > > object, or do I have to do my own parsing? > Uh, oh. Looks like no, but it is pretty close, berause > Message#parse_header already builds parsed hash of arbitrary headers > internally. Well, making this publicly accessible to the before-add-message hook would simplify a lot of the stuff I do with my email in order to place the right labels. So maybe, this is a feature request to the sup developers, but maybe I also got everything wrong. ;) Cheers, Moritz From moritz+sup@wzff.de Sun Feb 13 08:59:12 2011 From: moritz+sup@wzff.de (Moritz Wilhelmy) Date: Sun, 13 Feb 2011 14:59:12 +0100 Subject: [sup-talk] message missing in source, sup v0.12.1, sup-sync no longer has --changed? In-Reply-To: <1297584795-sup-2477@localhost> References: <4D522CBF.4020203@gmx.de> <1297452493-sup-3136@spade.spade-domain> <1297584795-sup-2477@localhost> Message-ID: <1297605296-sup-2535@niflheimr> Hi, Excerpts from John Wyzer's message of Sun Feb 13 09:20:13 +0100 2011: > So the question remain - if messags are missing from one Maildir, is my only > option to dump, reindex all and restore? That would be painful given the > number of messages... Not only painful and annoying but also very stupid. Why would someone want to get rid of sup-sync --changed? It happens all the time that Maildirs are externally changed, there *should* be some easy way to sync these changes back, at least that's my insignificant opinion. I don't completely understand the motivation for getting rid of this feature in the first place. Can someone please explain? Best regards, Moritz From dmishd@gmail.com Sun Feb 13 12:12:15 2011 From: dmishd@gmail.com (Hamish D) Date: Sun, 13 Feb 2011 17:12:15 +0000 Subject: [sup-talk] best method for before-add-message.rb In-Reply-To: <1297560324-sup-4333@niflheimr> References: <1297346751-sup-70@plc.intranet.plecavalier.com> <1297355619-sup-8657@bloovis.org> <1297356327-sup-9107@plc.intranet.plecavalier.com> <1297357197-sup-5893@bloovis.org> <1297364797-sup-8388@plc.intranet.plecavalier.com> <1297375381-sup-2823@plc.intranet.plecavalier.com> <1297560324-sup-4333@niflheimr> Message-ID: > what would be the best way to match - for instance - the List-Id-Header in case > it's present? I've been wondering about this for a long time, right now, I'm > matching the raw-header against some regex, but it breaks if the line I'm > matching contains a newline (i.e. the header field is longer than one line). Is there any reason you're not using the list_address member of message? It is derived from the List-Post header if present, or if not, the X-Mailing-List header. You can use it as, for example: # Mark by email list if message.list_address.email =~ /sup-talk/ message.add_label "sup" message.add_label "list" end Hamish From rlane@club.cc.cmu.edu Sun Feb 13 12:45:04 2011 From: rlane@club.cc.cmu.edu (Rich Lane) Date: Sun, 13 Feb 2011 12:45:04 -0500 Subject: [sup-talk] best method for before-add-message.rb In-Reply-To: <1297589599-sup-596@tilus.net> References: <1297346751-sup-70@plc.intranet.plecavalier.com> <1297355619-sup-8657@bloovis.org> <1297356327-sup-9107@plc.intranet.plecavalier.com> <1297357197-sup-5893@bloovis.org> <1297364797-sup-8388@plc.intranet.plecavalier.com> <1297375381-sup-2823@plc.intranet.plecavalier.com> <1297560324-sup-4333@niflheimr> <1297589599-sup-596@tilus.net> Message-ID: <1297618949-sup-445@zyrg.net> Excerpts from Tero Tilus's message of 2011-02-13 04:51:02 -0500: > Moritz Wilhelmy, 2011-02-13 03:34: > > Can I pull arbitrary, parsed headers directly out of the message > > object, or do I have to do my own parsing? > > Uh, oh. Looks like no, but it is pretty close, berause > Message#parse_header already builds parsed hash of arbitrary headers > internally. > I use "hs = message.source.load_header(message.source_info)", which we should probably make a convenience method on Message. From rlane@club.cc.cmu.edu Sun Feb 13 13:03:11 2011 From: rlane@club.cc.cmu.edu (Rich Lane) Date: Sun, 13 Feb 2011 13:03:11 -0500 Subject: [sup-talk] message missing in source, sup v0.12.1, sup-sync no longer has --changed? In-Reply-To: <1297605296-sup-2535@niflheimr> References: <4D522CBF.4020203@gmx.de> <1297452493-sup-3136@spade.spade-domain> <1297584795-sup-2477@localhost> <1297605296-sup-2535@niflheimr> Message-ID: <1297619275-sup-3028@zyrg.net> Excerpts from Moritz Wilhelmy's message of 2011-02-13 08:59:12 -0500: > Excerpts from John Wyzer's message of Sun Feb 13 09:20:13 +0100 2011: > > So the question remain - if messags are missing from one Maildir, is my only > > option to dump, reindex all and restore? That would be painful given the > > number of messages... > > Not only painful and annoying but also very stupid. Why would someone want to > get rid of sup-sync --changed? It happens all the time that Maildirs are > externally changed, there *should* be some easy way to sync these changes back, > at least that's my insignificant opinion. I don't completely understand the > motivation for getting rid of this feature in the first place. Can someone > please explain? sup-sync --changed was removed because it is no longer necessary. The maildir code can now gracefully deal with messages being moved and deleted. If all locations for a message are deleted it will keep the index entry (including the snippet) but display an error (inline, not disrupting the rest of the UI) if you try to view the message. Is this the behavior you're seeing, or is there a bug in the implementation? Sascha posted a patch that deletes index entries with no locations after a sync. I'd rather see that as a extra sup-sync --purge option, and if you don't want deleted messages to appear in the UI we should just check for that before adding them to the ThreadSet. From support@plecavalier.com Sun Feb 13 13:08:23 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Sun, 13 Feb 2011 13:08:23 -0500 Subject: [sup-talk] best method for before-add-message.rb In-Reply-To: References: <1297346751-sup-70@plc.intranet.plecavalier.com> <1297355619-sup-8657@bloovis.org> <1297356327-sup-9107@plc.intranet.plecavalier.com> <1297357197-sup-5893@bloovis.org> <1297364797-sup-8388@plc.intranet.plecavalier.com> <1297375381-sup-2823@plc.intranet.plecavalier.com> <1297560324-sup-4333@niflheimr> Message-ID: <1297619496-sup-5791@plc.intranet.plecavalier.com> Excerpts from Hamish D's message of Sun Feb 13 12:12:15 -0500 2011: > > what would be the best way to match - for instance - the List-Id-Header in case > > it's present? I've been wondering about this for a long time, right now, I'm > > matching the raw-header against some regex, but it breaks if the line I'm > > matching contains a newline (i.e. the header field is longer than one line). > > Is there any reason you're not using the list_address member of > message? It is derived from the List-Post header if present, or if > not, the X-Mailing-List header. You can use it as, for example: > > # Mark by email list > if message.list_address.email =~ /sup-talk/ > message.add_label "sup" > message.add_label "list" > end > > Hamish I tried that and experienced varying success. ie 2 or three 'add_label' is fine but adding and removing, for instance doesn't appear possible. I would assume most ppl here are interested in not only applying a label but also removing one in particular the inbox label. Is anybody successfully both adding and removing a labels...in any way regexp, header...anything? So far I've tried this: addressfile = File.open("/home/plecavalier/.sup/hooks/label.lists","r") if ! addressfile.grep(/#{message.list_address.email}/).empty? message.add_label :lists end addressfile = File.open("/home/plecavalier/.sup/hooks/label.lists","r") if ! addressfile.grep(/#{message.list_address.email}/).empty? message.remove_label :inbox end In this case it appears handling a msg twice breaks everything. So then I tried this: case message.list_address when /samba at lists.samba.org/ message.add_label :lists message.add_label :samba message.remove_label :inbox when /cups at easysw.com/ message.add_label :lists message.add_label :cups message.remove_label :inbox end This remains the closest I've come -thanks to Mark Alexander-. In this I was able to get multiple labels going for multiple msgs but again, very much hit-and-miss for label removal. I should probably not that message.remove_label in it's simplest form works fine. Just appears that it can't live alongside any other function. I think we're starting to see that unless one is conversely adept in one form of language or another your odds of successfully adding labels upon receipt are in a manner which will create a robust searching db is quite low. Thus defeating in part the whole concept of this system. Don't mean to sound so negative here but I just to point out that from a none fluent regex/rudy....etc the wiki and mail archives leave you somewhat hanging. -- Thanks, Phil From support@plecavalier.com Sun Feb 13 15:57:30 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Sun, 13 Feb 2011 15:57:30 -0500 Subject: [sup-talk] 0/0...I made it Message-ID: <1297630080-sup-3488@plc.intranet.plecavalier.com> Well, despite not finding a truly efficient method for autolabeling my mail -I'm not worried I won't, I just haven't found it yet- after 30 some days of due deligence my inbox is for now back to 0. I think this speaks volumes about just how good Sup is considering I did this mostly by selecting a thread, highlight a contact(this really should be mentioned in a wiki somewhere), S, T, =, L, This wasn't as painful as it may sound. In fact it was almost enjoyable. To put things into perspective; I started the day out with approx. ten thousand msgs left in my inbox and it's ten to four. Considering I prob. spent every other hour entertaining the kids I prob. spent a three to four hours. I almost crossed over to notmuch just yesterday but I stuck with Sup and I'm glad I did. Cheers! -- Thanks, Phil From whodevil-suptalk@offthecob.info Sun Feb 13 20:24:50 2011 From: whodevil-suptalk@offthecob.info (whodevil) Date: Sun, 13 Feb 2011 17:24:50 -0800 Subject: [sup-talk] after-poll.rb variables Message-ID: <1297646180-sup-4406@mail.offthecob.info> I'm trying to write a hook that will update the status bar of my screen session with the number of unread emails in my inbox. I've worked out the logistics on how to get this into the status bar. My issue is that when the hook executes, num_inbox only returns the number of new messages it found during that poll period. While this can be useful, it doesn't fit my need. I'm wondering if someone know if there is a way to get the total unread messages in the inbox from within the after-poll hook? Thanks, Whodevil From rlane@club.cc.cmu.edu Sun Feb 13 21:08:52 2011 From: rlane@club.cc.cmu.edu (Rich Lane) Date: Sun, 13 Feb 2011 21:08:52 -0500 Subject: [sup-talk] after-poll.rb variables In-Reply-To: <1297646180-sup-4406@mail.offthecob.info> References: <1297646180-sup-4406@mail.offthecob.info> Message-ID: <1297648971-sup-3124@zyrg.net> Excerpts from whodevil's message of 2011-02-13 20:24:50 -0500: > I'm wondering if someone know if there is a way to get the total > unread messages in the inbox from within the after-poll hook? Index.num_results_for(labels: [:inbox, :unread]) From support@plecavalier.com Mon Feb 14 08:31:05 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Mon, 14 Feb 2011 08:31:05 -0500 Subject: [sup-talk] after-poll.rb variables In-Reply-To: <1297648971-sup-3124@zyrg.net> References: <1297646180-sup-4406@mail.offthecob.info> <1297648971-sup-3124@zyrg.net> Message-ID: <1297690119-sup-2506@plc.intranet.plecavalier.com> Excerpts from Rich Lane's message of Sun Feb 13 21:08:52 -0500 2011: > Excerpts from whodevil's message of 2011-02-13 20:24:50 -0500: > > I'm wondering if someone know if there is a way to get the total > > unread messages in the inbox from within the after-poll hook? > > Index.num_results_for(labels: [:inbox, :unread]) This thread made me wonder... Wouldn't it be handy if after-poll reported the labels before-add-poll.rb assigns? -- Thanks, Phil From groups@hjdivad.com Mon Feb 14 13:11:40 2011 From: groups@hjdivad.com (David J. Hamilton) Date: Mon, 14 Feb 2011 10:11:40 -0800 Subject: [sup-talk] 0/0...I made it In-Reply-To: <1297630080-sup-3488@plc.intranet.plecavalier.com> References: <1297630080-sup-3488@plc.intranet.plecavalier.com> Message-ID: <1297706861-sup-7672@nyx.local> Philippe, Excerpts from Philippe LeCavalier's message of Sun Feb 13 12:57:30 -0800 2011: > Well, despite not finding a truly efficient method for autolabeling my mail > -I'm not worried I won't, I just haven't found it yet- after 30 some days of > due deligence my inbox is for now back to 0. Have you tried writing a before-add-message hook? If so, what problems have you run in to with your attempts at autolabeling? Here's a snippet of mine: # before-add-message.rb def autolabel message, label log "Adding label [#{label}] to #{message.id}" message.add_label label end def autolabel_email message, regexes, label regexes = [ regexes ] unless regexes.is_a? Enumerable if message.recipients.any? do |recipient| AccountManager.is_account_email? recipient.email and regexes.any?{ |r| recipient.email =~ r } end autolabel message, label end if AccountManager.is_account_email? message.from.email and regexes.any?{ |r| message.from.email =~ r } autolabel message, label end end unless message.nil? autolabel_email message, /ucdavis.edu$/i, 'ucdavis' # ? lines similar to above, giving regexes or arrays of regexes and the # desired label. end -- med v?nlig h?lsning David J. Hamilton From support@plecavalier.com Mon Feb 14 14:18:38 2011 From: support@plecavalier.com (Philippe LeCavalier) Date: Mon, 14 Feb 2011 14:18:38 -0500 Subject: [sup-talk] 0/0...I made it In-Reply-To: <1297706861-sup-7672@nyx.local> References: <1297630080-sup-3488@plc.intranet.plecavalier.com> <1297706861-sup-7672@nyx.local> Message-ID: <1297707717-sup-3255@plc.intranet.plecavalier.com> Hi David. Excerpts from David J. Hamilton's message of Mon Feb 14 13:11:40 -0500 2011: > Philippe, > > Excerpts from Philippe LeCavalier's message of Sun Feb 13 12:57:30 -0800 2011: > > Well, despite not finding a truly efficient method for autolabeling my mail > > -I'm not worried I won't, I just haven't found it yet- after 30 some days of > > due deligence my inbox is for now back to 0. > > Have you tried writing a before-add-message hook? If so, what problems have you > run in to with your attempts at autolabeling? Yeah. I've tried a bunch of options[1] -and still am-. Mostly, I don't understand what's going on during the functions and it's making things challenging to say the least. I really like the idea of matching email addresses using an external file as in the sup-wiki. As I mention in [1] simple operations ie adding/removing a single label works like a charm. But I want a model that will allow me to search in a very granular way. I want to break down my labels. |client ||companyA ||companyB ||companyC |||position |||invoice |||issues |||reports |ff #friends and foe ||wife,friends, family |||contact ||||persons name I don't like This way I can search for all 'company' then refine by 'position' 'invoice'...etc. Or go straight to a specific group or people 'position' ie all 'exec' or 'finance'. But in order to do that I need a before-add-message hook that will add multiple labels either in one invocation or multiple ones. It goes without saying, but I'll state it anyways, my desired model far exceeds my ability as non-programmer. However, I'm a logical and patience individual and I know that if I can find a working example I can 'take it from there'. At the moment, it seems my biggest problem is labeling an email more than once. I found a few posts/relevant discussions[2,3] regard sup and multiple labels but nothing has lead me down the correct path. ref: [1] http://rubyforge.org/pipermail/sup-talk/2011-February/004504.html [2] https://github.com/jacius/sup-filters/blob/master/filters.example.yaml [3] http://www.mail-archive.com/sup-talk at rubyforge.org/msg03361.html > Here's a snippet of mine: > > # before-add-message.rb > > def autolabel message, label > log "Adding label [#{label}] to #{message.id}" > message.add_label label > end > > def autolabel_email message, regexes, label > regexes = [ regexes ] unless regexes.is_a? Enumerable > if message.recipients.any? do |recipient| > AccountManager.is_account_email? recipient.email and > regexes.any?{ |r| recipient.email =~ r } > end > autolabel message, label > end > > if AccountManager.is_account_email? message.from.email and > regexes.any?{ |r| message.from.email =~ r } > > autolabel message, label > end > end > > > unless message.nil? > autolabel_email message, /ucdavis.edu$/i, 'ucdavis' > # ? lines similar to above, giving regexes or arrays of regexes and the > # desired label. > end > -- Thanks, Phil From hollunder@lavabit.com Tue Feb 15 07:00:10 2011 From: hollunder@lavabit.com (Philipp) Date: Tue, 15 Feb 2011 13:00:10 +0100 Subject: [sup-talk] sup-tweak-labels broken, and more Message-ID: <1297770445-sup-8888@eris> Hi there. I ran "sup-tweak-labels -r