calling on spamc?

Discussion in 'Tips/Tricks/Mods' started by pjaric, Oct 19, 2006.

  1. tafkaz

    tafkaz Member HowtoForge Supporter

    Maybe this information helps to find the problem:
    This is the Spam-relevant headerpart of a very spammy spam-mail !

    X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on
    X-Spam-Level: ****
    X-Spam-Status: No, score=4.6 required=5.0 tests=AWL,BANG_GUAR,BAYES_99,
    HTML_MESSAGE,MIME_BOUND_NEXTPART autolearn=no version=3.1.8

    What can i do to make it understand that this is spam ?
    As i pointed out i train spamassassin through sa-learn, allthough i am not sure this helps at all with the usage of spamd. maybe someone has answers ?

    this is part of the output of sa-learn --dump magic
    0.000 0 3 0 non-token data: bayes db version
    0.000 0 1318 0 non-token data: nspam
    0.000 0 0 0 non-token data: nham

    Thank you very much for your help...we're rather cluless here....and our customers start to ask what's happening....

    Greetz Sascha
  2. tafkaz

    tafkaz Member HowtoForge Supporter

    It's so bad...

    i can't see any difference since i started learning spam with sa-learn.

    So actually we're still drowning in spam that comes through allthough it is obviously tested somehow, but is given too good ratings !
    We had absolutely no problems wiith spam when we used the given configuration with spamassassin...but that brought our server to its knees due to heavy load...

    if only the switch from spamassassin to spamd/spamc is what we need, what could have happened that changes the work of spamassassin now so much ? us.....we're desparate !
    Really !!!

    Any Idea is absolutely welcome !

    Thanx Sascha
  3. falko

    falko Super Moderator ISPConfig Developer

    What's your SpamAssassin version?

    What's the output of
    netstat -tap
    when this happens?
  4. tafkaz

    tafkaz Member HowtoForge Supporter

    1. Version:

    2. cant say really because this error doesnt appear to often.
    at the moment the spam-relevant line of netstat -tap says:
    tcp 0 0 localhost:783 *:* LISTEN 29843/
  5. falko

    falko Super Moderator ISPConfig Developer

    I don't know if it helps, but maybe you should update ISPConfig. The latest version contains SpamAssassin 3.2.3.
  6. tafkaz

    tafkaz Member HowtoForge Supporter

    Oh my god !!!
    Default arguments in /etc/sysconfig/spamd:
    SPAMD_ARGS="-d -c -L"

    The -L arg has following function:
    Use local tests only (no DNS)

    NO DNS ????

    removed the -L

    Now let's hope that this was the problem and everything works cool now !!!

    I'll tell you then.

    Or does anyone here object in removing the -L ?

    Thanx Sascha
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Removing the -L should solve the problem so that pyzor / dcc and blacklists were used.
  8. tafkaz

    tafkaz Member HowtoForge Supporter

    hi till, hi all

    Yup...that is exactly what i am experiencing right now.....
    Spam is being filtered out again !!! scores of 37 and more are given finally...
    Thank god...
    i still think i will write a howto after i am sure everything's working...

    Thanx all !
  9. jbravo

    jbravo Member

    Maybe some kind of summary?

    Hi ISPConfig folks!

    I'm at stage of moving our servers into ISPConfig management because it is free, has great support (as i can see on this forum) and supports quite well opensuse/sles.

    I'v tried first test install with ISPConfig on SLES10 SP1(Apache2.2 +mod_security2, Postfix,SQLGrey, SASL, TSL, Courier-imap (POP3/POP3S/IMAP/IMAPs)).

    I've read that whole topic and have some questions/thoughts:

    1. Seems that latest ISPConfig version supports spamd/spamc with only one change in /root/ispconfig/isp/conf/spamassassin.rc.master file (to use /usr/bin/spamc instead of ispconfig one) and it accept by user preferences - please confirm.
    2. If above is true - does users can manage their own anitspam preferences and spamc/spamd accept them (probably true)?
    3. What about bayes database - does every user has its own? I can see these files in .spamassassin user homedir:

    How users can learn spamc/spamd?
    Ofcourse i can train site-wide bayes db but what about userprefs then?
    4. If i install razor2, pyzor and dcc by root user - does spamc/spamd will use them for every user? I'll test this tomorrow but very curious about it:)

    I think is enough for this time:) Hope i did not asked FAQ topics;)

    Greetz, .:JbRaVo:.
  10. jmroth

    jmroth ISPConfig Developer ISPConfig Developer

    3 x Yes.

    You would have to generate a cron job for each user account (could be done automatically) and ask your users to put what they have received as spam into a Spam folder, and then learn from that folder like

    5 * * * * sa-learn --spam /home/www/webX/Maildir/.Spam/cur/
    for each user.
    In that case it is also available to have a Ham folder, like a dedicated one or just use the Inbox (assuming it's spam-free):
    5 * * * * sa-learn --ham /home/www/webX/Maildir/cur/
    I guess it will do the weighting for every mail it receives, that is, for every user. Why shouldn't it?
  11. jbravo

    jbravo Member

    Thanks for such a quick answer:)

    Cool! As i understand it would be wise to create additional Maildirs (for example .Spam) and this cron jobs automatically - with user creation.
    Heh, changing spamc to move spam to .Spam folder also as a default user setting (not just rewriting subject or removing it) - can i do this by adding
    to procmail spam rule? I mean about same rule as deleting spam but - move to folder instead of /dev/null.

    I think it is cool idea but does it break ispconfig user setting - he could choose only from delete/rewrite subject - so what about this spam move to another folder? Oh, i know - change delete action to just move to spam folder:)

    Thaks, for answers and hope to summary these topics after testing on our brand new, fantastic quad core machine:)
  12. jmroth

    jmroth ISPConfig Developer ISPConfig Developer

    Yeah sure I do that for myself, but I move it to the .Trash folder. I am not sure what happens what Spamassassin is supposed to learn (i.e. add as spam to the bayes database) when it has already classified the stuff as Spam. I guess next times it would just score it as even worse spam. (However, once in the bayes database it remembers what mail it has already seen by message ID or so. That gives you the option to remove it (unlearn).)
    I'm not sure if you need to do that for every user. I just give them the option to create a Spam folder by themselves (if they understand what it is good for), or just leave it. I also only tag their mail but don't move it from the inbox. Especially for new users doing that might be confusing.
    Last but not least, it's not configurable with the control panel directly, but you can of course implicitly add it to the code so "rewrite subject" means "also move it". It certainly would be a cool feature for the UI for the future.
  13. jbravo

    jbravo Member

    Found some more interesting topics

    Digging forum gives me full response about creating additional folders:
    I haven't tried it yet but it seems to be ok.

    I've setup clamd/freshclam (have to upgrade from another opensuse repository - SLES10 has old version ) and spamc (same situation - upgrade from other repo to newest version).
    Found only pyzor and dcc and not razor2 (smobody have it for sles10?).
    Configured and checked with
    spamd -D <sample_spam
    that tey work.

    Let's back to spamc by user features: i can see in /var/log/mail that spamc works and even setuid to ma test user (web1_azor):
    But i've seen many errors ralated to users spamassasin user_prefs file:
    and this pyzor error:
    I have pyzor-0.4.0-4.2 installed on my SLES10 and there is .pyzor/servers file with this data:
    I've also setup (somewhere on this forum guide) procmail logging to be sure what commands procmail executes - but it is only some kind of debug info in the beginning of server deploying.
  14. jmroth

    jmroth ISPConfig Developer ISPConfig Developer

    to the error messages: what is unclear when it says "not parsing, 'allow_user_rules' is 0" in each second line? See

    If you want certain blacklists for all users, just put them in the system configuration. No need to put it into every user's file.

    As for "spamd -D < message" you probably shoud do: "spamd -D" in one console to see its output and then "spamc < message" and see what happens. Or just add "-D" to the standard "spamd -d" and watch the logs.
  15. jbravo

    jbravo Member

    Now it is clear:) Thanks for tip. Especially that enabling these rules gives significant performance drop - i will just delete these entries from user_prefs even if they are not parsed.

    Sure, but what about ISPConfig interface enabling users to add them?

    You're right once again:) I'v tried several spamassasin commands and get correct output but wrote different cmd in post.

    BTW Do you run sa-update from time to time? I've read about that is is next good practice (beside sa-learn).

    So, i need to polish my spamassasin plugins (pyzor, dcc, possibly razor2 after i'll find it) to increase spam recognizing and after - setup [email protected] logins into pop3/imap/smptp (courier/postfix) just like you guys done on this forum.
    I hope it would be available and default feature in next ispconfig release.

    Greetz .:JbRaVo:.
  16. lucos66

    lucos66 New Member

    configure SPAMC OVER NETWORK

    Hi all. please forgive if this question is not on correct location.

    I have a core quad machine ( RHEL5 ) with spamassassin installed.
    I have another machine with my mail server installed ( RHEL3 ).

    I bought this server ONLY to process spams and to deliver the email to the user´s mail box.

    Thanks in advance.
  17. jmroth

    jmroth ISPConfig Developer ISPConfig Developer

    I would've first thought about that and *then* bought a server.
  18. falko

    falko Super Moderator ISPConfig Developer

    This might be possible with Postfix transports. See
    man 5 transport
  19. lucos66

    lucos66 New Member

    well, in fact, it is almost working..... here is the sittuation :
    I have a RHEL5 with spamassassin/spamd workin fine. I have a RHEL3 with mail system working fine... now, all that I have to do is to install the spamassassin into RHEL3, so I´ll have the spamc for that version and I´ll be able to send the email to be processed by spamd in the RHEL5 machine. I read the spamc manual and seems to be possible to send the email to other host.....
    but the main problem is that I CAN´T COMPILE OR INSTALL the spamassassin into RHEL3 !!! I recieve error messages about HTML::parser. when I try to install it by CPAN, I receive another errors.... !! I´m really upset with all this mess.....
    does anybody have the spamc file compiled for RHEL3 ? could you send it to me ?
    thanks you all.
  20. lucos66

    lucos66 New Member

    FINALLY !! I did compile it !! well, now I have both servers ( RHEL5 and RHEL3 ) with spamc/spamd working. this is the .procmailrc of my test user :
    | /usr/bin/spamc -d -u root
    It seems to be working, because if I change the command to something like this : /usr/bin/spamc -d10.0.1.101 -uroot I receive an error message in my promailrc.log.
    the fact is that is losting my emails... ( all of them ).
    does anybody know how to set this up ??

Share This Page