Home Forums OS X Server and Client Discussion Questions and Answers Spam and Virus Controls with Postfix

Viewing 12 posts - 16 through 27 (of 27 total)
  • Author
    Posts
  • #357742
    carl
    Participant

    iztech,

    I believe all of those modules should have been included in step 4. It’s easy to correct, though. Just issue the command, “sudo perl -MCPAN -e shell” again. Then in the CPAN shell, enter the command “install <ModuleName>” where <ModuleName> is replaced by the missing modules (ex. “install IO::Wrap” without quotes). Remember to install any dependencies if prompted to do so.

    If you attempt to install any modules that are already installed, I think you’ll receive a message that the module is up to date (no harm done).

    Let us know how that works for you. If anyone who reads this sees a mistake (I’m no expert here), please correct me.

    Carl

    #357750
    iztech
    Participant

    i managed to get everything loaded after downloading xtools from apple developer site.

    clamav is working becuase i tested it on a virus and it reflected 1 virus.

    postfix is working fine but when i send an email with a virus it goes through.

    also does this setup scan for spam as well?

    #357751
    carl
    Participant

    Postfix will scan for spam if you have SpamAssassin configured. Both SpamAssassin and ClamAV will need to be called from Postfix. If one isn’t working, you’ll need to check the mail log (/var/log/mail.log) for details.

    Step 5 explains how to configure Postfix to call amavis. Amavis actually calls ClamAV and SpamAssassin (configured in the /etc/amavisd.conf file).

    #357752
    iztech
    Participant

    thanks carl and joel

    i am almost there. it seems for some reason the
    content_filter=smtp-amavis:[127.0.0.1]:10024 was not sticking. it finally got saved and now i have another problem.

    in the debug window i am seeing a lot of
    can’t connect to 127.0.0.1 port 10025

    mail is coming in but is getting lost somewhere and it’s not getting bounced either.

    i must be missing something prety clear…

    #357754
    Anonymous
    Participant

    If I understand correctly, mail is delivered to PostFix, handed to amavisd, and then given back to PostFix.

    The file main.cf includes information on how to deliver the mail to amavisd:
    [code:1:da0f596794]content_filter=smtp-amavis:[127.0.0.1]:10024[/code:1:da0f596794]
    The file amavisd.conf tells Amavis to listen on the correct port:
    [code:1:da0f596794]$inet_socket_port = 10024;[/code:1:da0f596794]
    The file master.cf tells PostFix to listen for responses on a different port:
    [code:1:da0f596794]127.0.0.1:10025 inet n – y – – smtpd
    -o content_filter=
    -o local_recipient_maps=
    -o relay_recipient_maps=
    -o smtpd_restriction_classes=
    -o smtpd_client_restrictions=
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks=127.0.0.0/8
    [/code:1:da0f596794]
    Check master.cf to be sure that you copied the information correctly. You can test that port with the following command:
    [code:1:da0f596794]# telnet localhost 10025[/code:1:da0f596794]
    The server should respond with:
    [code:1:da0f596794]Trying 127.0.0.1…
    Connected to localhost.
    Escape character is ‘^]’.
    220 mta1.domain.com ESMTP
    [/code:1:da0f596794]
    press ctrl-], then type ‘quit’ to quit

    Hope this gets you going again.

    Carl

    #357765
    iztech
    Participant

    thanks for helping.

    everything is working. that is except my login system.
    that’s why my previous post states where is the mail going…

    when i changed from authentication to plain password checking using accounts created for each user in the system everything worked.

    i hope i don’t have to end up with this method.

    i have created a new thread discussing this.

    #357855
    Anonymous
    Participant

    Create a directory in /Library/StartupItems – name it Amavis
    Make sure permissions are correct.
    Inside the Amavis directory, create a file: Amavis
    Insert this into Amavis file:

    #!/bin/sh

    . /etc/rc.common

    StartService ()
    {
    if [ “${Amavis:=-NO-}” = “-YES-” ]; then
    ConsoleMessage “Starting Amavis”
    su clamav -c amavisd
    freshclam -d -c 2 -l /var/log/clam-update.log
    fi
    }

    StopService ()
    {
    ConsoleMessage “Stopping Amavis”
    }

    RunService “$1”

    Inside the Amavis directory, create a file: StartupParameters.plist
    Insert this into StartupParameters.plist:

    {
    Description = “Whatever You Want It To Say”;
    Provides = (“Amavis”);
    Requires = (“Resolver”);
    Preference = “None”;
    Messages =
    {
    start = “Starting Amavis”;
    stop = “Stopping Amavis”;
    };
    }

    Ceate a line in /etc/hostconfg and add this to the bottom:

    Amavis=-YES-

    Hope this does it.

    #357859
    iztech
    Participant

    thanks for the script to startup amavis.

    i have been running everything with the debug window.

    please look at the post “spam getting through, virus emails get stopped”
    i have posted a log.
    virus are being blocked but not spam.

    in the header it is showing x-virus scan by amavisd-new but nothing indicating spam scanning.

    also the amount of spam coming through is another indication that spam is not being stopped.

    not sure how i can trouble shoot this.

    thanks

    #357927
    Anonymous
    Participant

    I’ve installed everything, got to the point of testing it when…

    May 3 05:23:33 server postfix/smtp[24386]: fatal: unexpected command-line argument: 127.0.0.1:10025

    appears in the log whenever I send a message in.

    Any ideas gratefully received, as all incoming mail is being blocked…

    many thanks

    fraser

    #357933
    dana_drury
    Participant

    Hi Fraser,

    I found that the GUI completely screws up your master.cf if you use it to control your mail.

    I discovered by stopping the mail process, then editing the master.cf.defaultserver.swap file with the:

    smtp-amavis unix – – y – 2 smtp etc then it works fine because it swaps back the correct configuration, I did this after 40 minutes of pulling my hair out and it all worked fine.

    #357934
    Anonymous
    Participant

    Thanks for the suggestion, Dana, but when I test the port I’m still getting this:

    [server:/Users/admin] clamav% telnet 127.0.0.1 10025
    Trying 127.0.0.1…
    telnet: connect to address 127.0.0.1: Connection refused
    telnet: Unable to connect to remote host
    [server:/Users/admin] clamav%

    Did you restart the mail service in server admin, or just do ‘postfix reload’?

    Thanks

    Fraser

    #357942
    Anonymous
    Participant

    Aha! I think I’ve cracked it. For some reason, editing master.cf.defaultserver.swap with emacs rather than Text Edit had the required effect.. (Why? I cannot guess)

    Thanks for your help

    Fraser

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

Comments are closed