Moving the source code to github

Starting with v1.2.1 currently under development,subversion is replaced by the more modern git source control tool.

It’s also the opportunity to split the source code into two distinct repositories for the user interface and mdx,since they can be worked on independently. A third repository should follow  for the documentation.

The master branches for both programs are accessible at:
https://github.com/manitou-mail/manitou-mail-ui and https://github.com/manitou-mail/manitou-mail-mdx

The subversion repository at SourceForge.Net is still accessible,but from now on it will probably see commits only on releases.

The github service also has an issue tracker,a wiki and other things that might get used over time,we’ll see.

Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • FriendFeed
  • RSS

Version 1.2.0 released

Version 1.2.0 is now available for download.
What’s new?

  • More functions are available in the filter expressions:age(),date(),date_utc(),now(),now_utc(),identity(),rawsize().
  • New equality and inequality operators for numeric comparisons.
  • A mdx plugin to modify headers of outgoing mail with dynamic contents.
  • A new incarnation of the attach_uploader plugin that supports ssh for file transfers.
  • Migration to new Qt assistant and compatibility fixes for Qt-4.7 and 4.8.
  • Drag and drop for attached files in the mail composer.
  • A new dynamic column for recipients in the messages list.
  • Many improvements in the filter editor:filters can now be reordered and tested from within the interface,and the user interface for actions has been redesigned.
  • New filter actions:Set identity,set header,remove header.
Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • FriendFeed
  • RSS

Quick resend functionality

Sometimes a message that has been previously sent needs to be sent again. The normal way to do that is to recompose a new message by copying the contents of the old one. This leads to a new message with identical contents except for the Date and Message-Id header fields.
However,there is a quicker way to re-send an outgoing message without the need to create a duplicate of the original:if the Sent and Archived bit of the message status are cleared,manitou-mdx will just pick up again the message for sending as if it was new. To clear these bits,use the Message->Properties command and check No in the boxes drawn with the red border in the screenshot:

Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • FriendFeed
  • RSS

Acting on all tagged messages except some

Recently I wanted to reduce the size of my main manitou-mail database,and thus I’ve decided to delete all the messages I’ve received from some mailing-lists. I know these messages are archived elsewhere,so that I could re-import them if needed anyway.
But I didn’t like the idea of deleting also the messages that I’ve sent to these mailing-lists,because it would have broken the rule I’ve adopted of keeping all sent messages. Also on second thought,I thought it would be best to include also the whole threads in which I’ve participated,so that the context of the messages would still be available (BTW,the entire thread to which a message belongs can be recalled in the user interface by the contextual menu command:“Show thread on new page”).

So the question was,how to select all the messages tagged with certain tags,but excluding all threads for which at least one message has the Sent status? As usual,the database and the SQL come to help. First I looked up the tag_id’s of the tags corresponding to the mailing-lists,let’s say they were 3,6 and 10. And then I just expressed in SQL the sentence above. The result is:
SELECT mt.mail_id FROM mail_tags mt JOIN mail m1 USING (mail_id) WHERE tag IN (3,6,10) AND NOT EXISTS (SELECT 1 FROM mail m2 WHERE m2.thread_id=m1.thread_id AND m2.status&128!=0)

After issuing this query with the selection dialog,with the Limit To field empty to ensure that all messages are retrieved,all that was needed to accomplish the task was to select all the messages in the resulting list (Ctrl-A) and hit the Del key.

Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • FriendFeed
  • RSS

Manitou-Mail for Mac OS X

For you Mac users out there,I’m glad to announce that the Manitou-Mail interface is now available for Mac OS X,thanks to Adebe Networks that funded the work for the port and TLK Games who lent their Mac machine. The application bundle is available here:manitou-1.1.0.dmg (42Mb,with Qt-4.7 and libpq5 compiled with ssl support). Enjoy!

Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • FriendFeed
  • RSS

Version 1.1.0

Manitou-Mail version 1.1.0 is now available. What’s new? Mostly,the mail merge capabilities for sending mailings to potentially large lists of users. Mailing templates and run-time information are stored in the database,and while the actual sending is done server-side,it can be monitored from the user interface.
Mailings can be html or text only or both,and may use placeholders with contents imported from CSV files.

Additionally,the UI now uses the new full text search function for faster results.

This time,there’s a deb package for manitou-mdx that is expected to work with all reasonably recent debian/ubuntu releases,and another deb package for the user interface,which is created for ubuntu 10.
See the download page.

Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • FriendFeed
  • RSS

Monitoring manitou-mdx with Nagios

While manitou-mdx can be monitored with a stand-alone Perl program,most sysadmins prefer integrated tools such as Nagios.
For those who want to monitor manitou-mdx with Nagios,the wiki now hosts a manitou-mdx plugin.
It is based on the same logic than the stand-alone program:every ‘alive_interval‘seconds as defined in its configuration file,manitou-mdx updates the ‘last_alive’entry in the ‘runtime_info‘table. So whenever this entry has not been updated for significantly longer than ‘alive_interval‘seconds,it means that either manitou-mdx is no longer running,or it’s not able to function properly for some reason that needs to be investigated.

Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • FriendFeed
  • RSS

