Am 24.01.2016 um 20:09 schrieb Sarang Shrivastava:
Will take into consideration your advice from the next time.

WTF? respond to the list AND ONLY to the list
https://www.google.com/search?q=how+to+use+a+mailing-list

* set up spamd
* spamc -R -l --socket /run/spamassassin/spamassassin.sock < file.eml
* parse the output

fireup spamassassin for each and every mail with it's whole initialization is wasting of ressources and time

[root@mail-gw:~]$ spamc -h
SpamAssassin Client version 3.4.1
  compiled with SSL support (OpenSSL 1.0.1k-fips 8 Jan 2015)

Usage: spamc [options] [-e command [args]] < message

Options:
  -d, --dest host[,host2]
                      Specify one or more hosts to connect to.
                      [default: localhost]
  -H , --randomize    Randomize IP addresses for the looked-up
                      hostname.
  -p, --port port     Specify port for connection to spamd.
                      [default: 783]
  -S, --ssl           Use SSL to talk to spamd.
  -U, --socket path   Connect to spamd via UNIX domain sockets.
  -F, --config path   Use this configuration file.
  -t, --timeout timeout
                      Timeout in seconds for communications to
                      spamd. [default: 600]
  -n, --connect-timeout timeout
                      Timeout in seconds when opening a connection to
                      spamd. [default: 600]
  --filter-retries retries
                      Retry filtering this many times if the spamd
                      process fails (usually times out) [default: 1]
  --filter-retry-sleep sleep
                      Sleep for this time between failed filter
                      attempts, in seconds [default: 1]
  --connect-retries retries
                      Try connecting to spamd tcp socket this many times
                      [default: 3]
  --retry-sleep sleep Sleep for this time between attempts to
                      connect to spamd, in seconds [default: 1]
  -s, --max-size size Specify maximum message size, in bytes.
                      [default: 500k]
  -u, --username username
                      User for spamd to process this message under.
                      [default: current user]
  -L, --learntype learntype
                      Learn message as spam, ham or forget to
                      forget or unlearn the message.
  -C, --reporttype reporttype
                      Report message to collaborative filtering
                      databases.  Report type should be 'report' for
                      spam or 'revoke' for ham.
  -B, --bsmtp         Assume input is a single BSMTP-formatted
                      message.
  -c, --check         Just print the summary line and set an exit
                      code.
  -y, --tests         Just print the names of the tests hit.
  -r, --full-spam     Print full report for messages identified as
                      spam.
  -R, --full          Print full report for all messages.
  --headers           Rewrite only the message headers.
  -E, --exitcode      Filter as normal, and set an exit code.
  -x, --no-safe-fallback
                      Don't fallback safely.
  -X, --unavailable-tempfail
                      When using -x, turn 'unavailable' error into
                      'tempfail'. This may be useful for an MTAs
                      to defer emails with a temporary SMTP error
                      instead of bouncing with a permanent SMTP
                      error.
  -l, --log-to-stderr Log errors and warnings to stderr.
  -e, --pipe-to command [args]
                      Pipe the output to the given command instead
                      of stdout. This must be the last option.
  -h, --help          Print this help message and exit.
  -V, --version       Print spamc version and exit.
  -K                  Keepalive check of spamd.
  -z                  Compress mail message sent to spamd.
  -f                  (Now default, ignored.)
  -4                  Use IPv4 only for connecting to server.
  -6                  Use IPv6 only for connecting to server.


So the thing is I want incorporate a  new statistical plug-in into SA .
Presently it just has a Bayesian filter. I wanted to add some more
machine learning algorithms to it.

But I don't have a web server at my disposal which I can directly link
with SA. I have just started using SA. If i have a mail in a .eml format
and I want to classify it with SA , what should I do .?

I guess I mailed my purpose on the mailing list previously and you were
the one who helped me out

"no - you need just "spamassassin -D  < sample.eml"

just configure thunderbird to access your gmail account with IMAP and
svae the mails as file, the default format of thunderbird in that case
is .eml

maybe you need to play around with 'trusted_networks' in your SA so that
it is able to recocinze the first external hop delivering to the gmail
infrastructure (RBL, PTR tests and so on)"

This is what you wrote.


