<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Manitou-Mail Blog &#187; Usage</title>
	<atom:link href="http://www.manitou-mail.org/blog/category/usage/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.manitou-mail.org/blog</link>
	<description>on the use and development of the Manitou-Mail program</description>
	<lastBuildDate>Tue, 10 Jan 2012 13:31:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Quick resend functionality</title>
		<link>http://www.manitou-mail.org/blog/2011/11/quick-resend-functionality/</link>
		<comments>http://www.manitou-mail.org/blog/2011/11/quick-resend-functionality/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 16:51:23 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Usage]]></category>
		<category><![CDATA[User Interface]]></category>

		<guid isPermaLink="false">http://www.manitou-mail.org/blog/?p=196</guid>
		<description><![CDATA[<p>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 [...]]]></description>
			<content:encoded><![CDATA[<p>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.<br />
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-&gt;Properties command and check No in the boxes drawn with the red border in the screenshot:<br />
<a href="http://www.manitou-mail.org/blog/wp-content/uploads/2011/11/Screenshot-Properties.png"><img src="http://www.manitou-mail.org/blog/wp-content/uploads/2011/11/Screenshot-Properties.png" alt="" width="236" height="432" class="aligncenter size-full wp-image-197" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.manitou-mail.org/blog/2011/11/quick-resend-functionality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Acting on all tagged messages except some</title>
		<link>http://www.manitou-mail.org/blog/2011/10/acting-on-all-tagged-messages-except-some/</link>
		<comments>http://www.manitou-mail.org/blog/2011/10/acting-on-all-tagged-messages-except-some/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 20:03:30 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Usage]]></category>

		<guid isPermaLink="false">http://www.manitou-mail.org/blog/?p=188</guid>
		<description><![CDATA[<p>Recently I wanted to reduce the size of my main manitou-mail database, and thus I&#8217;ve decided to delete all the messages I&#8217;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&#8217;t like the idea of deleting also the messages that I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I wanted to reduce the size of my main manitou-mail database, and thus I&#8217;ve decided to delete all the messages I&#8217;ve received from some mailing-lists. I know these messages are archived elsewhere, so that I could re-import them if needed anyway.<br />
But I didn&#8217;t like the idea of deleting also the messages that I&#8217;ve sent to these mailing-lists, because it would have broken the rule I&#8217;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&#8217;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: &#8220;Show thread on new page&#8221;).</p>
<p>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 <em>Sent</em> status? As usual, the database and the SQL come to help. First I looked up the tag_id&#8217;s of the tags corresponding to the mailing-lists, let&#8217;s say they were 3,6 and 10. And then I just expressed in SQL the sentence above. The result is:<br />
<code>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&amp;128!=0)</code></p>
<p>After issuing this query with the selection dialog, with the <em>Limit To</em> 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.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manitou-mail.org/blog/2011/10/acting-on-all-tagged-messages-except-some/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing unused filters</title>
		<link>http://www.manitou-mail.org/blog/2011/05/removing-unused-filters/</link>
		<comments>http://www.manitou-mail.org/blog/2011/05/removing-unused-filters/#comments</comments>
		<pubDate>Wed, 11 May 2011 22:14:05 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Usage]]></category>

		<guid isPermaLink="false">http://www.manitou-mail.org/blog/?p=153</guid>
		<description><![CDATA[<p>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 [...]]]></description>
			<content:encoded><![CDATA[<p>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.<br />
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.<br />
Fortunately, manitou-mdx gathers statistics on filter hits, so it&#8217;s easy to find out which filters no longer generate any hit, with the help of some SQL.<br />
Let&#8217;s start with a query that retrieve filters that never had any hit:</p>
<blockquote><p><code>SELECT expr_id,name FROM filter_expr LEFT JOIN filter_log USING (expr_id) WHERE filter_log.expr_id is null;</code></p></blockquote>
<p>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&#8217;t been modified or created as new since at least 3 months.<br />
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&#8217;s advanced filter usage) and don&#8217;t generate any hit.<br />
With these additional conditions, the query becomes:</p>
<blockquote><p><code>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&lt;now()-&#039;3 months&#039;::interval;<br />
</code></p></blockquote>
<p>With the query above we can check in advance what we&#8217;re about to delete.</p>
<p>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:</p>
<blockquote><p><code>BEGIN;</p>
<p>CREATE TEMPORARY TABLE del_expr AS<br />
SELECT DISTINCT expr_id from filter_action JOIN filter_expr USING (expr_id)<br />
 LEFT JOIN filter_log using (expr_id)<br />
 WHERE filter_log.expr_id is null<br />
 AND filter_expr.last_update&lt;now()-&#039;3 months&#039;::interval;</p>
<p>DELETE FROM filter_action WHERE expr_id IN (SELECT expr_id from del_expr);</p>
<p>DELETE FROM filter_expr WHERE expr_id IN (SELECT expr_id from del_expr);</p>
<p>COMMIT;</code>
</p></blockquote>
<p>To additionally delete the filters that haven&#8217;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:</p>
<blockquote><p><code>INSERT INTO del_expr SELECT expr_id<br />
 FROM filter_log GROUP BY expr_id<br />
 HAVING max(hit_date)&lt;now()-&#039;1 year&#039;::interval)</code></p></blockquote>
<p>Happy filters cleaning!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manitou-mail.org/blog/2011/05/removing-unused-filters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Routing outgoing mail in manitou-mdx</title>
		<link>http://www.manitou-mail.org/blog/2009/10/routing-outgoing-mail-in-manitou-mdx/</link>
		<comments>http://www.manitou-mail.org/blog/2009/10/routing-outgoing-mail-in-manitou-mdx/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 21:25:14 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Usage]]></category>
		<category><![CDATA[manitou-mdx]]></category>

		<guid isPermaLink="false">http://www.manitou-mail.org/blog/?p=111</guid>
		<description><![CDATA[<p>The default command invoked as the delivery agent for manitou-mdx is `sendmail -f $FROM$ -t` where $FROM$ is replaced by the sender&#8217;s email address, which matches whats is called the sender&#8217;s identity in Manitou-Mail. On a typical Unix system, this command generally corresponds to the Mail Submission Agent that is installed and responsible for routing [...]]]></description>
			<content:encoded><![CDATA[<p>The default command invoked as the delivery agent for manitou-mdx is `<code>sendmail -f $FROM$ -t</code>` where $FROM$ is replaced by the sender&#8217;s email address,  which matches whats is called the sender&#8217;s identity in Manitou-Mail. On a typical Unix system, this command generally corresponds to the <a href="http://en.wikipedia.org/wiki/Mail_submission_agent">Mail Submission Agent</a> that is installed and responsible for routing the outgoing messages. The sendmail name doesn&#8217;t necessarily imply that the MSA is the <a href="http://www.sendmail.org">sendmail SMTP server</a> itself, it can be <a href="http://www.postfix.org">postfix</a>, or <a href="http://www.exim.org">exim</a>, or <a href="http://esmtp.sourceforge.net">esmtp</a>, or other programs that have adopted the same name and command line arguments for historical reasons and for the sake of interoperability.<br />
Anyway in manitou-mdx, if this default command is not suitable, the administrator can replace it either globally, or per sender&#8217;s identity. A sender&#8217;s identity is declared in manitou-mdx configuration file by simply declaring a mailbox with its email address. In the Manitou-Mail user interface, the sender&#8217;s identities are configured in the preferences and choosed in the composer.</p>
<p>A typical reason to use different delivery agents when using different identities is that messages may have to be routed to different SMTP servers with different authorization methods. For example, some servers will simply reject messages that have an unexpected From address.<br />
Also there are other cases such as messages from a GMail address that should be routed to a Google SMTP server in order to be signed with a proper <a href="http://www.dkim.org/">DomainKeys</a> header field.<br />
Indeed, while it&#8217;s not mandatory, some receivers may pre-sort as spam or reject messages from GMail addresses that are not signed as the Google SMTP servers do with a DomainKey signature (not trusing these messages being the point of DKIM). Let&#8217;s see how to route messages written in Manitou-Mail from a GMail address to Google SMTP servers.<br />
I&#8217;ve used <a href="http://msmtp.sourceforge.net">msmtp</a> for a simple, easy to configure Mail Submission Agent. <a href="http://esmtp.sourceforge.net/">esmtp </a>is also a candidate but its debian package makes it an alternative to postfix and I happen to want it to supplement postfix, not replace it. msmtp, on the other hand, is a supplementary package that doesn&#8217;t conflict with the default MSA.</p>
<p>The procedure to use msmtp is quite simple:<br />
Create a $HOME/.certs directory if none already exists.<br />
Create a $HOME/.msmtprc file (with perm 0600) containing:<br />
<code><br />
# gmail account<br />
auth on<br />
host smtp.gmail.com<br />
port 587<br />
user USERNAME@gmail.com<br />
password XXXXXX<br />
from USERNAME@gmail.com<br />
tls on<br />
tls_trust_file /home/daniel/.cert/ThawtePremiumServerCA.crt<br />
</code><br />
Obviously USERNAME is to be replaced by your GMail login.<br />
The cert file is to be extracted from the set of Thawte certificates available at: <a href="https://www.verisign.com/support/thawte-roots.zip">https://www.verisign.com/support/thawte-roots.zip</a>, with this command:<br />
<code><br />
unzip -p thawte-roots.zip 'Thawte SSLWeb Server Roots/thawte Premium Server CA/Thawte Premium Server CA.pem' &gt; ~/.certs/ThawtePremiumServerCA.crt<br />
</code></p>
<p>And in manitou-mdx&#8217;s configuration file, we have something like:<br />
<code><br />
[common]<br />
# various things<br />
[USERNAME@gmail.com]<br />
local_delivery_agent = msmtp -f $FROM$ -t<br />
</code></p>
<h3><strong><strong>UPDATE</strong></strong>:</h3>
<p>the mentioned certificate is no longer accepted, now we should use Equifax_Secure_CA.crt. I located the file in the debian package named &#8220;ca-certificates&#8221;, so changing my .smtprc to:</p>
<p><code>tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.manitou-mail.org/blog/2009/10/routing-outgoing-mail-in-manitou-mdx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Face header support</title>
		<link>http://www.manitou-mail.org/blog/2009/10/face-header-support/</link>
		<comments>http://www.manitou-mail.org/blog/2009/10/face-header-support/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 01:26:53 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[New features]]></category>
		<category><![CDATA[Usage]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.manitou-mail.org/blog/?p=93</guid>
		<description><![CDATA[<p>While the X-Face header (48&#215;48 BW picture) has been supported for a long time in the Manitou-Mail user interface, the Face header (48&#215;48 color PNG) was not until yesterday. Now it is, and while testing the code, I&#8217;ve found that it was another case where an SQL query quickly solved a practical selection problem. The [...]]]></description>
			<content:encoded><![CDATA[<p>While the <a href="http://en.wikipedia.org/wiki/X-Face">X-Face header</a> (48&#215;48 BW picture) has been supported for a long time in the Manitou-Mail user interface, the <a href="http://quimby.gnus.org/circus/face/">Face header</a> (48&#215;48 color PNG) was not until yesterday.<br />
Now it is, and while testing the code, I&#8217;ve found that it was another case where an SQL query quickly solved a practical selection problem. The Face header is indeed not so widely used, so getting a significant sample of different pictures to show is not obvious. Ideally I wanted to extract from my mail archive a gallery of pictures that would be all different. That is, if someone had posted 1000 messages with the same Face header, I wasn&#8217;t interested in getting all those messages, only one of them, let&#8217;s say the first by it&#8217;s ID, and I wanted the next mail in the list to be with a different, non-empty Face, and so on for every message that I wanted to look at. It turns out, that in SQL, it can be expressed with:</p>
<p><code>SELECT min(mail_id)<br />
 FROM header<br />
WHERE position(E'\nFace: ' in lines)&gt;0<br />
GROUP BY<br />
 split_part(substr(lines, position(E'\nFace: ' in lines)+7, 1300), E'\n', 1)<br />
</code><br />
position(&#8230;) let us know where the Face header field begins, substr(&#8230;) extracts a sufficient length of it, and split_part(&#8230;) cuts exactly the value at the first newline which marks the end of this header&#8217;s value (they&#8217;re unfolded in the header table precisely to be able to perform that kind of extraction).<br />
Finally the GROUP BY ensures that each row in the result represents a distinct value of the Face header.</p>
<p>This query can be directly input into the SQL statement field of the Query Selection dialog, after which all there is to do is wait for the database engine to run it to completion.</p>
<p>On my sample database of about 800,000 messages from various mailing lists, it turned out that the result was a list of 176 messages. Here is a collage of a selection of the pictures (public messages only).<br />
<img src="http://www.manitou-mail.org/blog/wp-content/uploads/2009/10/face-gallery.png" alt="face-gallery" width="426" height="733" class="aligncenter size-full wp-image-94" /><br />
Here is how one particular message looks with its Face header:<br />
<img src="http://www.manitou-mail.org/blog/wp-content/uploads/2009/10/face-sample-msg.png" alt="face-sample-msg" width="479" height="164" class="aligncenter size-full wp-image-101" /><br />
Right now this is just about displaying, sometime in the future I&#8217;ll try to add Face headers to outgoing mail, and also I&#8217;d like to associate pictures to sender addresses so that messages from people who don&#8217;t use a Face header (the majority) still can be shown with a dedicated picture. I feel like even tags or sender domains (which means companies and organizations), could benefit from that kind of visual representation in certain cases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manitou-mail.org/blog/2009/10/face-header-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

