Results 1 to 7 of 7

Thread: Zimbra Postfix Amavis with PHP mail function

  1. #1
    Join Date
    May 2010
    Location
    Budapest
    Posts
    56
    Rep Power
    5

    Default Zimbra Postfix Amavis with PHP mail function

    Hello!
    I am using zimbra installed on a debian machine.
    I have a website that uses zimbra's postfix to send mails out.
    Sometimes some messages ending upt in the junk/spam folder. Today I've checked the zimbra logs and I've found if I send a message on the zimbra webmail, amavis says:

    Code:
    amavis[26385]: (26385-03) Passed CLEAN, MYNETS LOCAL [00.00.00.00] [00.00.00.00] <from@mail.com> -> <to@mail.com>, Message-ID: <2049177327.13455.1337847879145.JavaMail.root@hostname>, mail_id: bz0l-NSUM37Y, Hits: 0.513, size: 4065, queued_as: 7F1421114004, 825 ms
    But when I send it with php amavis says:
    Code:
     amavis[17602]: (17602-05) Passed BAD-HEADER, <www-data@hostname.com> -> <to@mail.com>, quarantine: badh-N4ixavs0FsR3, Message-ID: <20120524082948.3F43A1114001@hostname.com>, mail_id: N4ixavs0FsR3, Hits: -1.176, size: 3714, queued_as: 06CA81114007, 820 ms
    What can I do to make it work, and not te get Bad Header message?

    My php.con for sendmail is:
    Code:
    [mail function]
    ; For Win32 only.
    ;SMTP = localhost
    ;smtp_port = 25
    
    ; For Win32 only.
    ;sendmail_from = me@example.com
    
    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    sendmail_path = /opt/zimbra/postfix/sbin/sendmail -t
    Tibby

  2. #2
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,587
    Rep Power
    58

    Default

    Quote Originally Posted by tibby View Post
    What can I do to make it work, and not te get Bad Header message?
    Send it through the correct submission port which is 587 and authentication is also required.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    Join Date
    May 2010
    Location
    Budapest
    Posts
    56
    Rep Power
    5

    Default

    Quote Originally Posted by phoenix View Post
    Send it through the correct submission port which is 587 and authentication is also required.
    And how do I configure php for that ?
    What do I need to change in php.conf?

    Port number, ok.
    What else ?
    How Do I add authentication ?
    Tibby

  4. #4
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    You should set the from and reply-to email addresses to be a domain that is fully resolvable as-well if it is not already.

  5. #5
    Join Date
    May 2010
    Location
    Budapest
    Posts
    56
    Rep Power
    5

    Default

    Quote Originally Posted by uxbod View Post
    You should set the from and reply-to email addresses to be a domain that is fully resolvable as-well if it is not already.
    It's fine. Both are the same, and the domain can be resolved.
    Tibby

  6. #6
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    The best approach would be to use the 587 submission port as Phoenix has mentioned; though that would require setting up authentication from PHP mail. Another approach would be to understand why Amavis is marking it as spam. You could increase the log_level in /opt/zimbra/conf/amavisd.conf.in and then perform a zmamavisdctl restart. Send another email and check your zimbra.log to see what Amavis is doing with the mail.

  7. #7
    Join Date
    May 2010
    Location
    Budapest
    Posts
    56
    Rep Power
    5

    Default

    Quote Originally Posted by uxbod View Post
    The best approach would be to use the 587 submission port as Phoenix has mentioned; though that would require setting up authentication from PHP mail. Another approach would be to understand why Amavis is marking it as spam. You could increase the log_level in /opt/zimbra/conf/amavisd.conf.in and then perform a zmamavisdctl restart. Send another email and check your zimbra.log to see what Amavis is doing with the mail.
    It still shows: "BAD-HEADER"

    Here is the amavis log:
    Code:
    amavis[2599]: (02599-02) ESMTP< RCPT TO:<recipient@mail.com> ORCPT=rfc822;recipient@mail.com\r\n
    amavis[2599]: (02599-02) lookup_acl(recipient@mail.com), no match
    amavis[2599]: (02599-02) lookup [local_domains] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) query_keys: recipient@mail.com, @mail.com, @.mail.com, mail.com, @.com, com, @.
    amavis[2599]: (02599-02) lookup_ldap "recipient@mail.com", query keys: "recipient@mail.com", "@mail.com", "@.mail.com", "mail.com", "@.com", "com", "@.", base: , filter: (&(objectClass=amavisAccount)(|(mail=%m)(zimbraDomainName=%m)))
    amavis[2599]: (02599-02) lookup_ldap: searching base="", scope="sub", filter="(&(objectClass=amavisAccount)(|(|(mail=recipient@mail.com)(mail=@mail.com)(ail=@.mail.com)(mail=mail.com)(mail=@.com)(mail=.com)(mail=com)(mail=@.))(|(zimbraDomainName=recipient@mail.com)(zimbraDomainName=@.mail.com)(zimbraDomainName=mail.com)(zimbraDomainName=@.com)(zimbraDomainName=com)(zimbraDomainName=@.))))"
    amavis[2599]: (02599-02) lookup_ldap, "recipient@mail.com" no match
    amavis[2599]: (02599-02) lookup_ldap_attr(amavismessagesizelimit), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [message_size_limit] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) ESMTP> 250 2.1.5 Recipient <recipient@mail.com> OK
    amavis[2599]: (02599-02) ESMTP::10024 /opt/zimbra/data/amavisd/tmp/amavis-20120524T164327-02599: <sender@mail.com> -> <recipient@mail.com> SIZE=2795 Receive: from serverhostname.net ([127.0.0.1]) by localhost (serverhostname.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP for <recipient@mail.com>; Tcom, 24 May 2012 17:25:14 +200 (CEST)
    amavis[2599]: (02599-02) Checking: yByjYQ+Bg0Fj <sender@mail.com> -> <recipient@mail.com>
    amavis[2599]: (02599-02) lookup_ldap_attr(amavislocal), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup_acl(recipient@mail.com), no match
    amavis[2599]: (02599-02) lookup [local_domains] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisbypassviruschecks), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) query_keys: recipient@mail.com, recipient@, mail.com, .mail.com, .com, com, .
    amavis[2599]: (02599-02) lookup_hash(recipient@mail.com), no matches
    amavis[2599]: (02599-02) lookup [bypass_virus_checks] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisbypassbannedchecks), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) query_keys: recipient@mail.com, recipient@, mail.com, .mail.com, .com, com, .
    amavis[2599]: (02599-02) lookup_hash(recipient@mail.com), no matches
    amavis[2599]: (02599-02) lookup [bypass_banned_checks] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisbypassspamchecks), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) query_keys: recipient@mail.com, recipient@, mail.com, .mail.com, .com, com, .
    amavis[2599]: (02599-02) lookup_hash(recipient@mail.com), no matches
    amavis[2599]: (02599-02) lookup [bypass_spam_checks] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) Open relay? Nonlocal recips but not originating: recipient@mail.com
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisbypassheaderchecks), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) query_keys: recipient@mail.com, recipient@, mail.com, .mail.com, .com, com, .
    amavis[2599]: (02599-02) lookup_hash(recipient@mail.com), no matches
    amavis[2599]: (02599-02) lookup [bypass_header_checks] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisbypassheaderchecks), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) query_keys: recipient@mail.com, recipient@, mail.com, .mail.com, .com, com, .
    amavis[2599]: (02599-02) lookup_hash(recipient@mail.com), no matches
    amavis[2599]: (02599-02) lookup [bypass_header_checks] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisbannedrulenames), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [banned_filename], 1 matches for "recipient@mail.com", results: "(constant:DEFAULT)"=>"DEFAULT"
    amavis[2599]: (02599-02) collect banned table[0]: recipient@mail.com, tables: DEFAULT=>Amavis::Lookup::RE=ARRAY(0x3324470)
    amavis[2599]: (02599-02) doing banned check for recipient@mail.com on .asc,preamble
    amavis[2599]: (02599-02) lookup [check_bann:recipient@mail.com] => undef, [".asc","preamble"] does not match
    amavis[2599]: (02599-02) p.path recipient@mail.com: "P=p003,L=1,T=asc,N=preamble"
    amavis[2599]: (02599-02) doing banned check for recipient@mail.com on multipart/alternative | text/plain,.txt
    amavis[2599]: (02599-02) lookup [check_bann:recipient@mail.com] => undef, ["multipart/alternative","text/plain",".txt"] does not match
    amavis[2599]: (02599-02) p.path recipient@mail.com: "P=p004,L=1,M=multipart/alternative | P=p001,L=1/1,M=text/plain,T=txt"
    amavis[2599]: (02599-02) doing banned check for recipient@mail.com on multipart/alternative | text/html,.txt
    amavis[2599]: (02599-02) lookup [check_bann:recipient@mail.com] => undef, ["multipart/alternative","text/html",".txt"] does not match
    amavis[2599]: (02599-02) p.path recipient@mail.com: "P=p004,L=1,M=multipart/alternative | P=p002,L=1/2,M=text/html,T=txt"
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisblacklistsender), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) lookup_ldap_attr(amaviswhitelistsender), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) lookup [blacklist_recip<recipient@mail.com>] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) lookup [whitelist_recip<recipient@mail.com>] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) query_keys: recipient@mail.com, recipient@, mail.com, .mail.com, .com, com, .
    amavis[2599]: (02599-02) lookup_hash(recipient@mail.com) matches keys: "."=>ARRAY(0x3c87d18)
    amavis[2599]: (02599-02) lookup [score_recip<recipient@mail.com>,score_sender], 1 matches for "recipient@mail.com", results: "."=>[Amavis::Lookup:RE=ARRAY(0x3c878f8),HASH(0x3c879d0)]
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisspamtaglevel), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [spam_tag_level] => true,  "recipient@mail.com" matches, result="-10", matching_key="(constant:-10)"
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisspamtag2level), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [spam_tag2_level] => true,  "recipient@mail.com" matches, result="6.6", matching_key="(constant:6.6)"
    amavis[2599]: (02599-02) lookup [spam_tag3_level] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisspamkilllevel), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [spam_kill_level] => true,  "recipient@mail.com" matches, result="15", matching_key="(constant:15)"
    amavis[2599]: (02599-02) lookup_ldap_attr(amavismessagesizelimit), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [message_size_limit] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) final_destiny (ccat=4) is PASS, recip recipient@mail.com
    amavis[2599]: (02599-02) final_destiny (ccat=0) is PASS, recip recipient@mail.com
    amavis[2599]: (02599-02) final_destiny PASS, recip recipient@mail.com
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisspamtaglevel), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [spam_tag_level] => true,  "recipient@mail.com" matches, result="-10", matching_key="(constant:-10)"
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisspamtag2level), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [spam_tag2_level] => true,  "recipient@mail.com" matches, result="6.6", matching_key="(constant:6.6)"
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisspamkilllevel), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [spam_kill_level] => true,  "recipient@mail.com" matches, result="15", matching_key="(constant:15)"
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisbadheaderquarantineto), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [bad_header_quarantine_to] => true,  "recipient@mail.com" matches, result="bad-header-quarantine", matching_key="(constant:bad-headerquarantine)"
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisbadheaderadmin), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [bad_header_admin] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) header: X-Envelope-To: <recipient@mail.com>\n
    amavis[2599]: (02599-02) header: Received: from serverhostname.net ([127.0.0.1])\n\tby localhost (serverhostname.net [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP idyByjYQ+Bg0Fj\n\tfor <recipient@mail.com>;\n\tTcom, 24 May 2012 17:25:14 +0200 (CEST)\n
    amavis[2599]: (02599-02) lookup_ldap_attr(amaviswarnbadheaderrecip), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [warnbadhrecip] => undef, "recipient@mail.com" does not match
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisspamtaglevel), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [spam_tag_level] => true,  "recipient@mail.com" matches, result="-10", matching_key="(constant:-10)"
    amavis[2599]: (02599-02) lookup_ldap_attr(amavisspamtag2level), "recipient@mail.com" no matching records
    amavis[2599]: (02599-02) lookup [spam_tag2_level] => true,  "recipient@mail.com" matches, result="6.6", matching_key="(constant:6.6)"
    amavis[2599]: (02599-02) headers CLUSTERING: NEW CLUSTER <recipient@mail.com>: score=-0.808, tag=1, tag2=0, local=0, bl=, s=, mangle=
    amavis[2599]: (02599-02) header: Received: from serverhostname.net ([127.0.0.1])\n\tby localhost (serverhostname.net [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP idyByjYQ+Bg0Fj\n\tfor <recipient@mail.com>;\n\tTcom, 24 May 2012 17:25:14 +0200 (CEST)\n
    amavis[2599]: (02599-02) (about to connect to [127.0.0.1]:10025) FWD via SMTP: <sender@mail.com> -> <recipient@mail.com>
    amavis[2599]: (02599-02) smtp cmd> RCPT TO:<recipient@mail.com> ORCPT=rfc822;recipient@mail.com
    amavis[2599]: (02599-02) rw_loop sent 144> MAIL FROM:<sender@mail.com>\r\nRCPT TO:<recipient@mail.com> ORCPT=rfc822;recipient@mail.com\r\DATA\r\n
    amavis[2599]: (02599-02) smtp resp to RCPT (pip) (<recipient@mail.com>): 250 2.1.5 Ok
    amavis[2599]: (02599-02) smtp resp to data-dot (<recipient@mail.com>): 250 2.0.0 Ok: queued as 617C61114004
    amavis[2599]: (02599-02) FWD via SMTP: <sender@mail.com> -> <recipient@mail.com>, 250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 617C6111400
    amavis[2599]: (02599-02) dsn: from MTA 250 NonBlocking:BadHdrDupl <sender@mail.com> -> <recipient@mail.com>: on_succ=0, on_dly=1, on_fail=1, never=0, warn_snder=, DSN_passed_on=1, mta_resp: "250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 617C61114004"
    amavis[2599]: (02599-02) DSN: SUCC from MTA 250 NonBlocking:BadHdrDupl, no DSN requested: <sender@mail.com> -> <recipient@mail.com>
    amavis[2599]: (02599-02) Passed BAD-HEADER, <sender@mail.com> -> <recipient@mail.com>, quarantine: badh-yByjYQ+Bg0Fj, Message-ID: <20120524152514.8512E111401@serverhostname.net>, mail_id: yByjYQ+Bg0Fj, Hits: -0.808, size: 2793, queued_as: 617C61114004, 762 ms
    postfix/smtp[21526]: 8512E1114001: to=<recipient@mail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=1, delays=0.25/0.01/0.01/0.76, dsn=2.0.0, status=sent (250 2.0.0 rom MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 617C61114004)
    postfix/smtp[21531]: 617C61114004: to=<recipient@mail.com>, relay=mail.mail.com[00.00.00.00]:25, delay=0.24, delays=0.08/0.01/0.11/0.03, dsn=2.0.0, staus=sent (250 2.0.0 Ok: queued as BEE38B3B)
    Tibby

Similar Threads

  1. Mysql.server Does Not Start
    By carnold in forum Administrators
    Replies: 7
    Last Post: 01-16-2012, 07:13 AM
  2. Replies: 24
    Last Post: 07-13-2011, 09:47 AM
  3. Replies: 7
    Last Post: 02-03-2011, 07:01 AM
  4. server dropped connection
    By ferra in forum Installation
    Replies: 20
    Last Post: 10-06-2008, 05:32 PM
  5. Big Fubar on 5 FOSS GA Upgrade
    By uxbod in forum Administrators
    Replies: 24
    Last Post: 01-21-2008, 03:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •