Results 1 to 6 of 6

Thread: Is something wrong with my zmtrainsa?

  1. #1
    Join Date
    Jul 2007
    Location
    San Jose, CA
    Posts
    1,027
    Rep Power
    10

    Default Is something wrong with my zmtrainsa?

    While looking for an answer to a question in an alternate thread today, I noticed that my spam training account has messages in it going back to last year. Not a lot of them...76 messages in total, but it makes me wonder whether zmtrainsa is not doing its job. I ask because the Zimbra documentation states:
    The zmtrainsa script is enabled through a cron job to feed mail that has been classified as spam or as non-spam to the SpamAssassin application, allowing SpamAssassin to ‘learn’ what signs are likely to mean spam or ham. The zmtrainsa script empties these mailboxes each day.
    Going to /opt/zimbra/log I see that spamtrain.log has been updated as recently as last night, so cron is firing it off, but there are lots of repeating errors, of which I include a sample below (this is the tail of the log):
    Code:
    [] WARN: exception occurred fetching message
    java.io.UnsupportedEncodingException: _iso-2022-jp$ESC
            at sun.io.Converters.getConverterClass(Converters.java:218)
            at sun.io.Converters.newConverter(Converters.java:251)
            at sun.io.ByteToCharConverter.getConverter(ByteToCharConverter.java:68)
            at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:224)
            at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:210)
            at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:77)
            at java.io.InputStreamReader.<init>(InputStreamReader.java:83)
            at com.sun.mail.handlers.text_plain.getContent(text_plain.java:82)
            at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:
    789)
            at javax.activation.DataHandler.getContent(DataHandler.java:536)
            at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1384)
            at com.zimbra.cs.util.SpamExtract.extractMessage0(SpamExtract.java:340)
            at com.zimbra.cs.util.SpamExtract.extractMessage(SpamExtract.java:292)
            at com.zimbra.cs.util.SpamExtract.extract(SpamExtract.java:241)
            at com.zimbra.cs.util.SpamExtract.main(SpamExtract.java:189)
    [] WARN: exception occurred fetching message
    java.io.UnsupportedEncodingException: _iso-2022-jp$ESC
            at sun.io.Converters.getConverterClass(Converters.java:218)
            at sun.io.Converters.newConverter(Converters.java:251)
            at sun.io.ByteToCharConverter.getConverter(ByteToCharConverter.java:68)
            at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:224)
            at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:210)
            at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:77)
            at java.io.InputStreamReader.<init>(InputStreamReader.java:83)
            at com.sun.mail.handlers.text_plain.getContent(text_plain.java:82)
            at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:
    789)
            at javax.activation.DataHandler.getContent(DataHandler.java:536)
            at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1384)
            at com.zimbra.cs.util.SpamExtract.extractMessage0(SpamExtract.java:340)
            at com.zimbra.cs.util.SpamExtract.extractMessage(SpamExtract.java:292)
            at com.zimbra.cs.util.SpamExtract.extract(SpamExtract.java:241)
            at com.zimbra.cs.util.SpamExtract.main(SpamExtract.java:189)
    [] INFO: Total messages processed: 67
    [] INFO: Total messages processed: 0
    20090630234514 Finished spam/ham cleanup
    Suggestions where I go with this?
    Cheers,

    Dan

  2. #2
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    I guess the next place to go would be to grab some of those old msgs and see if they cause the same stack traces when manually run trough zmtrainsa (stick just one in a account by itself etc).

    ie: find the blob > create a new account > zmltmpinject or zmmailbox addmessage > zmtrainsa spam account folder

    If can't produce the error then might just empty all the folders in the spam account and see if it fills again.

  3. #3
    Join Date
    Jul 2007
    Location
    San Jose, CA
    Posts
    1,027
    Rep Power
    10

    Default

    OK for those who (like me) had no idea what Mike just said, I was chatting with him & got some more detail.
    1. Create a temp mailbox (mine's test@mydomain.com)
    2. Find out the number of the spam mailbox:
      Code:
      zimbra@mail:~$ zmprov gmi spam.xxxxxxxx@mydomain.com
      mailboxId: 4
    3. Move a message from the spam account into the test account:
      Code:
      zimbra@mail:~$ zmmailbox -z -m test@mydomain.com addMessage /Inbox store/0/4/msg/1
      (note, replace the blue "4" with whatever number you got in step 2)
    4. Train on your test mailbox:
      Code:
      zimbra@mail:~$ zmtrainsa test spam inbox
    I did this, it did recognize the message, but the process did not create an entry in spamtrain.log; in fact the logfile still shows last night's timestamp.

    So what next?
    Cheers,

    Dan

  4. #4
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    zmtrainsa test@domain.com spam /Inbox > /opt/zimbra/log/trainingwheels.log

  5. #5
    Join Date
    Jul 2007
    Location
    San Jose, CA
    Posts
    1,027
    Rep Power
    10

    Default

    Yeah, I know; forgot to redirect the output. Color me stupid!

    Re-doing it, we have now learned that the training part is not what causes the error. It's when we add the --cleanup argument to zmtrainsa that the errors get thrown.
    Cheers,

    Dan

  6. #6
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Reports running it with --cleanup causes the error (calls zmspamextract > ZimbraServer/src/java/com/zimbra/cs/util/SpamExtract.java) which errors on the encoding; he's gonna attach/get me a sample msg.

Similar Threads

  1. zmtrainsa does not see attachments
    By dvb in forum Administrators
    Replies: 3
    Last Post: 04-24-2012, 09:18 AM
  2. Wrong data in CSR
    By gracedman in forum Installation
    Replies: 6
    Last Post: 08-14-2009, 08:14 AM
  3. Replies: 4
    Last Post: 02-10-2009, 05:30 AM
  4. Wrong icons in GA Zimbra web client
    By iain in forum Users
    Replies: 2
    Last Post: 02-13-2006, 03:13 AM
  5. Rewrote zmtrainsa for DSPAM
    By unilogic in forum Developers
    Replies: 18
    Last Post: 01-12-2006, 06:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •