Operating System - HP-UX
1824218 Members
3744 Online
109669 Solutions
New Discussion юеВ

Crontab and email and hostname

 
SOLVED
Go to solution
Coolmar
Esteemed Contributor

Crontab and email and hostname

Hi,

We recently moved a server over to new hardware. Everything is fine but we are noticing something strange. Whenever a cron job runs that emails the output...it has the name of the old server. I even ran a job from the cron to test it by sending myself an email and put mailx -s "Test from `hostname`" email@domain and the hostname was resolved correctly but the email still had the old server name in the "from" field in my inbox. So where does cron get the "send from" name from?

Thanks,
S
7 REPLIES 7
hpuxrox
Respected Contributor

Re: Crontab and email and hostname

Check your DM line in your sendmail config and verify you are not masquerading
john korterman
Honored Contributor
Solution

Re: Crontab and email and hostname

Hi,

probably from the user's description field in /etc/passwd

regards,
John K.
it would be nice if you always got a second chance
James R. Ferguson
Acclaimed Contributor

Re: Crontab and email and hostname

Hi:

Assuming that 'hostname' and/or 'uname' report the server name correctly, then look in '/etc/mail/sendmail.cf' for masquerading. See the 'DM' macro.

Regards!

...JRF...
Rob Leadbeater
Honored Contributor

Re: Crontab and email and hostname

Hi,

It might be picking it up from the description field in /etc/passwd

Hope this helps,

Regards,

Rob
Coolmar
Esteemed Contributor

Re: Crontab and email and hostname

uname and hostname report it correctly and the DM macro in sendmail.cf is blank....anything else I can check?
hpuxrox
Respected Contributor

Re: Crontab and email and hostname

What does /etc/hosts have? What output does nslookup give when you lookup by ip address?
Coolmar
Esteemed Contributor

Re: Crontab and email and hostname

/etc/passwd was right. Thanks!