Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

Triggering a server action on a specific event

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


olt at tinyerp

Sep 28, 2009, 2:47 AM

Post #1 of 14 (3685 views)
Permalink
Triggering a server action on a specific event

Hi,

I would like to launch a specific command [1] on a mail server whenever
a message is moved from one folder into another folder.

For example, a Thunderbird user moves a message from folder A to Folder
B. I'd like to catch this move and launch a specific script on the server.

Is it possible ?

I don't know if I need to search an answer at the qmail level or at the
imap server level.

I'm using qmail with courier-imap.

Thanks,

[1] bash or python script, ...

Regards,

--
Olivier
Developer
OpenERP - Tiny sprl
Chaussée de Namur, 40
B-1367 Gérompont
Tel: +32.81.81.37.00
Web: http://tiny.be


hugo.monteiro at fct

Sep 28, 2009, 3:08 AM

Post #2 of 14 (3553 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Olivier Laurent wrote:
> Hi,
>
> I would like to launch a specific command [1] on a mail server
> whenever a message is moved from one folder into another folder.
>
> For example, a Thunderbird user moves a message from folder A to
> Folder B. I'd like to catch this move and launch a specific script on
> the server.
>
> Is it possible ?
>
> I don't know if I need to search an answer at the qmail level or at
> the imap server level.
>
> I'm using qmail with courier-imap.
>
> Thanks,
>
> [1] bash or python script, ...
>
> Regards,
>

Hello Olivier,

That would be an IMAP server specific question. In any case, the only
imap server that i have knowlege it can do such things is dovecot. Very
nice server in terms of security and performance too.

* http://dovecot.org

Regards,

Hugo Monteiro.

--
ci.fct.unl.pt:~# cat .signature

Hugo Monteiro
Email : hugo.monteiro [at] fct
Telefone : +351 212948300 Ext.15307
Web : http://hmonteiro.net

Centro de Informática
Faculdade de Ciências e Tecnologia da
Universidade Nova de Lisboa
Quinta da Torre 2829-516 Caparica Portugal
Telefone: +351 212948596 Fax: +351 212948548
www.ci.fct.unl.pt apoio [at] fct

ci.fct.unl.pt:~# _


olt at tinyerp

Sep 28, 2009, 5:10 AM

Post #3 of 14 (3549 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Shepherd Nhongo wrote:
>
>
> On Mon, Sep 28, 2009 at 11:47 AM, Olivier Laurent <olt [at] tinyerp
> <mailto:olt [at] tinyerp>> wrote:
>
> Hi,
>
> I would like to launch a specific command [1] on a mail server
> whenever a message is moved from one folder into another folder.
>
> For example, a Thunderbird user moves a message from folder A to
> Folder B. I'd like to catch this move and launch a specific script
> on the server.
>
> It's possible but why would you want to do that ? Are you spying on your
> users?

No. I'm creating a bayesian email filter that need to learn on the
message. It's supposed to be very general, not just for spam. The first
level folder is the category. If a message is moved from folder A to
folder B. It has to uncategorize the message as being from category A.
And it has to categorize the message as being from category B.

Regards,

--
Olivier
Developer
OpenERP - Tiny sprl
Chaussée de Namur, 40
B-1367 Gérompont
Tel: +32.81.81.37.00
Web: http://tiny.be


olt at tinyerp

Sep 28, 2009, 5:12 AM

Post #4 of 14 (3553 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Loke wrote:
> Hi,
>
> I think, suppose, this should by under the message rules defined in your
> mail clients.

Thanks for your answer but it has to be on the server and not on each
clients.

Cordialement,

--
Olivier
Développeur
OpenERP - Tiny sprl
Chaussée de Namur, 40
B-1367 Gérompont
Tel: +32.81.81.37.00
Web: http://tiny.be


werner at yellowcouch

Sep 28, 2009, 5:57 AM

