Home Forums OS X Server and Client Discussion Mail Automatic learning of junk mail by SpamAssassin for 10.4

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #361934
    frequencydip
    Participant

    The Tiger Server documentation, claims that two e-mail accounts (junkmail and notjunkmail) will run a cron job at 1 am to train the filter.

    Is this really happening. I don’t see any messages that a process called sa-learn is being created (this should appear in the system.log, right?) if not there where would I see the results. I don’t belive it to be running because mail I send to notjunkmail is still being marked as junkmail and the system does not seam to be filtering more mail after attempting to train it.

    If this cron job won’t run automatically how do I run it manually?
    Thanks for any help? Question

    #362142
    Anonymous
    Guest

    Did you have any luck ? This problem is unchanged for a clean install of 10.4 server with the 10.4.1 and security updates applied.

    Seems to me Apple forgot a launchd plist for this !
    There’s certainly no crontab for root…

    I created this launchdaemon plist by copying and editing the plist for com.apple.periodic-daily.plist:

    /System/Library/LaunchDaemons/com.apple.learnjunkmail.plist

    and then loaded it with:
    launchctl load /system/library/launchdaemons/com.apple.learnjunkkmail.plist

    ## file-content follows this line ##


    Label
    com.apple.learnjunkmail.plist
    ProgramArguments

    /etc/mail/spamassassin/learn_junk_mail
    daily

    StartCalendarInterval

    Hour
    1
    Minute
    15

    And it ran as it should.

    #362150
    Anonymous
    Guest

    Since it should be run as user clamav , I changed the plist to as follows (and fixed my posting to display properly):

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>com.apple.learnjunkmail.plist</string>
    <key>ProgramArguments</key>
    <array>
    <string>/etc/mail/spamassassin/learn_junk_mail</string>
    <string>daily</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>1</integer>
    <key>Minute</key>
    <integer>15</integer>
    </dict>
    <key>UserName</key>
    <string>clamav</string>
    </dict>
    </plist>

    #362455
    papplegate
    Participant

    What output in the logs will show that the script ran at 1am? I do not see anything that would indicate that it ran successfully.
    Thanks,
    Paul

    #362463
    Anonymous
    Guest

    There is an alternative: put a symbolic link of the script in /etc/periodic/daily

    ln -s /etc/mail/spamassassin/learn_junk_mail /etc/periodic/daily/750.learn_junk_mail
    
    

    Output should be in /var/log/daily.out

    #362489
    woodgie
    Participant

    Where is it set that the eMail accounts the SpamAssasin cron job looks at are called ‘junkmail’ and ‘notjunkmail’ and is it a good idea to change this if you can?

    It was noted somewhere else (I forget where I read it) that ‘junkmail’ and ‘notjunkmail’ might be open to abuse as spammers can send to ‘notjunkmail’ first to teach SA bad habits.

    I have so many damned questions, and the Apple manuals are simplistic to the point of torture!

    #362502
    papplegate
    Participant

    [QUOTE BY= Jelle] There is an alternative: put a symbolic link of the script in /etc/periodic/daily

    ln -s /etc/mail/spamassassin/learn_junk_mail /etc/periodic/daily/750.learn_junk_mail
    
    
    

    Output should be in /var/log/daily.out

    [/QUOTE]
    Going to try that, because I do not see any evidence that is working via the other method.

    #362503
    papplegate
    Participant

    [QUOTE BY= woodgie] Where is it set that the eMail accounts the SpamAssasin cron job looks at are called ‘junkmail’ and ‘notjunkmail’ and is it a good idea to change this if you can?

    It was noted somewhere else (I forget where I read it) that ‘junkmail’ and ‘notjunkmail’ might be open to abuse as spammers can send to ‘notjunkmail’ first to teach SA bad habits.

    I have so many damned questions, and the Apple manuals are simplistic to the point of torture![/QUOTE]

    I do not know, but would like to know, to change then as well. It makes sense to have a “non-public” address, by that I mean one that has not been shown in the docs to prevent what woodgie was takling about.

    #362835
    serversolutions
    Participant

    Two things:

    First, you can resttrict those accounts from recieving mail from outside domains by using a hash statment in the postfix config files.

    Second, that plist isn’t working for me.

    What gives???

    if you have one that is working tar it up and e-mail it to me at –> Dale

    #362995
    Luc-Olivier
    Participant

    [QUOTE BY= heteronymous] Since it should be run as user clamav , I changed the plist to as follows (and fixed my posting to display properly):
    …[/QUOTE]

    I can run as root because all "sa-learn" command are su "clamav".

    #363032
    Anonymous
    Guest

    additionally, you are supposed to delete the mail in the junk/notjunk accounts each night… what is the best way to script this if its not already there?

    #363033
    Anonymous
    Guest

    here is the thread at apple discussions: http://discussions.apple.com/[email protected]@.68aedf14

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.

Comments are closed