Try:

struct stat filesize_stat;
char filesize_str[30];

if ( !fstat(0, &filesize_stat) && filesize_stat )
    if ( sprintf(filesize_str, "%i", filesize_stat.st_size) )
       env_put2("MESSAGESIZE", filesize_str);

Warning: This is not debugged, just off the top of my head.

 - David Harris
   Principal Engineer, DRH Internet Services


-----Original Message-----
From:   [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent:   Monday, June 28, 1999 10:54 AM
To:     [EMAIL PROTECTED]
Subject:        new environment variable for qmail-local!!

hi,

some days ago i posted to this list asking for the possibility to add a
environment variable to qmail-local.
here again my question:
anybody got an idea how to add an environment variable MESSAGESIZE to
qmail-local? this would be great
for message routing depending on their size.
i tried this with several `wc -c` commands but it's is not a good
approach. working with env var. would be
much more better!

i am a poor programmer so i do not have any idea how to add this feature
to qmail-local. i had a look into
the sources and i found the place where all the other env. var. are set.
i think it must be easy for a skilled
programmer to add a system-call getting the message size from the file
in the mess directory!

regards
jodok

Reply via email to