Debian + Postfix problem

Discussion in 'Server Operation' started by voiteck, Jul 12, 2011.

  1. voiteck

    voiteck New Member

    Hi, I have problems with receivingemails.
    I've installed Debian using this tutorial: http://www.howtoforge.com/perfect-server-debian-squeeze-ispconfig-2
    After installation i've created mailbox (webmaster@maindomain.com) in ISPConfig.
    To be precise i've create two account, one in Email Accounts tab and another one in Fetchmail tab, both with same username/password.

    Now i'm able to send an email using SquirrelMail to my gmail account:

    Bellow are headers from test email (from webmaster@mydomain.com to my.mailbox@gmail.com)


    PHP:
    Delivered-Tomy.mailbox@gmail.com
    Received
    by 10.213.17.77 with SMTP id r13cs208178eba;
            
    Tue12 Jul 2011 00:13:47 -0700 (PDT)
    Receivedby 10.223.61.72 with SMTP id s8mr8953365fah.6.1310454827529;
            
    Tue12 Jul 2011 00:13:47 -0700 (PDT)
    Return-
    Path: <webmaster@mydomain.com>
    Receivedfrom mydomain.com ([178.63.38.11])
            
    by mx.google.com with ESMTP id q5si14722886fac.42.2011.07.12.00.13.45;
            
    Tue12 Jul 2011 00:13:46 -0700 (PDT)
    Received-SPFerror (google.comerror in processing during lookup of webmaster@mydomain.comDNS timeoutclient-ip=178.63.38.11;
    Authentication-Resultsmx.google.comspf=temperror (google.comerror in processing during lookup of webmaster@mydomain.comDNS timeoutsmtp.mail=webmaster@mydomain.com
    Received
    from localhost (localhost [127.0.0.1])
        
    by mydomain.com (Postfixwith ESMTP id 130778170277
        
    for <my.mailbox@gmail.com>; Tue12 Jul 2011 11:13:45 +0400 (MSD)
    X-Virus-ScannedDebian amavisd-new at server1.example.com
    Received
    from mydomain.com ([127.0.0.1])
        
    by localhost (mydomain.com [127.0.0.1]) (amavisd-new, port 10024)
        
    with ESMTP id TIhwYSuD7lr5 for <my.mailbox@gmail.com>;
        
    Tue12 Jul 2011 11:13:41 +0400 (MSD)
    Receivedfrom [178.63.38.11] (localhost [127.0.0.1])
        
    by mydomain.com (Postfixwith ESMTP id A56F28170002
        
    for <my.mailbox@gmail.com>; Tue12 Jul 2011 11:13:41 +0400 (MSD)
    Receivedfrom 195.26.78.18
            
    (SquirrelMail authenticated user webmaster@mydomain.com)
            
    by 178.63.38.11 with HTTP;
            
    Tue12 Jul 2011 11:13:41 +0400
    Message
    -ID: <ab5232b753ff639eaaadd1ca3844d20c.squirrel@178.63.38.11>
    DateTue12 Jul 2011 11:13:41 +0400
    Subject
    testowanie i logowanie
    From
    webmaster@mydomain.com
    To
    my.mailbox@gmail.com
    User
    -AgentSquirrelMail/1.4.21
    MIME
    -Version1.0
    Content
    -Typetext/plain;charset=iso-8859-1
    Content
    -Transfer-Encoding8bit
    X
    -Priority(Normal)
    ImportanceNormal

    The problem is, that server isn't receiving emails. When I send an email to webmaster@mydomain.com from gmail i get response from server:
    PHP:
    This is the mail system at host mydomain.com.

    I'm sorry to have to inform you that your message could not
    be delivered to one or more recipients. It'
    s attached below.

    For 
    further assistanceplease send mail to postmaster.

    If 
    you do soplease include this problem reportYou can
    delete your own text from the attached returned message
    .

                      
    The mail system

    <webmaster@mydomain.com>: unknown user"webmaster"

    Final-Recipientrfc822webmaster@mydomain.com
    Original
    -Recipientrfc822;webmaster@mydomain.com
    Action
    failed
    Status
    5.1.1
    Diagnostic
    -CodeX-Postfixunknown user"webmaster"
    I've checked mail log, and found there one error and one warning:


    PHP:
    Jul 12 11:13:45 magn postfix/trivial-rewrite[3421]: warning: do not list domain mydomain.com in BOTH mydestination and virtual_mailbox_domains
    Jul 12 11
    :15:06 magn getmailgetmailOperationError error (POP error (-ERR Login failed.))

    --
    I will be grateful for any help.
    Wojtek
     
  2. falko

    falko Super Moderator

    Can you post your /etc/postfix/main.cf?

    Please make sure that your domain's MX record points to the correct server. You can check it as follows:
    Code:
    dig mx yourdomain.com
     
  3. voiteck

    voiteck New Member

    Hi, thanks for your answer.

    here is /etc/postfix/main.cf

    PHP:
    # 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 (Debian/GNU)
    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 magn.es
    alias_maps 
    hash:/etc/aliases
    alias_database 
    hash:/etc/aliases
    myorigin 
    = /etc/mailname
    mydestination 
    magn.eslocalhostlocalhost.localdomain
    relayhost 
    =
    mynetworks 127.0.0.0/[::1]/128
    mailbox_command 
    procmail -"$EXTENSION"
    mailbox_size_limit 0
    recipient_delimiter 
    = +
    inet_interfaces all
    html_directory 
    = /usr/share/doc/postfix/html
    virtual_alias_domains 
    =
    virtual_alias_maps proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cfmysql:/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 
    = /var/vmail
    virtual_uid_maps 
    = static:5000
    virtual_gid_maps 
    = static:5000
    smtpd_sasl_auth_enable 
    yes
    broken_sasl_auth_clients 
    yes
    smtpd_sasl_authenticated_header 
    yes
    smtpd_recipient_restrictions 
    permit_mynetworkspermit_sasl_authenticatedcheck_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cfreject_unauth_destination
    smtpd_tls_security_level 
    may
    transport_maps 
    proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    relay_domains 
    mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    relay_recipient_maps 
    mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
    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
    smtpd_sender_restrictions 
    check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
    smtpd_client_restrictions 
    check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
    maildrop_destination_concurrency_limit 
    1
    maildrop_destination_recipient_limit 
    1
    virtual_transport 
    maildrop
    header_checks 
    regexp:/etc/postfix/header_checks
    mime_header_checks 
    regexp:/etc/postfix/mime_header_checks
    nested_header_checks 
    regexp:/etc/postfix/nested_header_checks
    body_checks 
    regexp:/etc/postfix/body_checks
    content_filter 
    amavis:[127.0.0.1]:10024
    receive_override_options 
    no_address_mappings
    message_size_limit 
    0
    and here is dig mx yourdomain.com results:

    PHP:
    ; <<>> DiG 9.7.3 <<>> mx mydomain.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>
    HEADER<<- opcodeQUERYstatusSERVFAILid52781
    ;; flagsqr rd raQUERY1ANSWER0AUTHORITY0ADDITIONAL0

    ;; QUESTION SECTION:
    ;
    mydomain.com.                       IN      MX

    ;; Query time69 msec
    ;; SERVER8.8.8.8#53(8.8.8.8)
    ;; WHENWed Jul 13 13:55:38 2011
    ;; MSG SIZE  rcvd25
     
  4. falko

    falko Super Moderator

    First, you don't have an MX record, so you should create one.

    This means you use a domain in the MySQL database that you have in mydestination as well (magn.es maybe?). Please remove the domain from the mydestination line in /etc/postfix/main.cf and restart Postfix.
     
  5. voiteck

    voiteck New Member

    Man, you're great. It's working now, after removing mogn.es from mydestination in /etc/postfix/main.cf

    Could you please take a look at dig mx results, i've parked domain at another provider and set up some new dns records

    PHP:
    ; <<>> DiG 9.7.3 <<>> mx magn.es
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>
    HEADER<<- opcodeQUERYstatusNOERRORid61000
    ;; flagsqr rd raQUERY1ANSWER1AUTHORITY0ADDITIONAL0

    ;; QUESTION SECTION:
    ;
    magn.es.                       IN      MX

    ;; ANSWER SECTION:
    magn.es.                86400   IN      MX      1 magn.es.

    ;; 
    Query time87 msec
    ;; SERVER8.8.8.8#53(8.8.8.8)
    ;; WHENFri Jul 15 01:37:11 2011
    ;; MSG SIZE  rcvd41
    Thanks again

    --
    Best
    Wojtek
     
  6. falko

    falko Super Moderator

    The MX record is fine, provided that
    Code:
    dig A magn.es
    shows the correct IP.
     

Share This Page