1

I am trying to send mail with the following command:

echo "Hello" | mail -s "Hello" myaddr@mydomain.com

and than checking the exit status as: echo $?

which outputs 0

Of course myaddr and mydomain was replaced with the original ones.

But I do not receive email.

I restarted the postfix service as:

service postfix restart

and it restarted successfully.

I found the error below in maillog :

May 13 05:36:13 vagrant-centos64 postfix/error[22703]: 4F82F62D2B: to=, relay=none, delay=21422, delays=21422/0.13/0/0, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=dena-travel.com type=MX: Host not found, try again)
  • 1
    You might get more useful output by using the -v option to mail. – Rahul May 13 '16 at 5:21
  • Did you look at the postfix logs? – Julie Pelletier May 13 '16 at 5:24
  • I checked the maillog and found below: May 13 05:29:17 vagrant-centos64 postfix/pickup[22233]: C8E2362EA9: uid=0 from=<root> May 13 05:29:17 vagrant-centos64 postfix/cleanup[22512]: C8E2362EA9: message-id=<20160513052917.C8E2362EA9@vagrant-centos64.vagrantup.com> May 13 05:29:17 vagrant-centos64 postfix/qmgr[22234]: C8E2362EA9: from=<root@vagrant-centos64.vagrantup.com>, size=485, nrcpt=1 (queue active) – Rahman May 13 '16 at 5:30
  • First of all, don't end up extending discussion in comment box, edit your question and mention necessary information. and please post full error message which you found as "host or domain not found". – Rahul May 13 '16 at 5:55
  • This looks as if your system cannot resolve domains. What does /etc/resolv.conf look like? Are there any DNS servers in it? – Rahul May 13 '16 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.