Re: spamc client always returning 0/0

2010-07-17 Thread Gnanam


Karsten Bräckelmann-2 wrote:
 
 -- 
 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;il;i++){ i%8?
 c=1:
 (c=*++x); c128  (s+=h); if (!(h=1)||!t[s+h]){ putchar(t[s]);h=m;s=0;
 }}}

Hi Karsten,

This is just out of my curiosity.  Your signature looks something different.
What does that represent?
-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29189836.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-17 Thread Jari Fredriksson
On 17.7.2010 8:59, Gnanam wrote:
 
 
 Karsten Bräckelmann-2 wrote:

 -- 
 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;il;i++){ i%8?
 c=1:
 (c=*++x); c128  (s+=h); if (!(h=1)||!t[s+h]){ putchar(t[s]);h=m;s=0;
 }}}
 
 Hi Karsten,
 
 This is just out of my curiosity.  Your signature looks something different.
 What does that represent?

It's a C program that prints Karsten's email address (the hard way,
obfuscated).

-- 
http://www.iki.fi/jarif/
I use PGP. If there is an incompatibility problem with your mail
client, please contact me.

FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #13
A:  Doc, Happy, Bashful, Dopey, Sneezy, Sleepy,  Grumpy
Q:  Who were the Democratic presidential candidates?



signature.asc
Description: OpenPGP digital signature


Re: spamc client always returning 0/0

2010-07-16 Thread Gnanam


Karsten Bräckelmann-2 wrote:
 
 Check your logs.
 
 spamd likely logged the failure. And btw, spamc also logs in some cases,
 like refused connection attempts to spamd. You will find your previous
 attempts without spamd running being logged.

Thanks.  That solved my problem.  It has thrown the following error in log
that it has exceeded the max message size:

Jul 14 22:23:55 myserver spamc[15527]: skipped message, greater than max
message size (512000 bytes)

After increasing max message size in /etc/mail/spamassassin/spamc.conf, am
able to get spam score for my email message.

As you'd pointed rightly, both spamc and spamd log statements are logged
here (/var/log/maillog).

Karsten Bräckelmann-2 wrote:
 
 Also, try something like this.
 
   echo | spamc -x; echo $?

And this was really helpful to debug.

-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29181721.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-16 Thread Gnanam


Karsten Bräckelmann-2 wrote:
 
 Check your logs.
 
 spamd likely logged the failure. And btw, spamc also logs in some cases,
 like refused connection attempts to spamd. You will find your previous
 attempts without spamd running being logged.

For my email message spamc -c  /root/mailmessage.txt, am getting a spam
score of 2.5/5.0 and spamc is printing the following statements in the log:

1) Jul 16 00:34:52 myserver spamd[9957]: spamd: connection from myserver
[127.0.0.1] at port 53626
2) Jul 16 00:34:52 myserver spamd[9957]: spamd: setuid to root succeeded
3) Jul 16 00:34:52 myserver spamd[9957]: spamd: still running as root: user
not specified with -u, not found, or set to root, falling back to nobody
4) Jul 16 00:34:52 myserver spamd[9957]: spamd: checking message
23671010.1276784893828.javamail.ad...@user01 for root:99
5) Jul 16 00:35:00 myserver spamd[9957]: auto-whitelist: open of
auto-whitelist file failed: locker: safe_lock: cannot create tmp lockfile
/.spamassassin/auto-whitelist.lock.myserver.9957 for
/.spamassassin/auto-whitelist.lock: No such file or directory
6) Jul 16 00:35:00 myserver spamd[9957]: spamd: clean message (2.5/5.0) for
root:99 in 7.7 seconds, 1303511 bytes.
7) Jul 16 00:35:00 myserver spamd[9957]: spamd: result: . 2 -
HTML_FONT_SIZE_LARGE,HTML_MESSAGE,MIME_HTML_ONLY,MISSING_DATE,NO_RECEIVED,NO_RELAYS
scantime=7.7,size=1303511,user=root,uid=99,required_score=5.0,rhost=myserver,raddr=127.0.0.1,rport=53626,mid=23671010.1276784893828.javamail.ad...@user01,autolearn=no
8) Jul 16 00:35:00 myserver spamd[9952]: prefork: child states: II

