Mailscanner+header_checks not work

Discussion in 'Server Operation' started by wizard, Oct 24, 2008.

  1. wizard

    wizard New Member

    Deer all;
    I install email server from http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu8.04
    OK it work.
    and i install mailscanner from http://howtoforge.com/the-perfect-spamsnake-ubuntu-8.04 step 8.1-15.

    when i test mail mailscanner is log file to database but can't send mail to destination.

    ****************************************
    log

    Oct 24 13:10:31 www postfix/master[5940]: daemon started -- version 2.5.1, configuration /etc/postfix
    Oct 24 13:10:57 www postfix/pickup[5942]: B60983DC539: uid=0 from=<root>
    Oct 24 13:10:57 www postfix/cleanup[5947]: B60983DC539: hold: header Received: by mail.ayt.th.com (Postfix, from userid 0)??id B60983DC539; Fri, 24 Oct 2008 13:10:57 +0700 (ICT) from local; from=<[email protected]> to=<[email protected]>
    Oct 24 13:10:57 www postfix/cleanup[5947]: B60983DC539: message-id=<[email protected]>
    Oct 24 13:10:58 www MailScanner[5393]: New Batch: Scanning 1 messages, 538 bytes
    Oct 24 13:10:59 www MailScanner[5393]: Whitelist refresh time reached
    Oct 24 13:10:59 www MailScanner[5393]: Starting up SQL Whitelist
    Oct 24 13:10:59 www MailScanner[5393]: Read 1 whitelist entries
    Oct 24 13:10:59 www MailScanner[5393]: Virus and Content Scanning: Starting
    Oct 24 13:11:03 www MailScanner[5393]: Started SQL Logging child
    Oct 24 13:11:08 www MailScanner[5393]: Logging message B60983DC539.B9DB0 to SQL
    Oct 24 13:11:09 www MailScanner[5393]: Config: calling custom end function SQLBlacklist
    Oct 24 13:11:09 www MailScanner[5957]: B60983DC539.B9DB0: Logged to MailWatch SQL
    Oct 24 13:11:09 www MailScanner[5393]: Closing down by-domain spam blacklist
    Oct 24 13:11:09 www MailScanner[5393]: Config: calling custom end function MailWatchLogging
    Oct 24 13:11:09 www MailScanner[5393]: Config: calling custom end function SQLWhitelist
    Oct 24 13:11:10 www MailScanner[5393]: Closing down by-domain spam whitelist
    Oct 24 13:11:10 www MailScanner[5393]: MailScanner child dying of old age
    Oct 24 13:11:10 www MailScanner[5958]: MailScanner E-Mail Virus Scanner version 4.68.8 starting...
    Oct 24 13:11:11 www MailScanner[5958]: Read 817 hostnames from the phishing whitelist
    Oct 24 13:11:11 www MailScanner[5958]: Read 5141 hostnames from the phishing blacklist
    Oct 24 13:11:11 www MailScanner[5958]: Config: calling custom init function SQLBlacklist
    Oct 24 13:11:11 www MailScanner[5958]: Starting up SQL Blacklist
    Oct 24 13:11:12 www MailScanner[5958]: Read 0 blacklist entries
    Oct 24 13:11:12 www MailScanner[5958]: Config: calling custom init function MailWatchLogging
    Oct 24 13:11:12 www MailScanner[5958]: Started SQL Logging child
    Oct 24 13:11:12 www MailScanner[5958]: Config: calling custom init function SQLWhitelist
    Oct 24 13:11:13 www MailScanner[5958]: Starting up SQL Whitelist
    Oct 24 13:11:13 www MailScanner[5958]: Read 1 whitelist entries
    Oct 24 13:11:13 www MailScanner[5958]: SpamAssassin temporary working directory is /var/spool/MailScanner/incoming/SpamAssassin-Temp
    Oct 24 13:11:13 www MailScanner[5958]: Using SpamAssassin results cache
    Oct 24 13:11:14 www MailScanner[5958]: Connected to SpamAssassin cache database
    Oct 24 13:11:14 www MailScanner[5958]: Enabling SpamAssassin auto-whitelist functionality...
    Oct 24 13:11:17 www pop3d: Connection, ip=[::ffff:192.168.3.1]

    ***************************************
    But when i comment #header_checks = regexp:/etc/postfix/header_checks
    Mailscanner does't log file to database but email can delivery to destination.

    ***************************************
    log

    Oct 24 13:26:36 www postfix/master[6045]: daemon started -- version 2.5.1, configuration /etc/postfix
    Oct 24 13:26:47 www postfix/pickup[6047]: 289AF3DC539: uid=0 from=<root>
    Oct 24 13:26:47 www postfix/cleanup[6052]: 289AF3DC539: message-id=<[email protected]>
    Oct 24 13:26:47 www postfix/qmgr[6048]: 289AF3DC539: from=<[email protected]>, size=301, nrcpt=1 (queue active)
    Oct 24 13:26:48 www postfix/smtp[6055]: 289AF3DC539: to=<[email protected]>, relay=mx4.hotmail.com[65.54.245.104]:25, delay=1.8, delays=0.2/0.28/1.2/0.13, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as B539AC18002)
    Oct 24 13:26:48 www postfix/qmgr[6048]: 289AF3DC539: removed

    ***********************************************
    Detail main.cf

    # See /usr/share/postfix/main.cf.dist for a commented, more complete version


    # Debian specific: Specifying a file name will cause the first
    # line of that file to be used as the name. The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname

    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no

    # appending .domain is the MUA's job.
    append_dot_mydomain = no

    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h

    readme_directory = /usr/share/doc/postfix

    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.

    myhostname = mail.ayt.th.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = $myhostname, localhost.$mydomain, $mydomain, localhost.localdomain, localhost
    relayhost =
    mynetworks = 127.0.0.0/8
    #mailbox_command =
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    home_mailbox = Maildir/
    #home_mailbox = Mailbox
    html_directory = /usr/share/doc/postfix/html
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_mailbox_extended = yes
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    header_checks = regexp:/etc/postfix/header_checks

    *****************************

    What wrong and how to solved this problem ?

    Thank you.
     
  2. Rocky

    Rocky New Member

    Are you trying to accomplish a virtual user setup? The SpamSnake was meant to be a spam gateway so you might want to follow the virtual setup completely.

    Rocky
     
  3. wizard

    wizard New Member

    A virtual user setup ..I setup completed and i can send email . but when i add header_checks = regexp:/etc/postfix/header_checks in main.cf email can't delivery. How to check step by step ,what wrong ?

    thank you.
     
    Last edited: Oct 25, 2008

Share This Page