Post #5 of 14 (3552 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Olivier Laurent wrote:
> No. I'm creating a bayesian email filter that need to learn on the
> message. It's supposed to be very general, not just for spam. The first
> level folder is the category. If a message is moved from folder A to
> folder B. It has to uncategorize the message as being from category A.
> And it has to categorize the message as being from category B.
I thikn spamassassin solved this by remembering which message it already
saw. So if you have a cron like job that looks into a 'Junk' folder or
so it should be possible to learn the new junk every 10 minutes or so.
Okay, it's not event driven but it will get the job done. Another
option is to take the incoming messages from the Junk folder (in new/)
learn them and move them to cur/ that should do the trick as well.

However, I don't know how you will teach your bayesian filter if there
are no positive marked messages. So aside from Junk you probably also
need something like NotSoVeryMuchJunk and IWishThisWasJunk :-)

Anyway, good luck with it,

--
Dr. Werner Van Belle
http://werner.yellowcouch.org/
Attachments: signature.asc (0.25 KB)


olt at tinyerp

Sep 28, 2009, 6:53 AM

Post #6 of 14 (3546 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Werner Van Belle wrote:
> Olivier Laurent wrote:
>> No. I'm creating a bayesian email filter that need to learn on the
>> message. It's supposed to be very general, not just for spam. The first
>> level folder is the category. If a message is moved from folder A to
>> folder B. It has to uncategorize the message as being from category A.
>> And it has to categorize the message as being from category B.
> I thikn spamassassin solved this by remembering which message it already
> saw. So if you have a cron like job that looks into a 'Junk' folder or
> so it should be possible to learn the new junk every 10 minutes or so.
> Okay, it's not event driven but it will get the job done. Another
> option is to take the incoming messages from the Junk folder (in new/)
> learn them and move them to cur/ that should do the trick as well.
>
> However, I don't know how you will teach your bayesian filter if there
> are no positive marked messages. So aside from Junk you probably also
> need something like NotSoVeryMuchJunk and IWishThisWasJunk :-)
>
> Anyway, good luck with it,

Thank you.

On another mailing list, someone pointed me that I should use inotify [1]

It seems to be the solution I should use. It also have the advantage of
being a general solution and not qmail specific.

So I'll use pyinotify, the python interface.

[1] http://en.wikipedia.org/wiki/Inotify

Regards,

--
Olivier
Developer
OpenERP - Tiny sprl
Chaussée de Namur, 40
B-1367 Gérompont
Tel: +32.81.81.37.00
Web: http://tiny.be


mbhangui at gmail

Sep 28, 2009, 6:55 AM

Post #7 of 14 (3549 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

On Mon, Sep 28, 2009 at 5:40 PM, Olivier Laurent <olt [at] tinyerp> wrote:

> No. I'm creating a bayesian email filter that need to learn on the
> message. It's supposed to be very general, not just for spam. The first
> level folder is the category. If a message is moved from folder A to
> folder B. It has to uncategorize the message as being from category A.
> And it has to categorize the message as being from category B.
>
>
This looks like a very original idea to automatically categorize a message
and maybe later automatically decide which folder the message should belong
to ?

I have taken a look at the courier-imap code. It looks like you will have to
modify imapd.c where the IMAP COPY command is implemented and more
specifically modify the do_msgset() function. The courier-imap mailing list
will be a better place to have your query answered and maybe if it is
interesting for others, some could implement a configurable callback
function

Regards Manvendra - http://www.indimail.org


olt at tinyerp

Sep 28, 2009, 7:19 AM

Post #8 of 14 (3546 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Manvendra Bhangui wrote:
> On Mon, Sep 28, 2009 at 5:40 PM, Olivier Laurent <olt [at] tinyerp
> <mailto:olt [at] tinyerp>> wrote:
>
> No. I'm creating a bayesian email filter that need to learn on the
> message. It's supposed to be very general, not just for spam. The first
> level folder is the category. If a message is moved from folder A to
> folder B. It has to uncategorize the message as being from category A.
> And it has to categorize the message as being from category B.
>
>
> This looks like a very original idea to automatically categorize a
> message and maybe later automatically decide which folder the message
> should belong to ?
>
> I have taken a look at the courier-imap code. It looks like you will
> have to modify imapd.c where the IMAP COPY command is implemented and
> more specifically modify the do_msgset() function. The courier-imap
> mailing list will be a better place to have your query answered and
> maybe if it is interesting for others, some could implement a
> configurable callback function

