Help → use sent-mail folder to train POPFile

use sent-mail folder to train POPFile

I'm using POPFile IMAP and I've my buckets set up so that only urgent/important email stays in my inbox and all other things are moved to other folders.

I would like to improve POPFile's accuracy by telling it that the "sent" folder contains words that should be treated as if they were in the "inbox" folder. In other words, if I receive a reply to an email that I sent (and which will most likely contain my previous email as part of its body), POPfile should sort this email into the inbox. Or rather: I want to increase the likelyhood for this reply to be sorted into the inbox by adding all words in the Sent-mail folder to the statistics of the inbox-bucket. Do you know what I mean?

As far as I can see, there is no way of doing this out of the box, but maybe this can be done through a little hack? Unfortunately, I don't know Perl, but if someone can point me to what file would need to be changed in what way, I might be able to figure it out...

Of course, it would be great if this could be added as a feature in a future release, but I don't want to ask too much of the few developers that are left...

  • Message #1961

    I would like to improve POPFile's accuracy by ... adding all words in the Sent-mail folder to the statistics of the inbox-bucket.

    The 'insert.pl' script may do what you want.

    This script is shipped with POPFile and it is mentioned in the online manual: "insert.pl utility script"

    I do not know if anyone has tested this idea before. I am not sure this is a good idea - but I might be wrong!

    I recommend you make a backup copy of your POPFile database (popfile.db) before you try this script. If you do not get the results you expect then you can simply restore the backup copy of your database.

  • Message #1964

    The 'insert.pl' script may do what you want.

    I should have mentioned that I want this classification to happen on a continuous basis. So insert.pl alone won't do the trick. Maybe some of the code from insert.pl could be used for the hack, but I'm not sure this is the right way to go. I'd rather use the existing scripts that are used to monitor the defined folder(s) and to classify incoming mail.

    There is already a possibility to add additional watched folders, so I can add my sent-mail folder there. The problem is that POPfile will then process these sent mails just like the ones in the inbox and sort them into buckets. So it needs to stop before it gets to that stage and instead do a much simpler procedure, which is to simply treat them as classified in the inbox bucket.

    Actually, as I'm thinking about this, I guess what needs to be done with those emails is simply a reclassify (to inbox). Done. For once it would be an advantage that the reclassify function does not actually move the emails into another folder!

    Hey, that shouldn't be too difficult to put together? The reclassify function is in IMAP.pm (lines 710-773). But how to use it on a new message in a specific watched folder?