Announcement

Collapse
No announcement yet.

Spam and E-Mail sorting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spam and E-Mail sorting

    Dear Community,

    if have installed a fresh Debian 4.0 (basic system) and use the installer script. Works perfect for me. Just some small fixes. 1 Hour and everything is working fine.

    In the end I miss 2 things to be very very happy .

    1. It seems that the spam filter is not working (very well). The thunderbird spamfilter works really good without any training. Is there a script around which will "pretrain" the ox spam filter?

    2. A like to filter my mails to seperated folders. At the moment all email are shown in the inbox folder. I can create subfolders but no way to create an email filter.


    Thanks for the help!

  • #2
    Hi,

    both functionality can easily be achieved by using 3rd party software, such als spamassasin
    and sieve. Remember, the Open-Xchange Server is a Groupware with integrated E-Mail Client,
    so no real Mailserver - just like your favorite Desktop Client like Thunderbird/Lightning or Outlook.
    Searching for those tools should bring up a huge bunch of documentation.
    Spamassasin (with some plugins) is a very powerful spamfilter which works on the Server,
    meaning your client does not need to do the job anymore.
    Sieve is a (easy to learn) scripting language for mailboxes which allows all kinds of actions to
    be done with incoming mail, for example "if mail subject contains "Hello!" put to "friendly people"
    folder" and many more. Open-Xchange will implement a Sieve client soon (actually it's
    in the 6.5 Beta) to make those script management a lot easier. Sieve can be used with many
    mailservers.

    Greetings

    Comment


    • #3
      Thanks for the reply.. i will try it

      Comment


      • #4
        I have already installed spamassassin, but I seems that spam is not filtered yet. I have read the spamassassin docu but didn't find any help.

        I use fetchmail to get email, procmail and amavis. Not sure if amavis scans emails, since spamassassin didn't scan for spam. How can I make sure that spammassassin and amavis are working correctly.

        So what I have done.

        Install Debian 4.0 basis.

        Install OX via installer script.

        Getting some errors in admin mode, search this forum and install more programs like procmail fetchmail and ip(...) just with apt-get... no configuration.

        Than everthing works fine for me. No errors in admin mode and I can send/receive emails.

        The only thing is that spamassassin didn't work... maybe it looks in the wrong directory for mails or so...


        Please help me

        Thanks

        Comment


        • #5
          No.
          Now you have to look for the interaction MailTransferAgent (MTA - your mailserver) and the spam/virusscanning software.
          Usually the MTA talks to the scanners via Ports or sockets - not directories!
          In my setup of postfix (as a example, not "the only truth") it goes via

          postfix (port25) --> amavis (port 10024) --> spamassasin (internal socket) --> clamav (internal socket) --> postfix (port10025, to avoid endless loop)

          so you have to setup something like this with your mailserv.
          BTW fetchmail does something similar

          other server (port110/143/993/995) --> fetchmail --> postfix(port25)
          you should see in /var/log/mail scanning messages if you grep for amavis.

          Hope it helps
          Popeye

          Comment


          • #6
            I am really grateful to all the help, but you are talking to an absolutly noob....

            Ok the daemons talking over tcp... so I can stop searching my hdd for any mails

            I grep for avmais and found a lot of entries. So that seems to work... year

            Code:
            Jul  4 20:17:15 debian amavis[14660]: (14660-03) Passed CLEAN, LOCAL [127.0.0.1] [189.81.232.101] <ozakcgy@kompan.com> -> <pvoss@localhost.1und1.de>, Message-ID: <000a01c8de01$03e62574$1b5df98d@djvnut>, mail_id: EXq04GUAodw0, Hits: -, queued_as: 973A722F2CB, 471 ms

            Than I grep for spam.. nothing

            So I try harder... I am editing the postfix/main.cf ... I guess this is the right place to look for...

            Thanks...

            Comment


            • #7
              Ok I have managed to get spamassassin working. It already found 2 spam mails... so it works. Many thanks to Popeye for the good tipps. I really puts me on the right way.


              I had to change this line

              Code:
              smtp   inet    n       -       -       -       -       smtpd
                     -o content_filter=smtp-amavis:[127.0.0.1]:10024
              to

              Code:
              smtp    inet    n       -       -       -       -       smtpd
                      -o content_filter=spamassassin

              Of course amavis is not working anymore. As Popeye said I have to forward my mail from postfix to spamassassin and than to amavis.
              Can someone please tell me how I can pass my mail from spamassassin to amavis. I guess I just need one more line im my master.cf. But I didn't find any examples on how to do this


              Second question:
              When I mark a mail as spam from openexchange, how can I check that spamassassin learns this. Do I have to make any settings for openoffice and spamassassin??

              Thanks

              Comment


              • #8
                Hi,

                marking a E-Mail as Spam should move the mail to the "Spam" folder of the IMAP account. Those mails could be the foundation for spam recognition learning. Spamassassin needs to check the mails at that folder and learn them, don't have a clue how to do it but in theory it should work that way.

                Greetings

                Comment


                • #9
                  To train spamassassin you should use the sa-learn programm of spamassassin.

                  See

                  for the howto.
                  Especially the
                  Code:
                  sa-learn --showdots --spam spam-files or spam-directory/* for a whole folder of spam
                  options and the sample script below.

                  But you have to let it run as a cronjob (in the background) once a day (thats enough).
                  AND --> If you don't set up the config file properly, it will produce the output in the users $HOME directory - and don't use the results in the servers spam service.
                  So edit
                  /etc/spamassassin/local.cf (or /etc/mail/spamassassin/local.cf)
                  for all system-wide settings
                  (See http://www.pollux.franken.de/mail-se...sa-learn-cyrus )

                  BTW: usually amavis handles spamassassin. So the setup
                  Code:
                  smtp   inet    n       -       -       -       -       smtpd
                         -o content_filter=smtp-amavis:[127.0.0.1]:10024
                  is right, but the setup of amavis seems to be wrong (at least the SA part)
                  I'll look at my server and tell you...

                  CU
                  Popeye

                  Comment


                  • #10
                    Hi Popeye,

                    thanks for the reply.

                    Ok I have execute the command sa-learn on my spam folder. The folder contains about 40 mail now.
                    sa-learn returns:
                    Code:
                    Learned tokens from 0 message(s) (1 message(s) examined)
                    is that ok... I guess it should examine about 40 messages.
                    Path contain all mail... I have tried with /* at the and of path and without *


                    If you don't set up the config file properly, it will produce the output in the users $HOME directory - and don't use the results in the servers spam service.
                    I don't understand this. Which config file and what output?

                    I think .../spamassassin/local.cf is ok... I found a lot of examples and nearly all look the same. What happens now is that spamfiles marked as spam but were not filtered into spam-box.

                    is right, but the setup of amavis seems to be wrong (at least the SA part)
                    I'll look at my server and tell you...
                    Very kind. I have checked the config file but didn't see where I can send my mails to spamassassin.


                    Regards...

                    Comment


                    • #11
                      Hello Hagen,

                      the output of sa-learn means, that it knews all the rest and examined only 1 new message from which he didn't see any new token to integrate into the local bayes file. So spamassassin has a list of emails that have already been examined. This makes sense if you think about a systemwide spamdirectory or -account with more than 1000 messages in there...saves time.

                      I mean the configfile

                      /etc/spamassassin/local.cf (or /etc/mail/spamassassin/local.cf)

                      where you tell him about the directory where the bayes files reside.
                      This could look like (for example)
                      Code:
                      bayes_path /var/spool/spamassassin/bayes  # depends 
                      bayes_file_mode 777   # -rwxrwxrwx 
                      use_bayes 1         # yes, use bayes to learn 
                      auto_learn 1      # and do this whenever a spam message is identified or sa-learn runs
                      Or you give the parameter --dbpath /path/to/bayes-dir which points to the directory of the files:
                      /path/to/bayes-dir/bayes_toks
                      /path/to/bayes-dir/bayes_seen


                      When examinig my amavis.conf I realize that there is only the PATH for spamassassin binaries, next
                      Code:
                      $final_spam_destiny = D_PASS;   # action. This can be pass, reject, bounce, or discard. Leave it at pass
                      $sa_tag_level_deflt = -1000;      # ALL files get a header extention X-Spam, if default 3, only the ones with score higher 3!
                      $sa_tag2_level_deflt = 5.0;        # from this level on they get a X-Spam-Status: Yes
                      $sa_kill_level_deflt = 10;            # from this level on do what $final_spam_destiny says
                      $sa_spam_subject_tag = '*** THIS is my SPAM*** ';    # added in mail subject. Can be your favorit string
                      Then you should see something with
                      Code:
                      tail -1500 /var/log/mail | grep Hits
                      A search for spamassassin doesn't work, because amavis wraps it.

                      So there is no "call" in amavis, because amavis simply uses spamassassin - and expects it at $PATH (in amavis.conf, not shell

                      CU
                      Popeye

                      Comment

                      Working...
                      X