LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-23-2006, 11:08 AM   #1
davidmc57
LQ Newbie
 
Registered: Jun 2004
Location: Minneapolis, MN
Distribution: Fedora
Posts: 6

Rep: Reputation: 0
sendmail: Remove "From: root" label


Hi,

I am using sendmail (RH 9.0) to send logs from crontab jobs to my regular work address. I managed (after a week of searching this forum) to masquerade the sender address so that the "From:" field shows "david@example.com" instead of the "localhost.localdomain". However, when I receive the message (I use Outlook) I get:

From: root[david@example.com]
To: user@domain.com
Subject: Hello

How can I get rid of this "root" label or at least change it to something else so it appears to come from a human user? The crontab jobs run as "root" and I do not know if I can run them as some other username.

Thanks in advance
 
Old 08-24-2006, 06:16 AM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
IIRC sendmail gets the username from the /etc/passwd file. What's the value for the fifth field in /etc/passwd for your root user? You can try setting this and re-running the cron job - it might help...
 
Old 08-24-2006, 06:31 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
The crontab jobs run as "root" and I do not know if I can run them as some other username.
Try explicitly setting MAILTO=david@example.com in that cronjob. If it doesn't you also could add some mask rules in sendmail.cf but that's a last resort option and it's likely to fsck things up major:
[code]
# Masquerading rules
S1
Rroot<@localhost> $@ david < @ localhost>
Rroot<@localhost.> $@ david < @ localhost.>
 
Old 08-31-2006, 02:57 PM   #4
davidmc57
LQ Newbie
 
Registered: Jun 2004
Location: Minneapolis, MN
Distribution: Fedora
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for your feedback! The root user values on the /etc/passwd file was "root" and I changed it to "david":

root:x:0:0:david:/root:/bin/bash.

Now the mail I send from this unit is received on the other end the way I wanted it: FROM: david[david@example.com].

So far this change does not seem to have affected anything else. The whoami command still shows "root" and the system reboots normally with the root login.

Thank you very much for your help!!!!

David
 
Old 08-31-2006, 03:57 PM   #5
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
When in your cronjobs could you do something like this:
Code:
su david -c "command"
That way when the cronjob with root access runs the command it will have the access of david.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie question: whats the difference between "su root", "su" and "su -&quo mojarron Slackware 9 12-07-2009 04:08 PM
VFS: cannot open root device "LABEL=\" or 00:00 venkatesh111 Linux - Kernel 3 05-04-2006 09:47 AM
FC2; VFS: Cannot open root device "LABEL=/" or unknown-block(0,0) Starchild Fedora 11 01-18-2006 03:39 AM
VFS: Cannot Open Root Device "Label=/" abefroman Red Hat 4 05-03-2005 09:03 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration