problem with sendmail and su

Derek Ragona derek at computinginnovations.com
Wed Jul 9 23:38:09 UTC 2008


At 05:44 AM 7/9/2008, Nicolas Letellier wrote:
>Hello.
>
>I use FreeBSD 7 with sendmail. I have a problem for sending email. More
>precisely, with the sender of the mail.
>When I'm logged to my machine in root, the mail is sent with
>"root at mymachine.com" with sender. OK, no problems.
>When I'm logged to my machine in nicolas, the mail is sent with
>"nicolas at mymachine.com" with sender. OK, no problems.
>
>However, when I'm logged in nicolas to my machine, and if I do a "su
>root" or "su - root", and I send a mail, the sender will be
>"nicolas at mymachine.com" and not "root at mymachine.com".
>
>It's a problem, because I done a "su" to be logged as root.
>
>I don't have this problem with a FreeBSD/Postfix.
>
>Thanks for your advices and helps. I don't understand this problem.
>
>Regards,
>
>--
>  - Nicolas.

That is exactly working as designed.  The reason sendmail sends the mail as 
your actual login user is so you cannot spoof so easily.  If you have 
certain emails like system reports you are sending and want them sent as 
root, add them to roots crontab file.

         -Derek

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the freebsd-questions mailing list