Change the From Address for Users Emails

I was running a cron job script:
cat /var/log/syslog | mailx -s "Server 48 - Syslog - Daily" email@domain.tld
Unfortunately I setup all these cronjobs as root. All emails were showing up as from “root@domain” or “root@server”, or even just plain “root”. Awesome.

So here’s the easiest way to fix this issue:
chfn
Then change the information for first/last/etc. This will change it for the CURRENTLY LOGGED IN USER.

Otherwise you can always just run:
chfn -f "Full name" root
Usage is chfn [-f full_name] [-r room_no] [-w work_ph] [-h home_ph] [-o other] [user]

Leave a Reply

Your email address will not be published. Required fields are marked *