On Mon, Jan 25, 2016 at 12:29 AM, Reindl Harald <[email protected]
<mailto:[email protected]>> wrote:



    Am 24.01.2016 um 19:37 schrieb Sarang Shrivastava:

        I am just a newbie who has started using SA. Someone on the
        mailing list
        suggested me to use -D option. So if this option is for
        debugging then
        how do we classify it ?


    please don't top-post and press reply-all on mailing-lists!

    don't write subjects with caps only
    score SUBJ_ALL_CAPS 0.518 1.625 1.197 1.506

    just without specify -D?
    yes it is for debug - look at "spamassassin -h"

    you should better describe you overall goal which is maybe not using
    spamassassin just on a shell!

    [root@mail-gw:/var/lib/spamass-milter]$ su -c "/usr/bin/spamassassin
    < /var/lib/spamass-milter/spam-example.eml" - sa-milt
    Jan 24 19:56:37.839 [633] warn: config: created user preferences
    file: /var/lib/spamass-milter/.spamassassin/user_prefs
    X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on
    mail-gw.thelounge.net <http://mail-gw.thelounge.net>
    X-Spam-Status: No, score=-2.0, tag-level=5.5, block-level=8.0,
             envelope=_SENDERDOMAIN_, from=gmail.com <http://gmail.com>
    X-Spam-Report: =?ISO-8859-1?Q?Flag: No,
             * -2.0 ALL_TRUSTED Nachricht wurde nur =fcber
    vertrauensw=fcrdige Rechner
             *      weitergeleitet
             *  0.0 SHORTCIRCUIT Not all rules were run, due to a
    shortcircuited rule
             *  0.0 CUST_SHORTCIRCUIT Skip tests based on
    whitelists/blacklists and
             *      local relays?=
    Received: from mail-gw.thelounge.net <http://mail-gw.thelounge.net>
    (mail-gw.thelounge.net <http://mail-gw.thelounge.net> [10.0.0.19])
           (using TLSv1.2
             with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No
    client certificate requested)
             by mail.thelounge.net <http://mail.thelounge.net>
    (THELOUNGE MTA) with ESMTPS id 3hjPzJ6TWVz23
             for <[email protected]
    <mailto:[email protected]>>; Wed, 27 Aug 2014 00:30:20 +0200 (CEST)
    Received: from arrakis.thelounge.net <http://arrakis.thelounge.net>
    (arrakis.thelounge.net <http://arrakis.thelounge.net> [10.0.0.6])
             by mail-gw.thelounge.net <http://mail-gw.thelounge.net>
    (THELOUNGE GATEWAY) with ESMTP id 3hjPzJ2tkPz1w
             for <[email protected]
    <mailto:[email protected]>>; Wed, 27 Aug 2014 00:30:20 +0200 (CEST)
    Date: Wed, 27 Aug 2014 00:30:19 +0200
    To: [email protected] <mailto:[email protected]>
    From: Mail-Administrator <[email protected]
    <mailto:[email protected]>>
    Subject: Test
    Message-ID:
    <ac29b495e4f8272e477a291cb8fe9c93c7af5d481409092...@arrakis.thelounge.net
    
<mailto:ac29b495e4f8272e477a291cb8fe9c93c7af5d481409092...@arrakis.thelounge.net>>
    X-Received: xx.xx.xx.241 (openvpn-rh.thelounge.net
    <http://openvpn-rh.thelounge.net>) on panel.thelounge.net
    <http://panel.thelounge.net>
      by HTTP
    Precedence: bulk
    Auto-Submitted: auto-generated
    MIME-Version: 1.0
    X-Virus-Scanned: Yes
    X-Virus-Status: Clean
    Return-Path: [email protected] <mailto:[email protected]>
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable

        On Sun, Jan 24, 2016 at 11:59 PM, Reindl Harald
        <[email protected] <mailto:[email protected]>
        <mailto:[email protected] <mailto:[email protected]>>>
        wrote:

             Am 24.01.2016 um 19:25 schrieb Sarang Shrivastava:

                 I just downloaded a dataset of spam and hams from the
        net and
                 fed one of
                 the training file as input to the SA. What i want from
        it is to
                 classify
                 it as a spam or a ham when i run the command
        spamassassin -D <
                 TEST_00000.eml


             and why do you use '-D' for 'debug' when you just want to
        classify it?

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to