Cant send with root@host.domain.com

Hello,

I cant get server to send email alerts from the server as root@host.domain.com (hostname of the server).

There is A record for this hostname on another server that points to this server. Do I also need dns zone for it on the physical server too?

I can get it to send email to local users but no remote users on other servers.

Thanks!

You server is configured to send out mail from root@yourhostname.com

To do what you want, you need to change your hostname, by editing the following files;

/var/qmail/control/me (the name qMail, your MTA is sending out)
/home/interworx/iworx.ini (if you are using InterWorx and NodeWorx does not display the correct name)
/etc/sysconfig/network (scroll down and be careful not to edit anything but “hostname”)
/etc/hosts

The reboot your server.

* Don’t cheat and just edit the qmail name file! Edit all of them. *

I bet you never thought there was so much work to renaming a computer, eh?

Tim

No Tim,

I dont want to change the hostname. I didnt want to put hostname here. But that as example. I’ve had this problem with other server before and I’ve never gotten around it. I found that I can get it to send to local users, but not to someone outside of the box.

Or are you saying that there is another hostname setting in those files by default and need to go through and update them all for it to work?

Hello Again Tim,

I just check those files and yes its already setup with correct hostname info.

InterWorx is set up to send mail from root root sends out mail from root@yourhostnae.tld . If you want to change the this you have to edit the hiostname. Doing otherwise could be construed by some as forging the email header.

Rereading your post, if you want to change who your server appears to send mail from you need to make sure the setting in /var/qmail/control/me is the one you want to appear to be, but as I said this could be construed as forging your header since it’s not only the messages to you (errors, logwatch, etc) but also your bounce mesages to toher servers.

If I misunderstood then please explain further what you want. The server should send your logwatch emails from root@your-hostname.tld and bounce messages from postmaster@your-hostname.tld

That’s simply how it’s set up (or is supposed to be) and if you want to change that you have to get into your config files and make some changes but that’s not recommended unless you know exactly what you are editing.

Hello Tim,

Thanks for your reply.

First- i dont want to change anything, I do not want to change the hostname.

All I am saying is root@hostname.tld is not able to send emails beyond the server. It can only send to local email accounts on the server.

I would put in a support ticket with your data center (or InterWorx if you bought it directly) and have them take a look at your qmail becaise it should NOT happen. I have almost all of that sent to another non-server email account.

How do you know it’s not going to accounts on the server? Have you tested it (how)?

Just editing your NodeWorx email address doesn’t do it (I used to think it did, but was wrong) and you have to edit a file in qmail. Squalto and I had a thread on the forums here with Chris discussing it a while back.

Hi John,

Mail should go out from the root user, if it isn’t, the receiving e-mail server may be rejecting the message for some reason. Try watching the /var/log/send/current log file when you try to send a message as root, and see if the message gets delivered, or fails with some error message.

Paul

Thanks for your help guys.

I found the solution. The hostname needed a reverse dns setup. It now works.

Thanks!

I found another caveat to this type of issue (after tailing the current mail log) if the domain that you happen to rename the “hostname” to is also a local domain to the system:

adding <your.newhostname.tld> to the

/var/qmail/control/locals file

Then, restart the SMTP service.

JB

[QUOTE=JayBaen;9991]I found another caveat to this type of issue (after tailing the current mail log) if the domain that you happen to rename the “hostname” to is also a local domain to the system:

adding <your.newhostname.tld> to the

/var/qmail/control/locals file

Then, restart the SMTP service.

JB[/QUOTE]

Normaly when you create a new siteworx account from siteworx it automatilcy add the domaine in /var/qmail/control/morercpthosts

So, do this if you added a local domain not from sitewworx or if the fqdn is changed

Pascal

Correct - that’s what this was for - if you’ve manually changed the “hostname” of the server.

In my case, it’s a bit unique, I:

  1. changed the “hostname” of the server to host.domain1.com.

  2. added siteworx account of domain1.com

  3. had to change the /var/qmail/control/locals file to reflect the addition of host.domain1.com as “local” for mail receipt.

JB