-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

it gave me a bit of trouble to actually implement the splitting. Here's 
what I did (after creating a qmail2 and qmail3 trees):

1. Have a 
:alias-mailsize
catchall entry in qmail/control/virtualdomains.
2. In ~alias/.qmail-mailsize-default, I have
|./maildecide

maildecide is a program I have written in C which counts the bytes, 
rewinds stdin and invokes /var/qmail{2,3}/bin/forward. I didn't 
succeed with condredirect - it fails to pass the $HOST to the 
redirected address.

maildecide.c looks like this:
#include <stdio.h>
#include <stdlib.h>

void main(void)
{
        int len=0;
        while (!feof(stdin))
        { fgetc(stdin); len++; }
        rewind(stdin);

        if (len>=128000)
         system("/var/qmail3/bin/forward \"$DEFAULT@$HOST\"");
        else
         system("/var/qmail2/bin/forward \"$DEFAULT@$HOST\"");
}


I would like to hear comments on efficiency of this solution. (I am 
also deciding what to do to get rid of the
Delivered-To: [EMAIL PROTECTED]
line in the headers.)

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.0.2 -- QDPGP 2.60 
Comment: http://community.wow.net/grt/qdpgp.html

iQA/AwUBOIYk2FMwP8g7qbw/EQK1ZwCg4QFKCoXW06YVByDNdnehCrISGP8AmwVv
DpfBRCX3L4m9zN8tn19Zn5+E
=+6Oh
-----END PGP SIGNATURE-----
--
Petr Novotny, ANTEK CS
[EMAIL PROTECTED]
http://www.antek.cz
PGP key ID: 0x3BA9BC3F
-- Don't you know there ain't no devil there's just God when he's drunk.
                                                             [Tom Waits]

Reply via email to