What does . 2 mean in the 7th line above?

For the command echo | spamc -x; echo $?, it is showing Y 6 in the same
7th line of spamd result?

Does this represent/mean anything?
-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29181819.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-16 Thread Martin Gregorie
On Fri, 2010-07-16 at 02:39 -0700, Gnanam wrote:

 What does . 2 mean in the 7th line above?
 
Its a summary result: '.' means not spam. SA replaces '.' with 'Y' if it
is spam. The number is the score truncated to an integer.


Martin




Re: spamc client always returning 0/0

2010-07-16 Thread Gnanam


Martin Gregorie-2 wrote:
 
 Its a summary result: '.' means not spam. SA replaces '.' with 'Y' if it
 is spam. The number is the score truncated to an integer.

Thanks for that update.

I've another question with spamc.  The spamc option -s max_size,
--max-size=max_size in man spamc says:

The maximum message size is 256 MB.

So, email messages that are greater than 256 MB can never be tested with SA? 
Or is there any tweaks to get around this?

-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29182105.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-16 Thread Daniel Lemke


Gnanam wrote:
 
 The maximum message size is 256 MB.
 
 So, email messages that are greater than 256 MB can never be tested with
 SA?  Or is there any tweaks to get around this?
 
 

You need to scan mails that are greater than 256MB?!
-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29182193.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-16 Thread Gnanam


Daniel Lemke wrote:
 
 
 Gnanam wrote:
 
 The maximum message size is 256 MB.
 
 So, email messages that are greater than 256 MB can never be tested with
 SA?  Or is there any tweaks to get around this?
 
 
 
 You need to scan mails that are greater than 256MB?!
 

Reason I'm asking this is that sometimes email attachment(s) size may be on
the higher side, that it would easily exceed 256 MB limit.
-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29182291.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-16 Thread Daniel Lemke


Gnanam wrote:
 
 
 Daniel Lemke wrote:
 
 
 Gnanam wrote:
 
 The maximum message size is 256 MB.
 
 So, email messages that are greater than 256 MB can never be tested with
 SA?  Or is there any tweaks to get around this?
 
 
 
 You need to scan mails that are greater than 256MB?!
 
 
 Reason I'm asking this is that sometimes email attachment(s) size may be
 on the higher side, that it would easily exceed 256 MB limit.
 

I think we live in some sort of parallel universes ;)

Beside several other reasons why it would be totally insane sending an email
of that size, it's nothing you need SpamAssassin to check for because it's
definitely no spam. If you ever get a spam message of that size, please call
Guiness ;)


Daniel
-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29182412.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-16 Thread Gnanam


Daniel Lemke wrote:
 
 I think we live in some sort of parallel universes ;)
 
 Beside several other reasons why it would be totally insane sending an
 email of that size, it's nothing you need SpamAssassin to check for
 because it's definitely no spam. If you ever get a spam message of that
 size, please call Guiness ;)

Hope I'll not exceed this 256 MB limit.
-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29182552.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-16 Thread Martin Gregorie
On Fri, 2010-07-16 at 04:18 -0700, Gnanam wrote:
 
 Daniel Lemke wrote:
  
  I think we live in some sort of parallel universes ;)
  
  Beside several other reasons why it would be totally insane sending an
  email of that size, it's nothing you need SpamAssassin to check for
  because it's definitely no spam. If you ever get a spam message of that
  size, please call Guiness ;)
 
 Hope I'll not exceed this 256 MB limit.

Don't forget that if you default spamd to --max-children (5) and you're
simultaneously scanning five max-sized messages, thats at least 1.3 GB
of RAM occupied by spamd and its children. I trust you've got enough
swap space configured, i.e. 2 x RAM, and that you've got a high enough
setting for --timeout-child.


Martin




spamc max size limit (was: Re: spamc client always returning 0/0)

2010-07-16 Thread Karsten Bräckelmann
On Fri, 2010-07-16 at 03:40 -0700, Gnanam wrote:
 Daniel Lemke wrote:

   The maximum message size is 256 MB.
   
   So, email messages that are greater than 256 MB can never be tested with
   SA?  Or is there any tweaks to get around this?
  
  You need to scan mails that are greater than 256MB?!
 
 Reason I'm asking this is that sometimes email attachment(s) size may be on
 the higher side, that it would easily exceed 256 MB limit.