Removing unused filters

For manitou-mail installations that use a lot of filters,it may be a good idea to check from time to time which ones are still useful and which ones are unused.
Since all the filters are evaluated for each incoming message (except if a stop action is encountered),keeping around a large number of obsolete filters may have an adverse impact on CPU usage.
Fortunately,manitou-mdx gathers statistics on filter hits,so it’s easy to find out which filters no longer generate any hit,with the help of some SQL.
Let’s start with a query that retrieve filters that never had any hit:

SELECT expr_id,name FROM filter_expr LEFT JOIN filter_log USING (expr_id) WHERE filter_log.expr_id is null;

Now it may be that some of the filters returned by this query are new so that no hit on them occurred yet. We need to filter out these by adding a condition on the last_update field,requesting that the filter hasn’t been modified or created as new since at least 3 months.
Also,we only want entries from filter_expr that have actions tied on them,because filters without actions can be used as sub-expressions (that’s advanced filter usage) and don’t generate any hit.
With these additional conditions,the query becomes:

SELECT DISTINCT expr_id,name from filter_action JOIN filter_expr USING (expr_id) LEFT JOIN filter_log using (expr_id) WHERE filter_log.expr_id is null AND filter_expr.last_update<now()-'3 months'::interval;

With the query above we can check in advance what we’re about to delete.

Now,the deletion itself needs two steps,one for the filter_action table and another for filter_expr. Since both tables are joined in the query,we need a preliminary step to save the expr_id to delete into a temporay table. The SQL sequence including the transaction is:

BEGIN;

CREATE TEMPORARY TABLE del_expr AS
SELECT DISTINCT expr_id from filter_action JOIN filter_expr USING (expr_id)
LEFT JOIN filter_log using (expr_id)
WHERE filter_log.expr_id is null
AND filter_expr.last_update<now()-'3 months'::interval;

DELETE FROM filter_action WHERE expr_id IN (SELECT expr_id from del_expr);

DELETE FROM filter_expr WHERE expr_id IN (SELECT expr_id from del_expr);

COMMIT;

To additionally delete the filters that haven’t been used for a significant period of time (for example one year),they could be added to our temporary table before the above deletion:

INSERT INTO del_expr SELECT expr_id
FROM filter_log GROUP BY expr_id
HAVING max(hit_date)<now()-'1 year'::interval)

Happy filters cleaning!

Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • FriendFeed
  • RSS

Word search in SQL

The current version of manitou-mail uses C++ code inside the interface to deal with the inverted word index. There is also a Perl version in the Manitou::Words module (see sub search),but so far it wasn’t possible to issue a search directly from inside an SQL query,making it hard to combine the results with other criteria.
I’m glad to say that it’s now possible,by using a new wordsearch() function implemented in pl/pgsql.
This opens up the possibility of doing some interesting custom queries,such as for example:

SELECT mail_id,subject,msg_date
FROM mail m
JOIN (SELECT * FROM wordsearch(array['foo','bar']) AS id) s ON (m.mail_id=s.id)
WHERE m.status&16=0 AND msg_date>now()-'1 year'::interval;

This query retrieves the messages that contain both ‘foo’and ‘bar’,excluding those that are in the trashcan,and those that are more than one year old.
This should be pretty fast,too. This one runs for me in 0.4s on a database containing about 47000 messages.
Not only this kind of query can be launched by any custom program using the mail database,but it can also be saved inside the manitou-mail user interface as a “user query”and be accessible from the quick selection panel.

The code will be shipped with future versions of manitou,but in the meantime the function source code is available in the wiki.

Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • FriendFeed
  • RSS

Debian/Ubuntu packages update

As of today,manitou-mdx is available as a package for Ubuntu 9/10 and Debian stable (lenny). Also,a slight change in how it’s installed makes it more portable across different Debian/Ubuntu releases. Until now,I used
perl Makefile.PL DESTDIR='' PREFIX=/usr
to create the Makefile. When using this command,the *.pm files typically get installed into /usr/share/perl/5.x.y/Manitou,a directory that is specific to Perl’s minor version. Since major releases of Debian or Ubuntu tend to come with an upgraded version of Perl,it followed that a manitou-mdx package for Debian Etch couldn’t be used for Debian Lenny,or any current Ubuntu release.

As explained in this use perl;answer,packagers of Perl programs should generate their Makefiles with:
perl Makefile.PL INSTALLDIRS=vendor

When so doing,manitou-mdx library files get installed into /usr/share/perl5/Manitou,a location that stays the same across Linux distro releases. So hopefully the .deb for manitou-mdx available since today should work with debian etch,lenny and the current ubuntu versions 9.x and 10.x.

Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • FriendFeed
  • RSS