You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Cecil Westerhof <Ce...@decebal.nl> on 2010/01/13 10:01:22 UTC
Error code 98
In the thread:
http://osdir.com/ml/debian-bugs-closed/2009-08/msg01318.html
Error code 98 is described as the message being fed being to big and the
problem resolved. But it is not.
I have a big message:
-rw-r--r-- 1 imaps users 1,4M 2010-01-11 18:05 1263235863.M361818P11014V0000000000000303I00D10102_0.Asterisk,S=1406379:2,S
When feeding it to spamc with:
spamc -L spam <toProcess/1263235863.M361818P11014V0000000000000303I00D10102_0.Asterisk,S=1406379:2,S
I get a return code of 98 and this breaks my crontab job. I now solved
this by:
set +e
message=$(spamc -L ${typeStr} <${toProcessSpamDir}${i})
errorCode=${?}
set -e
case ${message} in
'Message successfully un/learned')
let "++learned"
;;
'Message was already un/learned')
let "++notLearned"
;;
*)
let "++error"
case ${errorCode} in
98)
echo "${i} was to big to be processed"
;;
*)
echo "unknown error (${errorCode})"
;;
esac
;;
esac
But I think this should be documented. (With other undocumented errors
if there are.)
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
Re: Error code 98
Posted by Justin Mason <jm...@jmason.org>.
yes, good point. I've updated the POD docs now for 3.3.0.
--j.
On Wed, Jan 13, 2010 at 09:01, Cecil Westerhof <Ce...@decebal.nl> wrote:
> In the thread:
> http://osdir.com/ml/debian-bugs-closed/2009-08/msg01318.html
>
> Error code 98 is described as the message being fed being to big and the
> problem resolved. But it is not.
>
> I have a big message:
> -rw-r--r-- 1 imaps users 1,4M 2010-01-11 18:05 1263235863.M361818P11014V0000000000000303I00D10102_0.Asterisk,S=1406379:2,S
>
> When feeding it to spamc with:
> spamc -L spam <toProcess/1263235863.M361818P11014V0000000000000303I00D10102_0.Asterisk,S=1406379:2,S
>
> I get a return code of 98 and this breaks my crontab job. I now solved
> this by:
> set +e
> message=$(spamc -L ${typeStr} <${toProcessSpamDir}${i})
> errorCode=${?}
> set -e
> case ${message} in
> 'Message successfully un/learned')
> let "++learned"
> ;;
> 'Message was already un/learned')
> let "++notLearned"
> ;;
> *)
> let "++error"
> case ${errorCode} in
> 98)
> echo "${i} was to big to be processed"
> ;;
> *)
> echo "unknown error (${errorCode})"
> ;;
> esac
> ;;
> esac
>
> But I think this should be documented. (With other undocumented errors
> if there are.)
>
> --
> Cecil Westerhof
> Senior Software Engineer
> LinkedIn: http://www.linkedin.com/in/cecilwesterhof
>
>
--
--j.
Re: Error code 98
Posted by Cecil Westerhof <Ce...@decebal.nl>.
RW <rw...@googlemail.com> writes:
> I wonder why you are learning through spamc at all. IIRC you observered
> that sa-learn was a little slower than in your previous SA version, you
> tried spamc and found it to be slower and more trouble than using
> sa-learn on a directory. sa-learn AFAIK has no limit, so why not go
> back to sa-learn?
With bigger amounts of e-mails spamc is slower as sa-learn, but up to 15
mails spamc is faster then sa-learn. So I made it now so that when there
are less as 15 e-mails in a folder that spamc is used and otherwise
sa-learn. It can save up to 10 seconds pro folder. In my situation not
very important, but I like to do things in the 'correct' way. When
someone is going to use my script on a server where there is a lot to
learn and regularly, then the current script would be a lot better as
the old script.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
Re: Error code 98
Posted by RW <rw...@googlemail.com>.
On Wed, 13 Jan 2010 18:11:49 +0100
Cecil Westerhof <Ce...@decebal.nl> wrote:
> John Hardin <jh...@impsec.org> writes:
> > I'd suggest doing a size test and explicitly telling spamc to use
> > the same size limit.
>
> That is the safest. ;-) Only problem could be maintainability.
> The default value of 500 KB is a good one?
It depends on your circumstances. If you are an ISP you probably want
to keep the load lighter, if you are running SA on a desktop or soho
server then you probably want to increase it so you can learn
messages with attachments, for better accuracy. Personally I use the
default limit for testing and no limit for learning.
I wonder why you are learning through spamc at all. IIRC you observered
that sa-learn was a little slower than in your previous SA version, you
tried spamc and found it to be slower and more trouble than using
sa-learn on a directory. sa-learn AFAIK has no limit, so why not go
back to sa-learn?
Re: Error code 98
Posted by Cecil Westerhof <Ce...@decebal.nl>.
John Hardin <jh...@impsec.org> writes:
>> How do I found out what the size limit is? And I still need the check,
>> because when the size limit changes (or the wrong one is used) you
>> will get the error.
>
> Per "man spamc":
>
> -s max_size, --max-size=max_size
> Set the maximum message size which will be sent to spamd -- any
> bigger than this threshold and the message will be returned
> unprocessed (default: 500 KB). If spamc gets handed a message
> bigger than this, it won't be passed to spamd. The maximum
> message size is 256 MB.
>
> The size is specified in bytes, as a positive integer greater
> than 0. For example, -s 500000.
>
> I'd suggest doing a size test and explicitly telling spamc to use the
> same size limit.
That is the safest. ;-) Only problem could be maintainability.
The default value of 500 KB is a good one?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
Re: Error code 98
Posted by John Hardin <jh...@impsec.org>.
On Wed, 13 Jan 2010, Cecil Westerhof wrote:
> John Hardin <jh...@impsec.org> writes:
>
>>> In the thread:
>>> http://osdir.com/ml/debian-bugs-closed/2009-08/msg01318.html
>>>
>>> Error code 98 is described as the message being fed being to big
>>
>> Documentation aside, why are you passing such messages to SA in the
>> first place? I'd recommend adding a size test to your script - why
>> waste the cycles asking spamd to ignore the message because it's too
>> large to scan?
>
> That would be a good optimisation. But I did not know this possibility
> when I wrote the script and was taken by surprise about why my script
> did not work.
Ah. Ok.
> How do I found out what the size limit is? And I still need the check,
> because when the size limit changes (or the wrong one is used) you will
> get the error.
Per "man spamc":
-s max_size, --max-size=max_size
Set the maximum message size which will be sent to spamd -- any
bigger than this threshold and the message will be returned
unprocessed (default: 500 KB). If spamc gets handed a message
bigger than this, it won't be passed to spamd. The maximum
message size is 256 MB.
The size is specified in bytes, as a positive integer greater
than 0. For example, -s 500000.
I'd suggest doing a size test and explicitly telling spamc to use the same
size limit.
--
John Hardin KA7OHZ http://www.impsec.org/~jhardin/
jhardin@impsec.org FALaholic #11174 pgpk -a jhardin@impsec.org
key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
Our government should bear in mind the fact that the American
Revolution was touched off by the then-current government
attempting to confiscate firearms from the people.
-----------------------------------------------------------------------
4 days until Benjamin Franklin's 304th Birthday
Re: Error code 98
Posted by Cecil Westerhof <Ce...@decebal.nl>.
John Hardin <jh...@impsec.org> writes:
>> In the thread:
>> http://osdir.com/ml/debian-bugs-closed/2009-08/msg01318.html
>>
>> Error code 98 is described as the message being fed being to big
>
> Documentation aside, why are you passing such messages to SA in the
> first place? I'd recommend adding a size test to your script - why waste
> the cycles asking spamd to ignore the message because it's too large to
> scan?
That would be a good optimisation. But I did not know this possibility
when I wrote the script and was taken by surprise about why my script
did not work. How do I found out what the size limit is? And I still
need the check, because when the size limit changes (or the wrong one is
used) you will get the error.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
Re: Error code 98
Posted by John Hardin <jh...@impsec.org>.
On Wed, 13 Jan 2010, Cecil Westerhof wrote:
> In the thread:
> http://osdir.com/ml/debian-bugs-closed/2009-08/msg01318.html
>
> Error code 98 is described as the message being fed being to big
Documentation aside, why are you passing such messages to SA in the first
place? I'd recommend adding a size test to your script - why waste the
cycles asking spamd to ignore the message because it's too large to scan?
--
John Hardin KA7OHZ http://www.impsec.org/~jhardin/
jhardin@impsec.org FALaholic #11174 pgpk -a jhardin@impsec.org
key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
Gun Control enables genocide while doing little to reduce crime.
-----------------------------------------------------------------------
4 days until Benjamin Franklin's 304th Birthday