Whoa, slow down, dude. I'm with Daniel here.

Fact is, spam even larger than 512 kB is rare. Sure, they do exist, and
this topic comes up here every now and then. However, they still are a
rare occurrence, and it is not worth the trouble raising the limit to an
arbitrarily large number.

The limit exists for two reasons. First, *really* large spam simply
doesn't exist, and mail that size just is ham. And second, scanning
really large messages will slow down SA and hog resources.

It's a trade-off. Not even scanning those rare, huge spam. Versus a
dramatically increased need for resources.

Don't think of the max size limit as which size *mail* do I get, but
which size *spam* do I see. Ham exceeding the threshold will just be
passed along un-scanned.


Really, think about it. How much spam exceeding 1 MB do you get? One a
year? How much ham? Plenty, due to creative folks tossing around huge
images?

So, set your max size limit to something sane, say 1 MB, and live with
that single spam per year sneaking through unprocessed. Sparing your
servers the load of processing all the bulk of huge messages.


Oh, and another one. Any chance, these huge messages might be Cc'ed to
more folks on your site? Awesome, so we just multiplied the resources
needed. If there are max 5 children, all fed with a piece of ham that
easily exceeds 256 MB concurrently, will your server die a slow and
horrible death of hitting swap?

IMHO, if you are ever to raise the threshold to anything above 10 MB, do
test it extensively before going into production.


Bottom line: Keep your max size limit sane. No kidding.


