[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-talk] before-add-message.rb <-> Gmail Filters



Hello,

First I would like to thank all and everyone who has contributed to
the PERFECT email client, the client I was looking for, for a very
long time... I love it...

My gmail account is, at the same time, my primary email address and
the storage for all my emails, all email aliases, work-related or not,
ends up one way or another in my gmail, even the sent mail, and to
keep track of everything, I use gmail filters to, well, hide, label,
mark as read, mark as Crap :)

So I have more than 100 filters already setup, fortunately gmail let's
you export those filters as an XML (c.f below for an example) through
one of the labs extensions, however I couldn't find any information on
before-add-message.rb hook using mailFilters.xml..

So my question is, did anyone write a hook to reads that XML file and
work on the message object ? Otherwise, did anyone make a dynamic
before-add-message.rb I could follow? I know ruby, but not that much
so I would appreciate an example to follow..

Thank you all,,

Regards,
Wael Nasreddine




-------------------------------------- mailFilters.xml
<?xml version='1.0' encoding='UTF-8'?><feed
xmlns='http://www.w3.org/2005/Atom'
xmlns:apps='http://schemas.google.com/apps/2006'>
	<title>Mail Filters</title>
	<id>tag:mail.google.com,2008:filters:1226589431861,1237145025938,1244162662829,1244162696287</id>
	<updated>2010-12-10T15:01:45Z</updated>
	<author>
		<name>Wael Nasreddine</name>
		<email>my.email@gmail.com</email>
	</author>
        <entry>
		<category term='filter'></category>
		<title>Mail Filter</title>
		<id>tag:mail.google.com,2008:filter:1226589431861</id>
		<updated>2010-12-10T15:01:45Z</updated>
		<content></content>
		<apps:property name='from' value='customersupport@somecompany.com OR
support@somecompany.com OR supporttestv3@somecompany.com'/>
		<apps:property name='label' value='SomeCompany'/>
		<apps:property name='shouldNeverSpam' value='true'/>
	</entry>
	<entry>
		<category term='filter'></category>
		<title>Mail Filter</title>
		<id>tag:mail.google.com,2008:filter:1237145025938</id>
		<updated>2010-12-10T15:01:45Z</updated>
		<content></content>
		<apps:property name='to' value='zsh-workers@sunsite.dk'/>
		<apps:property name='label' value='ML/Zsh-Workers'/>
		<apps:property name='shouldArchive' value='true'/>
	</entry>
	<entry>
		<category term='filter'></category>
		<title>Mail Filter</title>
		<id>tag:mail.google.com,2008:filter:1244162662829</id>
		<updated>2010-12-10T15:01:45Z</updated>
		<content></content>
		<apps:property name='subject' value='[Something Test][PASS]'/>
		<apps:property name='label' value='Something Test'/>
		<apps:property name='shouldMarkAsRead' value='true'/>
		<apps:property name='shouldArchive' value='true'/>
		<apps:property name='shouldNeverSpam' value='true'/>
	</entry>
	<entry>
		<category term='filter'></category>
		<title>Mail Filter</title>
		<id>tag:mail.google.com,2008:filter:1244162696287</id>
		<updated>2010-12-10T15:01:45Z</updated>
		<content></content>
		<apps:property name='subject' value='[Something Test][FAIL]'/>
		<apps:property name='label' value='Something Test'/>
		<apps:property name='shouldNeverSpam' value='true'/>
		<apps:property name='shouldAlwaysMarkAsImportant' value='true'/>
	</entry>
</feed>
-------------------------------------- mailFilters.xml

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Waêl Nasreddine
TechnoGate www.technogate.fr
mobile :  06.32.94.70.13
agence : 09.70.444.236
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk