Mail delivery failed... No Such User Here?!?

Discussion in 'HOWTO-Related Questions' started by klonos, Nov 18, 2008.

  1. klonos

    klonos New Member

    This mail server is working fine (sends & receives mail ok) other than the following issue with some domains:

    Code:
    -----Original Message-----
    From: Mail Delivery System [[EMAIL="[email protected]"]mailto:[email protected][/EMAIL]] 
    Sent: Monday, November 17, 2008 1:03 PM
    To: [EMAIL="[email protected]"][email protected][/EMAIL]
    Subject: Mail delivery failed: returning message to sender
    
    This message was created automatically by mail delivery software.
    
    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:
    
      [EMAIL="[email protected]"][email protected][/EMAIL]
        [B]No Such User Here[/B]
    
    ------ This is a copy of the message, including all the headers. ------
    
    Return-path: <[EMAIL="[email protected]"][email protected][/EMAIL]>
    Received: from static123045067890.ISP.DomailMailWasSentToUses.net ([123.45.67.890] helo=username)
        by Host.DomailMailWasSentFrom.net with esmtp (Exim 4.69)
        (envelope-from <[EMAIL="[email protected]"][email protected][/EMAIL]>)
        id 1L21sl-0003VV-ML
        for [EMAIL="[email protected]"][email protected][/EMAIL]; Mon, 17 Nov 2008 05:03:14 -0600
    From: =?iso-8859-7?B?yu/96uHyIMPp/vHj7/I=?= <[EMAIL="[email protected]"][email protected][/EMAIL]>
    To: <[EMAIL="[email protected]"][email protected][/EMAIL]>
    Subject: test
    Date: Mon, 17 Nov 2008 13:01:36 +0200
    Message-ID: <0E5E1B6E9B65465BAED3E4FD6A3ABCC0@username>
    MIME-Version: 1.0
    Content-Type: multipart/related;
        boundary="----=_NextPart_000_0009_01C948B4.ABECB620"
    X-Mailer: Microsoft Office Outlook 11
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
    Thread-Index: AclIoNYLeOPYb0M/SQe4/3g04l+lCQ==
    X-ACL-Warn: {
    
    This is a multi-part message in MIME format...
    What could be wrong? How should I troubleshoot this further??
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Please check if that user is existing in your Postfix configuration. I'd check /etc/postfix/main.cf and all included files.

    Also, check your mail log for errors.
     
  3. klonos

    klonos New Member

    Files seem to be ok.

    Hey Falko,

    The users are stored on a mysql db. And the user in question is in the db (actually, the issue is with all the users and they are all in the db).

    Here is the main.cf file:

    Code:
    # 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 - Welcome to DomainMailWasSentTo.net
    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
    
    # 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:${queue_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${queue_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.DomainMailWasSentTo.net
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    #mydestination = mail.DomainMailWasSentTo.net, localhost, localhost.DomainMailWasSentTo.net
    mydestination = mail.DomainMailWasSentTo.net, localhost, localhost.localdomain
    relayhost = 
    mynetworks = [URL="http://127.0.0.0/8"]127.0.0.0/8[/URL] [URL="http://10.0.0.0/24"]10.0.0.0/24[/URL]
    #mynetworks = [URL="http://127.0.0.0/8"]127.0.0.0/8[/URL]
    mailbox_size_limit = 0
    message_size_limit = 35840000
    recipient_delimiter = +
    inet_interfaces = all
    virtual_alias_domains = 
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-vforwardings.cf, mysql:/etc/postfix/mysql-vemail2email.cf
    virtual_mailbox_domains = DomainMailWasSentTo.net
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-vmailboxes.cf
    virtual_mailbox_base = /home/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_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    transport_maps = proxy:mysql:/etc/postfix/mysql-vtransports.cf
    virtual_create_maildirsize = yes
    virtual_maildir_extended = yes
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-vmailbox_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
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    readme_directory = /usr/share/doc/postfix
    html_directory = /usr/share/doc/postfix/html
    In the above text I have replaced the real domain with DomainMailWasSentTo.net (security reasons). Also, there are 3 things that differ from the main.cf in your HowTo:

    1. filenames mysql-virtual*.cf have been replaced with mysql-v*.cf, but here is a listing of them under /etc/postfix:

    Code:
    ls -l mysql-v*
    -rw-r----- 1 root postfix 140 2007-08-02 01:43 mysql-vdomains.cf
    -rw-r----- 1 root postfix 125 2007-08-02 01:44 mysql-vemail2email.cf
    -rw-r----- 1 root postfix 138 2007-08-02 01:43 mysql-vforwardings.cf
    -rw-r----- 1 root postfix 194 2007-08-02 01:44 mysql-vmailboxes.cf
    -rw-r----- 1 root postfix 125 2007-08-02 01:45 mysql-vmailbox_limit_maps.cf
    -rw-r----- 1 root postfix 134 2007-08-02 01:45 mysql-vtransports.cf
    I think I've been extra careful and haven't misspelled anything. Do the file rights seem ok to you?

    Using the info I have in these files, I can successfully connect to the mysql server and the db that contains the user info:

    Code:
    mysql -u mail_admin -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 8930
    Server version: 5.0.67-0ubuntu6 (Ubuntu)
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql> use mail
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    mysql>
    2. I do not use a mysql-virtualdomain.cf file, but have a 'virtual_mailbox_domains = DomainMailWasSentTo.net' setting in the main.cf file, since this server serves only one domain.

    3. I have added the local network (10.0.0.0/24) in the 'mynetworks =' setting, because I get the 'Relay access denied' error otherwise. (That is another issue I might resolve some other time)

    Do you see anything I might be missing???
     
  4. klonos

    klonos New Member

    Here's another thought...

    In the /var/log/mail.info log I see entries like:

    Code:
    Nov 19 07:54:03 mail postfix/smtp[15361]: D86431476AD: to=<[EMAIL="[email protected]"][email protected][/EMAIL]>, relay=127.0.0.1[127.0.0.1]:10024, delay=47, delays=37/0/0.01/9.9, dsn=2.5.0, status=sent (250 2.5.0 Ok, id=15351-01, DISCARD(bounce.suppressed))
    Nov 19 07:54:03 mail postfix/qmgr[15340]: D86431476AD: removed
    or:

    Code:
    Nov 19 07:37:45 mail amavis[13845]: (13845-19) Passed CLEAN, [some.IP] [another.IP] <[EMAIL="[email protected]"][email protected][/EMAIL]> -> <[EMAIL="[email protected]"][email protected][/EMAIL]>, Message-ID: <A0B82FC0DA3B44A0BF015E80A56C3AD8@useree29537c91>, mail_id: mR25E01XiPDS, Hits: -, size: 468027, queued_as: 5DE191476B0, 283 ms
    Nov 19 07:37:45 mail postfix/smtp[15300]: D2C6B147693: to=<[EMAIL="[email protected]"][email protected][/EMAIL]>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.6, delays=2.3/0/0/0.28, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=13845-19, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 5DE191476B0)
    Nov 19 07:37:45 mail postfix/qmgr[15340]: D2C6B147693: removed
    for the certain user. This user receives mail from other domains. That means that there is no mysql db lookup issue. Right?

    It is only from certain domains that when I try to send mail to this user I get the 'No such user here' error.

    Also, I've googled it up and found that there might be a known issue with MS Outlook and Outlook Express that causes this issue. Both clients need the setting 'Server requires authentication' enabled to resolve this. Tried that with no luck.

    Will try to tail the mail.info log when I send mail to this user from a domain that has this issue and let you people know.

    In the meantime, any ideas are welcomed.
     
  5. klonos

    klonos New Member

    Also found out that these domains use exim 4.69. Don't know if that helps at all?!?
     
  6. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    netstat -tap
    ?

    Do the users exist in the database?
     
  7. klonos

    klonos New Member

    netstat shows:

    Code:
    netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 localhost.localdo:10024 *:*                     LISTEN      7329/amavisd (maste
    tcp        0      0 localhost.localdo:10025 *:*                     LISTEN      13138/master
    tcp        0      0 localhost.localdo:mysql *:*                     LISTEN      4591/mysqld
    tcp        0      0 localhost.localdo:spamd *:*                     LISTEN      4686/spamd.pid
    tcp        0      0 *:www                   *:*                     LISTEN      4227/apache2
    tcp        0      0 *:ftp                   *:*                     LISTEN      5441/pure-ftpd (SER
    tcp        0      0 *:3128                  *:*                     LISTEN      5506/(squid)
    tcp        0      0 *:2200                  *:*                     LISTEN      4502/sshd
    tcp        0      0 *:smtp                  *:*                     LISTEN      13138/master
    tcp        0      0 *:https                 *:*                     LISTEN      5565/apache-ssl
    tcp        0      0 localhost.localdo:55683 localhost.localdo:mysql TIME_WAIT   -
    tcp        0      0 localhost.localdo:mysql localhost.localdo:55651 TIME_WAIT   -
    tcp        0     16 mail.DomainMailIsSentFrom.net:smtp     some.other.IP:24312 FIN_WAIT1   -
    tcp        0      0 mail.DomainMailIsSentFrom.net:2200     IP.of.Their.ISP:3442 ESTABLISHED 5527/sshd: root@not
    tcp        0    820 mail.DomainMailIsSentFrom.net:2200     IP.of.Their.ISP:2756 ESTABLISHED 22974/0
    tcp6       0      0 [::]:imaps              [::]:*                  LISTEN      5773/couriertcpd
    tcp6       0      0 [::]:pop3s              [::]:*                  LISTEN      5841/couriertcpd
    tcp6       0      0 [::]:pop3               [::]:*                  LISTEN      5804/couriertcpd
    tcp6       0      0 [::]:imap2              [::]:*                  LISTEN      5736/couriertcpd
    tcp6       0      0 [::]:ftp                [::]:*                  LISTEN      5441/pure-ftpd (SER
    tcp6       0      0 [::]:2200               [::]:*                  LISTEN      4502/sshd
    tcp6       0      0 mail.DomainMailIsSentFrom.net:pop3     IP.of.Their.ISP:4685 TIME_WAIT   -
    And yes, the users are in the db. They receive from and send mail to other domains just fine. Its just these about one dozen domains that give the 'No Such User Here' when they send mail to this server and to existing mail accounts.
     
  8. klonos

    klonos New Member

    Here's (yet) another thought...

    I have Logwatch installed and among the daily reports I receive through mail is this:

    Code:
    sasl auth daemon Begin ------------------------ 
    
     
     SASL Authentications failed 19 Time(s)
     Service smtp (pam) - 19 Time(s):
        Realm  - 19 Time(s):
           User: inna - PAM auth error - 19 Time(s):
     
     
     **Unmatched Entries**
     
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     do_request      : NULL password received
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     pam_mysql - SELECT returned no result.
     
     ---------------------- sasl auth daemon End ------------------------- 
    
    anything to do with our issue???
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Do the MX records of the not-working domains point to your server? You can check with
    Code:
    dig mx yourdomain.com
     
  10. klonos

    klonos New Member

    Will need to check with the host...

    These domains are all hosted remotely and also share the same IP. I do not have access to remote shell on the server that hosts these domains, but will ask the sysadmins to run the command and mail me the output.

    Will let you know as soon as I get an answer.

    In the meantime this is what puzzles me:

    I have setup 3 accounts:
    [email protected] (my domain & my own account, everything been working fine for some years now)
    [email protected] (the server that I have set up about one year ago, works fine with all other domains, but not with domain2)
    [email protected] (remote host with virtual domains (3rd party company), works fine with other domains, but not with domain1)

    Troubleshooting Step1
    Mail from mydomain.net reaches both domain1.net and domain2.net ok.
    Mail from domain1.net reaches me ok (or gmail, or hotmail, or other domains as well).
    Mail from domain2.net also reaches me ok (or gmail, or hotmail, or other domains).

    Troubleshooting Step2
    Mail from [email protected] to [email protected] also cc'ed to [email protected]

    Reaches [email protected] ok, but fails to reach domain2.net and returns:

    Code:
    This is the mail system at host mail.domain1.net.
    
    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 assistance, please send mail to postmaster.
    
    If you do so, please include this problem report. You can
    delete your own text from the attached returned message.
    
                       The mail system
    
    <[EMAIL="[email protected]"][email protected][/EMAIL]>: host mail.domain2.net[IP.OF.domain2.net] said: 550-Verification
        failed for <[EMAIL="[email protected]"][email protected][/EMAIL]> 550-No Such User Here 550 Sender verify failed
        (in reply to RCPT TO command)
    What is this?? does the domain2.net server try to verify the sender by trying to send an email back before it receives the original mail sent to it? And if so, why does the domain1.net server reply 'No Such User Here'?

    Troubleshooting Step3
    And finally, mail from [email protected] sent to [email protected] and also cc'ed to my account [email protected] received ok by both domains!?!.

    See what I mean? If user [email protected] is able to receive mail from [email protected] , then what is this 'Verification failed for <[email protected]> 550-No Such User Here' error that the domain2 server spits and drives me crazy? What server gives this reply? Domain1 or domain2?
     
  11. klonos

    klonos New Member

    and here's another weird thing...

    mail from domain1.net do not reach domain2.net.
    mail from domain2.net reaches domain1.net.
    mail is displayed in domain1.net client
    mail return receipts that the mail was displayed in domain1.net reach domain2.net

    So normal mail fails, but mail receipt do not! Go figure...:confused:
     
  12. klonos

    klonos New Member

    Ok. Issue solved!

    The problem was with the remote server that is hosting those few domains that return the 'No Such User Here' (and I knew it all along). The reason for the error was due to the presence of a local domain entry for the domain2.net on the server domain1.net. The sys admins removed it and all is fine now.

    Thank you for your time once again Falko.
     

Share This Page