-- 
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;il;i++){ i%8? c=1:
(c=*++x); c128  (s+=h); if (!(h=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}



Re: spamc client always returning 0/0

2010-07-16 Thread John Hardin

On Fri, 16 Jul 2010, Gnanam wrote:


Daniel Lemke wrote:


Gnanam wrote:


The maximum message size is 256 MB.

So, email messages that are greater than 256 MB can never be tested 
with SA?  Or is there any tweaks to get around this?


You need to scan mails that are greater than 256MB?!


Reason I'm asking this is that sometimes email attachment(s) size may be 
on the higher side, that it would easily exceed 256 MB limit.


I sure hope you mean kB, not MB. Someone who is sending 256+MB 
attachments via email needs to have their attitude adjusted with a 
Louisville Slugger.


--
 John Hardin KA7OHZhttp://www.impsec.org/~jhardin/
 jhar...@impsec.orgFALaholic #11174 pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
---
  If guards and searches and metal detectors can't keep a gun out of
  a maximum-security solitary confinement prisoner's cell, how will
  a disciplinary policy and some signs keep guns out of a university?
---
 Today: the 65th anniversary of the dawn of the Atomic Age


Re: spamc max size limit (was: Re: spamc client always returning 0/0)

2010-07-16 Thread Gnanam


Karsten Bräckelmann-2 wrote:
 
 Bottom line: Keep your max size limit sane. No kidding.

Thank you very much for your valuable comment/recommendation on this.  That
makes sense.
-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29189631.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



spamc client always returning 0/0

2010-07-15 Thread Gnanam

Hi,

My SpamAssassin setup:

SpamAssassin version 3.3.1 running on Perl version 5.8.8 installed on Red
Hat Enterprise Linux Server release 5 (Tikanga)

My problem is, the spamc client is not at all working and it is always
returning  0/0.  At the same time, if I use spamassassin script, it's
working and is giving back spam score result.

Example:
# spamc -R  mymailmessage.txt
# spamassassin -t  mailmessage.txt

I believe that either some library is missing or some environment setting is
missing.

Also, how do I print only Content analysis details from spamassassin
command-line tool by suppressing the whole mail message from being printed? 
Is there any option that controls this?

Regards,
Gnanam

-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29173280.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-15 Thread Daniel Lemke


Gnanam wrote:
 
 My problem is, the spamc client is not at all working and it is always
 returning  0/0.  At the same time, if I use spamassassin script, it's
 working and is giving back spam score result.
 

Did you start the Daemon?



Karsten Bräckelmann-2 wrote:
 
 man spamd
 
-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29173405.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-15 Thread Gnanam


Daniel Lemke wrote:
 
 Did you start the Daemon?

You're right, it was not started.  I now started using the command:
# spamd -d

Then I ran netstat -tulpn |grep spamd, it returned:
tcp0  0 127.0.0.1:783   0.0.0.0:*  
LISTEN  17382/spamd -d

Now when I try to run spamc -R  mailmessage.txt, it is again returning
0/0.
-- 
View this message in context: 
http://old.nabble.com/spamc-client-always-returning-0-0-tp29173280p29173522.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: spamc client always returning 0/0

2010-07-15 Thread Karsten Bräckelmann
On Thu, 2010-07-15 at 06:58 -0700, Gnanam wrote:
 My problem is, the spamc client is not at all working and it is always
 returning  0/0.  At the same time, if I use spamassassin script, it's
 working and is giving back spam score result.

That indicates an error. Did you start spamd?

You can use spamc -x, to get a meaningful exit code.

 Example:
 # spamc -R  mymailmessage.txt
 # spamassassin -t  mailmessage.txt
 
 I believe that either some library is missing or some environment setting is
 missing.

Nope, spamc pretty much only passes STDIN to spamd.


 Also, how do I print only Content analysis details from spamassassin
 command-line tool by suppressing the whole mail message from being printed? 
 Is there any option that controls this?

man spamc

Please DO read the docs. The -R you already used should do what you
want. In your case, it simply did not, because an error talking to spamd
occurred, and you are using the default of safe fallback. In case of
an error, the message is passed back. See -x, again.


-- 
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;il;i++){ i%8? c=1:
(c=*++x); c128  (s+=h); if (!(h=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}



Re: spamc client always returning 0/0

2010-07-15 Thread Jari Fredriksson
On 15.7.2010 16:58, Gnanam wrote:
 Also, how do I print only Content analysis details from spamassassin
 command-line tool by suppressing the whole mail message from being printed? 
 Is there any option that controls this?

Not possible as far as I know. SpamAssassin's idea is to be a *filter*,
which means it possibly adds to the original and never removes anything.

-- 
http://www.iki.fi/jarif/
I use PGP. If there is an incompatibility problem with your mail
client, please contact me.

Excellent day to have a rotten day.



signature.asc
Description: OpenPGP digital signature


Re: spamc client always returning 0/0

2010-07-15 Thread Karsten Bräckelmann
On Thu, 2010-07-15 at 17:21 +0300, Jari Fredriksson wrote:
  Also, how do I print only Content analysis details from spamassassin
  command-line tool by suppressing the whole mail message from being printed? 
  Is there any option that controls this?
 
 Not possible as far as I know. SpamAssassin's idea is to be a *filter*,
 which means it possibly adds to the original and never removes anything.

Correct for spamassassin, but possible with spamc. Which the OP wants to
use anyway.

See the -c, -r, -R and -y options in man spamc.

By default, spamc acts as a filter, but this behavior is configurable.


-- 
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;il;i++){ i%8? c=1:
(c=*++x); c128  (s+=h); if (!(h=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}



Re: spamc client always returning 0/0

2010-07-15 Thread Karsten Bräckelmann
On Thu, 2010-07-15 at 07:17 -0700, Gnanam wrote:
 You're right, it was not started.  I now started using the command:
 # spamd -d
 
 Then I ran netstat -tulpn |grep spamd, it returned:
 tcp0  0 127.0.0.1:783   0.0.0.0:*  
 LISTEN  17382/spamd -d
 
 Now when I try to run spamc -R  mailmessage.txt, it is again returning
 0/0.

Check your logs.

spamd likely logged the failure. And btw, spamc also logs in some cases,
like refused connection attempts to spamd. You will find your previous
attempts without spamd running being logged.

Also, try something like this.

  echo | spamc -x; echo $?

The first echo simulates a message. Poorly at that, but suitable for
what we're debugging here. Check the returned exit code with the list
given in the spamc man-page.


-- 
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;il;i++){ i%8? c=1:
(c=*++x); c128  (s+=h); if (!(h=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}