View Full Version : Some emails are not working
MagnuM
11-12-2003, 12:01 AM
Hello DA Team,
I have a problem with emails which have the username, the same as the user from DirectAdmin and from the OS.
Until 2 days ago (when I make the update for Apache 1.3.29 and PHP 4.3.4), they were working fine, and now they are not.
For example there are 2 diferent domains:
glas.ro and secan.net.
The username to login in SSH and Red Hat 9 are glas and secan. Well, the email glas@glas.ro and secan@secan.net are not working (can't receive emails).
I am trying to send emails to them and this is what I receive:
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:
secan@ehosting.ro (ultimately generated from secan@secan.net)
But the other virtual emails that I add with DirectAdmin, are working fine.
Thanks.
DirectAdmin Support
11-12-2003, 01:41 PM
Hello,
Change the hostname of your server from "ehosting.ro" to something else. You've created that domain on the server, so thee system email will be caught by the catch-all for "ehosting.ro", which is probably set to fail.
Fix: Admin Panel -> Admin Settings -> change the Hostname to "server.ehosting.ro".
Be sure to add the appropriate A record in your dns settings so that the new hostname resolves. (doesn't have to be "server", but it can't be left as ehosting.ro)
John
MagnuM
11-19-2003, 01:50 AM
OK, I do that, in Admin -> Admin Settings the Server's Name is server.ehosting.ro, and there is an A record for server.ehosting.ro in Admin -> DNS Administration -> ehosting.ro.
The OS user emails are working fine now, but I'm reciving a message sistem, which look like this:
Your hostname, ehosting.ro, and the servername you have set in DirectAdmin, server.ehosting.ro, do not match. It is recommended that these two values are the same.
Solution: Either change the servername in DirectAdmin or run the 'hostname.sh' script via ssh to change your hostname
ehosting.ro, resolves to 127.0.0.1. Please make sure that your hostname resolves to your server ip (64.5.40.184) or else your email may not work correctly.
Solution: Create an A record for your hostname (ehosting.ro.) in your DNS control panel. Point the hostname to your server's main IP address. Also check /etc/hosts to ensure that the server ip is correctly set.
This is what I find in /etc/hosts:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
64.5.40.184 ehosting.ro
64.5.40.184 server.ehosting.ro
If you know what to do please let me know.
Thanks.
nobaloney
11-19-2003, 08:06 AM
First, run the hostname.sh script.
Then make sure your DNS for ehosting.ro points to the real domain name.
You may need to restart networking:
# /etc/rc.d/init.d/network restart
WARNING: Do NOT use "stop" on this command; if you do you'll have to go to the data center to restart your system.
in fact restarting the system may be a safer bet:
# /sbin/shutdown -r now
WARNING: Do NOT ever use "shutdown -h" or "halt"; if you do you'll have to go to the data center to restart your system.
Jeff
MagnuM
11-19-2003, 08:19 AM
May I ask where is hostname.sh located.
DirectAdmin Support
11-19-2003, 09:10 AM
Hello,
the hostname.sh script is located at:
/usr/local/directadmin/scripts/hostname.sh
note that the Admin Settings uses that script so it would have already been done.... So I'm thinking there was an error when trying to set your hostname, not sure what's up...
That error is generated when your hostname doesn't match DA's hostname.
DA's hostname is set in /usr/local/directadmin/conf/directadmin.conf
type:
hostname
to see what your current hostname is. (Also restart exim.. I telnetted to port 25 and it's still showing a hostname of ehosting.ro)
one DA's matches the system's hostname, the error will go away.
John
MagnuM
11-21-2003, 12:21 AM
OK, I resolve it, works great now.
MagnuM
12-04-2003, 12:23 AM
After the new DA update to 1.20.3, I am receving this errors again. So DA's hostname doesn't match the system's hostname again.
This is my /etc/hosts file:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 ehosting.ro ehosting localhost localhost.localdomain
64.5.40.184 ehosting.ro
64.5.40.184 server.ehosting.ro
Should I remove something from here?
I need to mention here that my DSN servers are: ns1.ehosting.ro and ns2.ehosting.ro.
Can someone tell me what to do? I am the only one with this problem?
MagnuM
12-04-2003, 12:49 AM
Well, I resolve it again, by removing ehosting.ro ehosting after 127.0.0.1.
Now if I type hostname, I receive: server.ehosting.ro, exactly as I wish.
But I am afraid that on each DA upgrade, I should do it again.
DirectAdmin Support
12-04-2003, 10:35 AM
Hello,
DirectAdmin doesn't touch your hostname settings when it updates. The easy way to make sure your /etc/hosts file is setup correctly would be to set the reset (change, change back) the hostname in the Admin Panel -> Admin Settings area. It would remove the hostname from the 127.0.0.1 line.
Fyi for anyone else, it should look like:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
64.5.40.184 server.ehosting.roso that the hostname isn't on the 127.0.0.1 line as the lookup is done top down, where the higher line has priority (found first). The ehosting.ro line doesn't really matter, but can be removed. We'll let the dns resolve it for us instead.
John
MagnuM
12-15-2003, 04:58 AM
I don't know what is happening, but in December 12 (Friday), my /etc/hosts file was changed again, and ehosting.ro was added to 127.0.0.1.
So I change it back again, and now everything is working fine.
I think there is a cronjob that runs every week, and modify my file.
Can you tell me how to resolve this, because I just got tired to change /etc/hosts every week.
ProWebUK
12-15-2003, 07:40 AM
Originally posted by jlasman
in fact restarting the system may be a safer bet:
# /sbin/shutdown -r now
WARNING: Do NOT ever use "shutdown -h" or "halt"; if you do you'll have to go to the data center to restart your system.
Easier way to do a reboot:
# reboot
# /sbin/reboot
Also for a slight bit of information regarding your /etc/hosts file check the following link:
http://forum.rackshack.net/showthread.php?s=&threadid=10744
It has examples of files aswell as information on spacing for certain lines (such as using tab instaed of spaces - tab is your friend, spaces are not!)
Chris
nobaloney
12-15-2003, 08:10 AM
Originally posted by ProWebUK
Easier way to do a reboot:
# reboot
# /sbin/reboot
Historically "reboot" is not quite the same as "shutdown -r now"; see:
http://www.patoche.org/LTT/FMTYWTK/00000090.html
Jeff
ProWebUK
12-15-2003, 08:19 AM
1 follow up from that and it states:
"reboot" (or, actually the system call reboot(2)) also does an orderly reboot, the
difference is just in what happens before that - wheather the application shall send a
broadcast (a "wall(1)") to all users before rebooting or not
I often use /sbin/reboot on local systems, and to be honest with you have never had 1 problem.
Chris
MagnuM
12-15-2003, 08:21 AM
Actualy I just see that everytime I reboot my VPS the file /etc/host is changed back to:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 ehosting.ro ehosting localhost localhost.localdomain
64.5.40.184 ehosting.ro
64.5.40.184 server.ehosting.ro
And this is not good.
It happens even if I change them from DirectAdmin -> Admin Settings.
ProWebUK
12-15-2003, 08:37 AM
Will have to wait for John to answer this one, for now just set it up as he suggested with the example above in shell, once thats done just leave DirectAdmin hostname settings until we have news :D
Chris
DirectAdmin Support
12-15-2003, 09:45 AM
Hello,
Well I'm not too sure what script would be doing that, probably something with your network setup. If you say it is resetting without a reboot then, you might have a look in either your /etc/crontab file, /etc/cron.d/* or /etc/cron.weekly for any scripts that might be causing it.
Beyond that, hunting it down could be trickey as hundreds are loaded at boot time. Hopefully, it's just a cron file which only exist in so many places.
John
ProWebUK
12-15-2003, 10:09 AM
I think what he meant was it gets changed to that when he modifies it from the admin panel or reboots, not just automatically?
Chris
MagnuM
12-15-2003, 02:02 PM
Well, no matter what I put manually to /etc/hosts.
After a reboot command, the first uncomented line becomes:
127.0.0.1 ehosting.ro ehosting localhost localhost.localdomain
But a strange thing is this:
1. If I change the server's name from DA->Admin Settings to ehosting.ro, the /etc/hosts file looks like this:
127.0.0.1 localhost localhost.localdomain
64.5.40.184 ehosting.ro
2. If I change it back to server.ehosting.ro from DA->Admin Settings the file looks like this:
127.0.0.1 localhost localhost.localdomain
64.5.40.184 ehosting.ro
64.5.40.184 server.ehosting.ro
But after this, if the VPS is somehow restarted, the /etc/hosts file becomes:
127.0.0.1 ehosting.ro ehosting localhost localhost.localdomain
64.5.40.184 .....
The point is that there is something, which modify this file when the VPS is restarted, and I don't know the solution for this problem.
S2S-Robert
12-15-2003, 05:01 PM
a rough and nasty solution would be to let cron copy a backup file over the existing file every 10 minutes
*/10 * * * * cp /etc/hosts.bak /etc/hosts
Not too sure about the 10 minutes this way, still learning cron daemon ;)
MagnuM
12-16-2003, 12:24 AM
Well, I still don't know why after each reboot, the ehosting.ro ehosting appears after 127.0.0.1?
Is this normal?
How about your /etc/hosts file guys? It looks the same as mine with the domain name after the local address, or after the local address 127.0.0.1, you have only localhost localhost.localdomain.
nobaloney
12-16-2003, 12:34 AM
Here's what mine looks like, from my live DirectAdmin system:
[jlasman@da1 etc]$ ls -al hosts
-rw-r--r-- 1 root root 177 Nov 22 16:51 hosts
[jlasman@da1 etc]$ cat hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
65.58.240.229 da1.ns-one.net
[jlasman@da1 etc]$
and from my testbed system:
[jlasman@datest etc]$ ls -al hosts
-rw-r--r-- 1 root root 181 Oct 10 11:21 hosts
[jlasman@datest etc]$ cat hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
67.112.189.218 datest.ns-one.net
[jlasman@datest etc]$
Jeff
MagnuM
12-16-2003, 01:02 AM
Well, as I told before when the file have these lines, works good:
127.0.0.1 localhost localhost.localdomain
64.5.40.184 server.ehosting.ro
But after each reboot the first line is changed and ehosting.ro ehosting is added after the 127.0.0.1 :confused:, so the new file becomes:
127.0.0.1 ehosting.ro ehosting localhost localhost.localdomain
64.5.40.184 server.ehosting.ro
I just don't know what is the problem.
DirectAdmin Support
12-16-2003, 09:23 AM
Hello,
It must be a script somehwhere doing it. It will just have to be found and put to rest. Just search the scripts for reference to /etc/hosts and hopefully, it can be tracked down. Perhaps the people you got the server from might know where the script is.
John
MagnuM
12-17-2003, 01:10 AM
Ohhh, I just rapaired a mistake of the last post, now you should understand better, what is happening. The ehosting.ro ehosting is added after 127.0.0.1.
And in Direct Admin it shows that the server's name is server.ehosting.ro (probabily it takes the data from /usr/local/directadmin/conf/directadmin.conf), but if I type hostname in SSH it shows ehosting.ro.
But remember, if I change the server's name from DA to ehosting.ro, and the change it back to server.ehosting.ro (I think there are 2 reboots there), it works fine, and the file /etc/host does not contain ehosting.ro ehosting after 127.0.0.1
But this is well until the system reboot again from different reasons.
Damn :(
DirectAdmin Support
12-17-2003, 10:14 AM
Hello,
Try resetting your hostname through DA.. (Admin Panel -> Admin Settings).. just change it to something else, then change it back. Perhaps there is a script that everyone runs to ensure that the hostname is in the /etc/hosts file.. and perhaps it was manually changed somehwere along the way, but because it wasn't done through DA, the file no longer had a hostname in it.. so the boot script noticed there was nothing in it, so it added it?.. just a thought.. try resetting the hostname and see.
John
MagnuM
12-18-2003, 12:16 AM
Well I did that, I told you on the last post.
But I try again by setting the dog.ro domain as the server name in DA. After this I check the hostname through SSH, ant tells me that is dog.ro (correct). Well I reboot the VPS again and the hostname was changed to ehosting.ro, but in DA still shows dog.ro.
Just don't know what is happening.
ProWebUK
12-18-2003, 07:41 AM
It sounds like a problem with the VPS rather than DirectAdmin here.
Try remove the commented lines in /etc/hosts then reboot....if no luck still you may want to contact your host to check if the VPS system does or would do naything with the /etc/hosts file.
Chris
MagnuM
12-19-2003, 01:32 AM
I try to remove the comments, and it is still the same problem, nothing happens. I will try to make the file readonly with CHMOD 555.
nobaloney
12-19-2003, 06:49 AM
/etc/hosts shouldn't need to be marked as executable; 644 is the default, but 444 should work, as root can write to the file by default anyway.
Jeff
MagnuM
01-15-2004, 06:28 AM
OK, I follow the instructions and change the hostname from ehosting.ro to server.ehosting.ro.
But now I am experiencing another problem, my administrator email becomes admin@server.ehosting.ro, so everytime I create an account through DirectAdmin, the email failed to arive to the client because admin@server.ehosting.ro does not exist.
Do you have any solutions, for this problem?
Eventualy I like to change my admin email to admin@ehosting.ro, or to another email address.
DirectAdmin Support
01-15-2004, 11:13 AM
Hello,
What is you admin email set to in the User Panel?
User Panel -> Account Stats / Logs -> email
That address where the email is sent from, and also the where a copy is sent to for account creation.
John
MagnuM
01-15-2004, 03:25 PM
Well, the email from User Panel -> Account Stats / Logs -> email is a personal email of mine where indeen is sended a copy of the account creation notification, but not this is not the admin email.
I even try to send a message through the Resseler Panel to a user (actualy to another email of mine which works good from a nother server) and the email comes back to me as a "Mail delivery failed" with the notification from that mail server: sorry, your envelope sender domain must exist.
And the message was returned to admin@server.ehosting.ro, which I can see through the UebiMiau webmail.
I can't belive it is only me having those problems.
DirectAdmin Support
01-16-2004, 11:20 AM
Odd.. you could just add the server.ehosting.ro domain to your dns through the Admin Panel -> DNS Admin -> add zone (below the list of all domains). That will create an MX entry and will make your hostname a valid recipient for mail.
John
MagnuM
01-16-2004, 03:35 PM
Trust me, this was the first thing that I have made. But I forgot that need several minutes for the DNS to work, so I was trying again immediately, and didn't work. Well now it works. Sorry my mistake :rolleyes:, and thanks for your patience.
Powered by vBulletin™ Version 4.0.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.