Note: It is not necessary to stop the Mail Server before completing the following tasks.
- Open Server Admin.
- Choose Mail-> Settings->Filters.
- At the bottom of the window look for "Update the virus database __ times per day." Make note of the number of times the database is updated.
- If "Update the virus database __ times per day" is enabled, leave it on.
- Open Terminal.
- Execute the following command:
sudo nano /System/Library/LaunchDaemons/org.clamav.freshclam.plist(The following steps can be performed in any text editor that will save plain text, or in Property List Editor, but you must be logged in as root to edit the org.clamav.freshclam.plist in a graphical application. You can also copy the file to the desktop, edit it, and copy it back to the original location.)
- Enter your admin password when prompted.
- Locate the following text:
<key>ProgramArguments</key> <array> <string>freshclam</string> <string>-d</string> <string>-c #n</string> </array>Note: "#n" denotes a numeric value that will match the value noted in Server Admin->Mail->Settings->Filters' "Update the virus database __ times per day".
- On the line that states "<string>-c #n</string>", remove the space between the "c" and the number sign (#) following it.
- Edit the #n numeric value. This value determines how many time a day ClamAV will run freshclam to update its virus definition database. This can be any number from 1 (once per day) to 50 (every 29 minutes).
- Save the changes (press Control-O).
- Press Control-X to quit nano.
- Execute the following two commands to unload and reload the org.clamav.freshclam.plist:
sudo launchctl unload /System/Library/LaunchDaemons/org.clamav.freshclam.plist sudo launchctl load /System/Library/LaunchDaemons/org.clamav.freshclam.plist
ClamAV should now update normally.
Once the /System/Library/LaunchDaemon/org.clamav.freshclam.plist has been modified, you should not use the Server Admin->Mail->Setting->Filters' "Update the virus database [x] times per day" to change the update frequency. Changes made in Server Admin will cause the org.clamav.freshclam.plist to be rewritten and in some cases may cause the space that was removed to reappear.