Mail cannot be delivered to virtual server users.

8 posts / 0 new
Last post
#1 Wed, 03/03/2010 - 08:36
riarda

Mail cannot be delivered to virtual server users.

Hi, When I try to send e-mail to a virtual server user, I get a response message like: This is the mail system at host ns.hostname.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 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

    <user@virtualhost.com>: Host or domain name not found. Name service
        error for name=mail.virtualhost.com type=A: Host not found

and mails are not delivering. They resolve the main mail servers dns but I think then it can not deliver internally. The user@virtualhost.com is created and mapped to user.virtualhost.com in /etc/postfix/virtual map file.

Operating system Ubuntu Linux 8.04.3

Webmin version 1.500

Virtualmin version 3.76.gpl GPL

Postfix version 2.5.1

What would be the problem?

Thanks in advance,

Regards.

Wed, 03/03/2010 - 11:50
andreychek

Howdy,

You may want to start by going into System Settings -> Re-Check Config, as that'll catch a lot of unusual things that could be going on.

You may want to verify that DNS is working properly on your server, and that your server is able to correctly resolve the domain you're using, "virtualhost.com".

-Eric

Wed, 03/03/2010 - 13:26
riarda

Thanks for your comment.

I have already done it and there is no problem. (i.e. .. your system is ready for use by Virtualmin.)

But after adding in /etc/postfix/main.cf that:

   mydomain=hostname.com

now I am getting:

    This is the mail system at host ns.hostname.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 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  
  <user@virtualhost.com> (expanded from
        <user@virtualhost.com>): mail for ns loops back to myself

error.

And also from inside and outside I can resolve the hostname. No problem with that also.

Anything else?

Wed, 03/03/2010 - 13:24
andreychek

It's possible there's a hostname related problem... you'll want to make sure that your hostname is the same in all three of these:

  1. The output of the "hostname" command (which should be in the form "host.domain.tld")

  2. The entry for your hostname in /etc/hosts should be there, along with your correct IP address

  3. Your hostname should also be on the mydestination line of /etc/postfix/main.cf

Wed, 03/03/2010 - 13:36
riarda

1) The output of the "hostname" command: ns

2) The entry for your hostname in /etc/hosts:

    127.0.0.1   localhost.localdomain   localhost
    XXX.XXX.XXX.XXX ns.hostname.com ns

where XXX.XXX.XXX.XXX is the correct public IP of the server.

3)In /etc/postfix/main.cf:

    mydomain=hostname.com
    myhostname = ns.hostname.com
    mydestination = $myhostname, $mydomain, localhost.$mydomain, localhost

Anything weird?

Wed, 03/03/2010 - 13:38
andreychek

Yeah, it looks like your hostname isn't an FQDN... so Postfix may be getting confused when attempting to deliver messages.

My suggestion would be to run this command:

hostname ns.hostname.com

(where ns.hostname.com is your actual full system hostname)

Then restart Postfix:

/etc/init.d/postfix restart

and see if that resolves your problem.

-Eric

Wed, 03/03/2010 - 14:24
riarda

I did it. Nothing changed, same error. I also tried rebooting but no help.

Thu, 03/04/2010 - 03:15
riarda

SOLVED: I changed the hostname to ns again. ( now hostname command gives ns but hostname --fqd command gives ns.hostname.com )

I added a file /etc/postfix/local-host-names put ns in it and restarted postfix.

Now it is working.

Thanks for your help.

Regards

Topic locked