On Mon, 2010-07-05 at 02:31 -0400, Dan Mahoney wrote:
> The greater problem is, that if for some reason spamassasin doesn't run
> (for example, a spamc timeout(*)) it produces exactly the same effect.
>
> Is there a way to have spamassasin/dspamd not scan messages above a
> certain size, but still add headers (i.e. x-spam-status: skipped)? I can
No, SA cannot add headers in case the message size exceeds the spamc
threshold, because in that case spamc does not pass on the message to
spamd at all.
> do it in procmail, and add a header that means something to me (and face
> the additional problems of communicating this nuance to my users), but it
> would be nice if SA had a standard way.
With procmail, the spamc -s option actually should be irrelevant to you,
unless *raising* the limit. Why have procmail pipe the message to a
filter, if we know it will be passed back unhandled?
:0 fw
* < 512000
| spamc
Now there are two ways to add various "skipped" headers. A trivial one
is negating the size condition.
:0 fw
* > 511999
| formail -A "X-Spam-Status: Skipped, too large"
A more fancy variant starts by using the spamc -x option in the above
recipe, disabling the default "safe fallback" of returning an exit code
of 0 regardless. Now errors will result in an actual error exit code,
while the unprocessed message still is passed back. See man spamc.
A procmail recipe to handle this must follow the spamc filter recipe
immediately, and looks like this, using the procmail error flag.
:0 e fw
| formail -A "X-Spam-Status: Error processing mail"
> (*) with it's brilliant "try 3 times, 1 second apart" retry timer.
If this is merely about timing issues, where restarting spamd might
cause spamc to give up before the daemon is back, you could simply
adjust these. Both retry times as well as numbers of attempts are
configurable.
To do that globally, without even touching your procmail recipes, you
can use spamc.conf in your sysconfig dir. Again, see man spamc.
--
char *t="\10pse\0r\0dtu...@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}