<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">
<channel>
    <title>Mike's sudden inspirations - SYS</title>
    <link>http://blog.iworks.at/</link>
    <description>Geek; Keep Away</description>
    <dc:language>en</dc:language>
    
    <generator>Serendipity 0.9 - http://www.s9y.org/</generator>
    <pubDate>Tue, 13 Jan 2009 23:21:25 GMT</pubDate>

    <image>
        <url>http://blog.iworks.at/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Mike's sudden inspirations - SYS - Geek; Keep Away</title>
        <link>http://blog.iworks.at/</link>
        <width>100</width>
        <height>21</height>
    </image>
<item>
    <title>Vpopmail and people reaching their maildir quota</title>
    <link>http://blog.iworks.at/?/archives/64-Vpopmail-and-people-reaching-their-maildir-quota.html</link>
<category>SYS</category>    <comments>http://blog.iworks.at/?/archives/64-Vpopmail-and-people-reaching-their-maildir-quota.html#comments</comments>
    <wfw:comment>http://blog.iworks.at/wfwcomment.php?cid=64</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.iworks.at/rss.php?version=2.0&amp;type=comments&amp;cid=64</wfw:commentRss>
    <author>nospam@example.com (Mike)</author>
    <content:encoded>
&lt;p&gt;This tiny program lists all users of a domain with a maildir quota usage above 90%.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

#include &amp;lt;pwd.h&amp;gt;
#include &amp;lt;errno.h&amp;gt;

#include &amp;lt;vpopmail.h&amp;gt;
#include &amp;lt;vauth.h&amp;gt;

int main(int argc, char **argv) {
    struct vqpasswd *user;
    char dir[1024];
    uid_t uid;
    gid_t gid;
    int offset_counter = -1, sort = 1, usage;

    if (argc != 2) {
        fprintf(stderr, &amp;quot;Usage: %s &amp;lt;domain&amp;gt;\n&amp;quot;, argv[0]);
        return EXIT_FAILURE;
    }
    if (vget_assign(argv[1], NULL, 0, &amp;amp;uid, &amp;amp;gid) == NULL) {
        fprintf(stderr, &amp;quot;domain '%s' does not exist\n&amp;quot;, argv[1]);
        return EXIT_FAILURE;
    }
    if (setgid(gid) || setuid(uid)) {
        fprintf(stderr, &amp;quot;could not setuid/setgid to %d:%d\n&amp;quot;, uid, gid);
        return EXIT_FAILURE;
    }

    while (NULL != (user = vauth_getall(argv[1], !++offset_counter, sort))) {
        if (strcmp(user-&amp;gt;pw_shell, &amp;quot;NOQUOTA&amp;quot;)) {
            snprintf(dir, sizeof(dir), &amp;quot;%s/Maildir&amp;quot;, user-&amp;gt;pw_dir);
            usage = vmaildir_readquota(dir, 
                format_maildirquota(user-&amp;gt;pw_shell));

            if (usage &amp;gt;= 90) {
                printf(&amp;quot;%s %s %d\n&amp;quot;, user-&amp;gt;pw_name, user-&amp;gt;pw_shell, usage);
            }
        }
    }

    return EXIT_SUCCESS;
}&lt;/code&gt;&lt;/pre&gt;

    </content:encoded>
                
    <pubDate>Tue, 18 Nov 2008 13:25:25 +0100</pubDate>
    <guid isPermaLink="false">http://blog.iworks.at/?/archives/64-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nd/2.5/</creativeCommons:license></item>
<item>
    <title>Qmail + SpamAssassin + selectivity</title>
    <link>http://blog.iworks.at/?/archives/63-Qmail-+-SpamAssassin-+-selectivity.html</link>
<category>SYS</category>    <comments>http://blog.iworks.at/?/archives/63-Qmail-+-SpamAssassin-+-selectivity.html#comments</comments>
    <wfw:comment>http://blog.iworks.at/wfwcomment.php?cid=63</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.iworks.at/rss.php?version=2.0&amp;type=comments&amp;cid=63</wfw:commentRss>
    <author>nospam@example.com (Mike)</author>
    <content:encoded>
&lt;p&gt;Here's how my qmail-queue script looks like to selectively check messages with SpamAssassin for non-relay clients only:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
#!/bin/sh
(if [ -n &amp;quot;${RELAYCLIENT+1}&amp;quot; -o `id -u` != 64011 ]; \
    then cat -; \
    else /usr/bin/spamc -x -U /var/run/spamd/spamd.sock; \
fi) | /usr/sbin/qmail-queue.orig&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For the records.&lt;/p&gt;

    </content:encoded>
                
    <pubDate>Tue, 18 Nov 2008 13:18:44 +0100</pubDate>
    <guid isPermaLink="false">http://blog.iworks.at/?/archives/63-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nd/2.5/</creativeCommons:license></item>
</channel>
</rss>