Thank you.

C is not exactly my cup of tea.

I'm going to use pyinotify which just listen to changes in directory. I
just need to filter all the changes to just the changes I need like
'move out', 'move in'.

Regards,

--
Olivier
Developer
OpenERP - Tiny sprl
Chaussée de Namur, 40
B-1367 Gérompont
Tel: +32.81.81.37.00
Web: http://tiny.be


tschwinge at gnu

Sep 29, 2009, 12:43 AM

Post #9 of 14 (3536 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Hello!

On Mon, Sep 28, 2009 at 02:10:49PM +0200, Olivier Laurent wrote:
> I'm creating a bayesian email filter that need to learn on the
> message. It's supposed to be very general, not just for spam. The first
> level folder is the category. If a message is moved from folder A to
> folder B. It has to uncategorize the message as being from category A.
> And it has to categorize the message as being from category B.

Interesting! Are you writing the whole system from scratch, or has such
an automatic, fuzzy categorizing system already been implemented before?

Please keep us (or at least me) informed about how this works out.


Regards,
Thomas
Attachments: signature.asc (0.19 KB)


olt at tinyerp

Sep 29, 2009, 1:09 AM

Post #10 of 14 (3528 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Thomas Schwinge wrote:
> Hello!
>
> On Mon, Sep 28, 2009 at 02:10:49PM +0200, Olivier Laurent wrote:
>> I'm creating a bayesian email filter that need to learn on the
>> message. It's supposed to be very general, not just for spam. The first
>> level folder is the category. If a message is moved from folder A to
>> folder B. It has to uncategorize the message as being from category A.
>> And it has to categorize the message as being from category B.
>
> Interesting! Are you writing the whole system from scratch, or has such
> an automatic, fuzzy categorizing system already been implemented before?

I'm writing it from scratch using pyinotify [1] and Reverend [2], a
Bayesian classifier.

For the moment, I'm using 2 processes.

One is a daemon that read a named pipe (for performance) where every new
mail is piped from qmail. It classifies new messages into categories
(folders). Messages that don't fall into a category are saved in the
default user folder (INBOX).

The second process is launched from cron every x minutes. It learns
messages already categorized by users.

The current solution is somewhat complicated. It needs editing qmail
configuration and restarting the mail server and is somewhat qmail specific.

But the inotify solution will be more general, won't need editing mail
specific configuration and won't require a mail server restart.

Normally only one process will live. If this process falls, normal email
processing will continue.

> Please keep us (or at least me) informed about how this works out.

I don't know exactly about licensing at the moment. Our company is
normally developping an open source ERP but this software does not fall
under our normal product and I don't know exactly what our manager will
license this software.

If someone is interested by this software, (s)he can contact me at olt
at tinyerp dot com. I'll try to keep him or her informed.

PS: I tryied using popfile [3] but it was not a 100% complete solution
for our customer. That's why I started it from scratch.

[1] http://trac.dbzteam.org/pyinotify
[2] http://www.divmod.org/trac/wiki/DivmodReverend
[3] http://en.wikipedia.org/wiki/POPFile

Regards,

--
Olivier
Developer
OpenERP - Tiny sprl
Chaussée de Namur, 40
B-1367 Gérompont
Tel: +32.81.81.37.00
Web: http://tiny.be


hugo.monteiro at fct

Sep 29, 2009, 3:37 AM

