cancel
Showing results for 
Search instead for 
Did you mean: 

weird problem with sendmail

Kirill Cherkashin
Frequent Advisor

weird problem with sendmail

Hi,

How to configure sendmail to send emails without configuring DNS ?

we have a few HP and we need only to send occasionally emails as backup and cron notifications to exchange server and SMS-gate.
I configured /etc/nsswitch.conf using only files services. /etc/resolvf.conf doesn't exists at all. Also I put name of host with dot trailing to /etc/hosts and /etc/mail/sendmail.cw but anyway I could send email only locally.
Remote server says : "sender domain must exist,data format error"

Any ideas?
5 REPLIES
someone_4
Honored Contributor

Re: weird problem with sendmail

Hello,
lets call
hosta server you are sending from
and
hostb server you are sending to.

In /etc/hosts on hosta you should have:

this.is.the.ip hostb

on hostb /etc/hosts you should have the ip and name for hosta.

this.is.the.ip hosta

try that and then from hosta do:
echo test | sendmail -v user@hosta

echo test | sendmail -v other_user@hostb

and from hostb

echo test | sendmail -v user@hostb

echo test | sendmail -v other_user@hosta

if it fails .. post the results from the last tests.

Richard
Sanjay_6
Honored Contributor

Re: weird problem with sendmail

Kirill Cherkashin
Frequent Advisor

Re: weird problem with sendmail

Richard,

I got next messages:

user@hosta> echo test | sendmail -v other_user@hostb


501 ... Sender domain must exist
another_user@hostb... Data formar error


Sanjay,

everything was DONE exactly as in this paper.in fact I read it before posting. it doesnt't work for 11.11.
someone_4
Honored Contributor

Re: weird problem with sendmail

Hello Kirill,

I have been playing with my test server. And 2 things so far I found will cause your error. First I have to ask you to double check your /etc/hosts file on the server you are sending from and the server you are sending to. If the /etc/hosts entry for the server you are sending from is not in the server you are sending to your email will fail. Remember the hostname has to have your domain at the end.

without entry lupus (lupus from server)entry on the server I am sending to.

501 ... Sender domain must exist
Data format error
root... Connecting to local


When I added lupus entry on the server I was sending to.

>>> MAIL From: SIZE=5
250 ... Sender ok

Ok
thats #1 ..
2nd in /etc/mail
vi sendmail.cf
go to the Dj section:

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM

uncomment
#Dj$w.Foo.COM
and please it with
Dj$w.yourdomain.com

yourdomain.com being the same domain that is on the server you are trying to send to.
save the changed and restart sendmail

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

Test it again and let us know what happends.



Richard
Kirill Cherkashin
Frequent Advisor

Re: weird problem with sendmail

I found solution for this small problem.
I put entry Dm. in /etc/sendmai.cf and it works!
Meaning of this macro - all hosts with trailing dot as local domain and therefore i'm able to send messages to all hosts in /etc/hosts file.