AW: [Avcheck] Spamassassin & Avcheck with Postfix

Michael Tokarev mjt@tls.msk.ru
Mon, 09 Dec 2002 02:06:42 +0300


Martin Jaggi wrote:
> Thanks for your replay.
> 
> 
>>Hmm...  No, postfix does NOT cut random pieces in SMTP.  The 
>>problem is NOT inside postfix.
> 
> There is no limit in the length of the parameters in master.cf ? With spamc
> and avcheck, the line is very long.. Perhaps a buffer is to small..

There is no *random* limit.  In postfix, all is dynamically-allocated and is
of necessary size.  Operating system has limits on command-line length, but
e.g. on linux, this is something near 128Kb - which is quite a long command
line, I'd say!.. ;)  For example, avcheck spawned via master.cf/pipe currently
handles mails sent from this avcheck@ mailinglist - there are 100s of subscribers,
and all recipient addresses are goes into command line, one after another.  I've
set limit of 2000 recipients at a time for avcheck transport in my main.cf.
That to say - your command line with only ONE recipient (yes it's a long one)
cannot be greather than the command line of avcheck when it handles a big
number of recipients all at once...

>>bad.  Verified this using sender address shown above and my address as
>>recipient.
> 
> Avcheck alone is no problem, I think it does not get the full address from
> spamc. 

And this is really strange, since spamc + `sendmail -i' works (but sendmail's
command line is shorter anyway).  Hmm.  Did you tried the same with a list
of addresses, or with one _really_ long recipient - so that it's length will
be greather than difference between sendmail and avcheck command lines?
It's easy to create one using address extensions.

>>I think the best is to try to find WHERE the bug - and yes 
>>this is a bug - is.
>>If you're able to do little programming, add a code to both 
>>spamc and avcheck
>>to log a command line in order to see who's doing this bad thing.
> 
> I'll try, but I don't have much coding experience with c. 

In order to log a command line inside avcheck, add the following
code right before the line

   while((c = getopt(argc, argv, "t:f:d:s:S:ni:cw:h:g:")) != EOF)

in main() routine (this should be line  #790):

{
   FILE *f = fopen("/tmp/avcheck.args", "a");
   int i;
   for(i = 1; i < argc; ++i)
    fprintf(f, " >%s<", argv[i]);
   putc('\n', f);
   fclose(f);
}

This code will create a file named /tmp/avcheck.args and
will write avcheck's command line to it, surrounding every
arguments by ><, like:
  >-f< >sender@domain.tld< >-s< >drweb:/...< ...

This is an ugly hack, it's insecure, it will break when two
or more avchecks will start etc etc etc, but it's enouth to
see which arguments gets passed to avcheck.

>>I'm sorry I can't help you here directly as I don't have a 
>>time to install
>>spamassassin, but I'm very interested to find out where the bug is.
> 
> If I found the bug, I'll post it here.


Thanks.

/mjt