Post #11 of 14 (3529 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Olivier Laurent wrote:
> Thomas Schwinge wrote:
>> Hello!
>>
>> On Mon, Sep 28, 2009 at 02:10:49PM +0200, Olivier Laurent wrote:
>>> I'm creating a bayesian email filter that need to learn on the
>>> message. It's supposed to be very general, not just for spam. The first
>>> level folder is the category. If a message is moved from folder A to
>>> folder B. It has to uncategorize the message as being from category A.
>>> And it has to categorize the message as being from category B.
>>
>> Interesting! Are you writing the whole system from scratch, or has such
>> an automatic, fuzzy categorizing system already been implemented before?
>
> I'm writing it from scratch using pyinotify [1] and Reverend [2], a
> Bayesian classifier.
>
> For the moment, I'm using 2 processes.
>
> One is a daemon that read a named pipe (for performance) where every
> new mail is piped from qmail. It classifies new messages into
> categories (folders). Messages that don't fall into a category are
> saved in the default user folder (INBOX).
>
> The second process is launched from cron every x minutes. It learns
> messages already categorized by users.
>
> The current solution is somewhat complicated. It needs editing qmail
> configuration and restarting the mail server and is somewhat qmail
> specific.
>
> But the inotify solution will be more general, won't need editing mail
> specific configuration and won't require a mail server restart.
>
> Normally only one process will live. If this process falls, normal
> email processing will continue.
>
>> Please keep us (or at least me) informed about how this works out.
>
> I don't know exactly about licensing at the moment. Our company is
> normally developping an open source ERP but this software does not
> fall under our normal product and I don't know exactly what our
> manager will license this software.
>
> If someone is interested by this software, (s)he can contact me at olt
> at tinyerp dot com. I'll try to keep him or her informed.
>
> PS: I tryied using popfile [3] but it was not a 100% complete solution
> for our customer. That's why I started it from scratch.
>
> [1] http://trac.dbzteam.org/pyinotify
> [2] http://www.divmod.org/trac/wiki/DivmodReverend
> [3] http://en.wikipedia.org/wiki/POPFile
>
> Regards,
>

Hello Olivier,

I have not used it myself, but you might want to take a look at CRM114.

* http://crm114.sourceforge.net

Regards,

Hugo Monteiro.

--
ci.fct.unl.pt:~# cat .signature

Hugo Monteiro
Email : hugo.monteiro [at] fct
Telefone : +351 212948300 Ext.15307
Web : http://hmonteiro.net

Centro de Informática
Faculdade de Ciências e Tecnologia da
Universidade Nova de Lisboa
Quinta da Torre 2829-516 Caparica Portugal
Telefone: +351 212948596 Fax: +351 212948548
www.ci.fct.unl.pt apoio [at] fct

ci.fct.unl.pt:~# _


olt at tinyerp

Sep 29, 2009, 4:10 AM

Post #12 of 14 (3528 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Hugo Monteiro wrote:
> I have not used it myself, but you might want to take a look at CRM114.
>
> * http://crm114.sourceforge.net

Thank you. I'll take a look at it.

Regards,

--
Olivier
Developer
OpenERP - Tiny sprl
Chaussée de Namur, 40
B-1367 Gérompont
Tel: +32.81.81.37.00
Web: http://tiny.be


werner at yellowcouch

Sep 29, 2009, 6:40 AM

Post #13 of 14 (3523 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Thomas Schwinge wrote:
> Interesting! Are you writing the whole system from scratch, or has such
> an automatic, fuzzy categorizing system already been implemented before?
>
Yes 'Bow' does this quite well actually. The automatic categorization is
done by either crossbow or bowtie (one of the two, I'm not sure why they
uised such ridicoulous names anyway :-)

http://www.cs.cmu.edu/~mccallum/bow/

Wkr,

--
Dr. Werner Van Belle
http://werner.yellowcouch.org/
Attachments: signature.asc (0.25 KB)


olt at tinyerp

Sep 29, 2009, 11:10 PM

Post #14 of 14 (3512 views)
Permalink
Re: Triggering a server action on a specific event [In reply to]

Werner Van Belle wrote:
> Thomas Schwinge wrote:
>> Interesting! Are you writing the whole system from scratch, or has such
>> an automatic, fuzzy categorizing system already been implemented before?
>>
> Yes 'Bow' does this quite well actually. The automatic categorization is
> done by either crossbow or bowtie (one of the two, I'm not sure why they
> uised such ridicoulous names anyway :-)
>
> http://www.cs.cmu.edu/~mccallum/bow/

That seems interesting too. Thanks for the info.

Regards,

--
Olivier
Developer
OpenERP - Tiny sprl
Chaussée de Namur, 40
B-1367 Gérompont
Tel: +32.81.81.37.00
Web: http://tiny.be

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.