cancel
Showing results for 
Search instead for 
Did you mean: 

sendmail.cf

 
SOLVED
Go to solution
Highlighted

sendmail.cf

We have the following setting in our .cf file

Dj$w.

The problem is that if an e-mail is going external my Network adminstrator is telling me that e-mails are being stopped because the domainname is not valid.

The e-mails show they are coming from
'user id@hostname.domainname' and I get the following in the mail.log
Jan 13 09:19:57 hpfiscal sendmail[22044]: unable to qualify my own domain name (hpfiscal) -- using short name
Jan 13 09:19:57 hpfiscal sendmail[22044]: be sure to set domain name in Dj macro in sendmail.cf


I would like it just to say
'user id@domainname'
I have tried removing the $w but had no joy.

Can someone suggest how to remove the hostname from the 'from' address.

Thanks
George
15 REPLIES 15
Highlighted
Honored Contributor

Re: sendmail.cf

did you change your /etc/hosts and resolv.conf files accordingly?
a warrior never quits
Highlighted

Re: sendmail.cf

Ahsan,

The nsswitch is set to files and then dns.

I am not an expert on address resolution so do not know what should be in the /etc/hosts pertaining to sendmail.

Sendmail seems to know the host and knows the domain but I just do not want it to dispaly both after the @ sign in the 'from' address.

Thank you for the interest.
George
Highlighted
Honored Contributor
Highlighted

Re: sendmail.cf

Ahsan,

Those links are related and indeed one of them stopped the error messages on the mail.log

However my initial problem remains. When the e-mail is sent out the 'from' address still says 'userid@hostname.domainname' and I would like it to say 'userid@domainname' only.

Hope that makes sense.
Thanks
George
Highlighted
Honored Contributor

Re: sendmail.cf

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1039532
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Highlighted
Honored Contributor

Re: sendmail.cf

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=87762
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Highlighted
Honored Contributor

Re: sendmail.cf

I've done this in our sendmail.cf:

#
# envelope sender rewriting
#
S11
R$- $@ $1@
R$- $+ $1
R$- $@ $1@

R$+ $: $>51 $1 sender/recipient common
R$* :; <@> $@ list:; special case
R$* $: $>61 $1 qualify unqual'ed names
R$+ $: $>94 $1 do masquerading

I'm not sure anymore which lines I've added and which were already there, but this made it work exactly the way you want it too. (of course replace by your domain)
Every problem has at least one solution. Only some solutions are harder to find.
Highlighted
Valued Contributor

Re: sendmail.cf

Hi - here is the fix for the sendmail issue you are having..


Dj - macro in sendmail.cf is for domainname,

Djnodename.somedomain.com

make sure you have the same entry in the /etc/hosts file also

then do this test and see if the email can be delivered

#/usr/sbin/sendmail -v userid@mailserver.com

test mail

. (terminate with a dot)

let me know if this is working.

regards

Pratyush
Die Hard
Highlighted

Re: sendmail.cf

Thank you all for your replies.

Still not having much joy of removing the nodename from the 'from' address.

Avinash, I followed your link and attempted the User Database route but it hasn't made a difference. I must be missing some step along the way.

Elmar, I must admit I didn't fancy changing my sendmail.cf with all that input you suggested especially as I had no understanding of what it is doing.

Pratyush, What you suggested is exactly what my current setup is. Djnodename.domainname and that's why I thought it was putting both in my 'from' address.

Just to clarify, When sending mail via sendmail I need to have
username@nodename.domainname to be dispalyed
username@domainname.

I didn't realise it would be such a difficult thing to do but I do appreciate all the effort.
George