I was more meaning which server was generating the error telling you the address did not exist ? You would indeed see the error in /var/log/maillog, but that file will contain everything your local MTA (Sendmail, Postfix, etc) wants to log. What's important for debugging SMTP issues firstly is knowing where the problem is.
In any case, I think it's probably safe to assume that the error you're getting means what it says it does - that root@ is not a valid e-mail address. So, returning to my other question. What is the exact command you are using, in full, to send the mail ? If we can see a full and complete excerpt of the code you are using, we can then advise what might be going wrong.
But in general, you are going to want to set the From: address for any mail you ever send to be valid, if the mail is ever going to be leaving the server on which it is created at any rate.
Now, the behaviour of the mail command is highly version and OS-specific, but on my local machine (running Ubuntu 16.04 LTS x86_64) the following syntax works for me to set a valid From: address. Note that I have removed or changed some of the e-mail headers from the output for privacy reasons, so you will see more headers than just these ones (or you should).
Normally you'd want a From: header to look more like From: An Example <test@example.com>, but this is just a quick example to demonstrate the principle.
I am really glad to see your help.
I am using below command to send the mail from the server where postfix has been installed
echo "hi" | mail -s "test" username@xyz.com
and on the same server , I am getting below erroe from the location
Last edited by rbatte1; 03-08-2017 at 11:24 AM..
Reason: Added CODE tags
OK, thanks. The problem does indeed appear to be that you are sending mail as root@localhost.localdomain, which external mail servers will indeed rightly reject as being invalid (because it is).
Try setting the From: header to something valid using the same technique as in my previous example, and see how you get on.
Well, that indicates your mail was successfully delivered to the mail server which was the next hop in the chain. You'd have to check the mail logs on that server (or ask whoever manages that server to check them, if it isn't you) to see what became of your e-mail after that server took delivery of it.
The excerpt of /var/log/maillog which you posted showed the message being passed from your own system, to another system. You now need to log on to that other system (the one whose IP I've now removed from the previous post, as per your request), and see what it then did with the mail. If it's a UNIX-style system then it will most likely have a /var/log/maillog of its own. If it's something else (Microsoft Exchange, say) then it will have another mechanism for checking what happened to the mail.
E-mail delivery is a chain of events leading from the sending server all the way through to the server that finally knows what to actually do with the mail in question, often with other intermediary servers in between. You have to trace what happened to the mail at each step along its journey to its final destination to figure out why it's not been delivered. The logs on your own workstation won't be enough, since all they show is that your local MTA did its job, and passed the mail on to the server that it believed would know what to do with it next.
Hi !
I-m copile from source a C++ program from tutorials from internet. I don't understendig any programing languages.. but compiled aplication running ok.
I-ts possible to add in my used program, lines to send one file from config directory in e-mail, to my e-mail adress ?
I want to run... (2 Replies)
While sending mail from linux server we observed below logs,
stat=Deferred: Name server: xxxxxxxxxx.: host name lookup failure
Kindly suggest what we need to change?
Thanks in Advance (2 Replies)
Hi,
I have a fresh new installation of red hat linux. I am trying to send an email from the "mail" utility from inside my Linux box to my company id "xxx@company.com". We are using microsoft exchange server online version to host our company's email.
I am able to send emails to gmail and... (2 Replies)
Hi,
Could any one get me suggested how to send a mail from a linux server to any external user?
I tried the following :
$ mail abc@xyz.com
Subject: test
Hi,
This is a test mail.
.
Cc: def@xyz.com
But I haven't recived any mail at abc@xyz.com and def@xyz.com
Kindly help on... (2 Replies)
hi, Gurus,
I need some help with sending mail out from my UNIX server:
It is running Solaris 2.6 and the sendmail version is 8.8.
Output of :/usr/lib/sendmail -d0.1 -bt < /dev/null
Version 8.8.8+Sun
Compiled with: LOG MATCHGECOS MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET
... (5 Replies)