Hi,
I have written a perl/shell script on one of our servers which checks the server health and send alert emails to administrators.The script runs as a cron job under root privileges, it is working properly.But the email which we receive has From email address : root@server.name, Is there any way to change this email address ? Is this possible to chang 'from' email header ? If yes how ? and Is it possible to assign multiple email addresses to a single system user (not aliases)
Dear Meghanand,
On Wed, Sep 24, 2008 at 2:18 PM, Meghanand Acharekar vasco.debian@gmail.com wrote:
Hi,
I have written a perl/shell script on one of our servers which checks the server health and send alert emails to administrators.The script runs as a cron job under root privileges, it is working properly.But the email which we receive has From email address : root@server.name, Is there any way to change this email address ? Is this possible to chang 'from' email header ? If yes how ? and Is it possible to assign multiple email addresses to a single system user (not aliases)
man 5 crontab
use LOGNAME and MAILTO env variable as per your needs.
-- Regards, मेघानंद नं. आचरेकर Meghanand N. Acharekar
HTH With regards,
On Wed, Sep 24, 2008 at 5:32 PM, Dinesh Shah (દિનેશ શાહ/दिनेश शाह)
man 5 crontab
use LOGNAME and MAILTO env variable as per your needs.
Thanx for reply .
In my perl Script I have written command
`cat stat_file.txt | mail -s "Some subject" admin@server.name`
and getting email properly on address admin@server.name In this email I getting from: root@server.name, my question is, Is it possible to change this email address to something like do_not_reply@server.name.
On Wednesday 24 Sep 2008, Meghanand Acharekar wrote:
On Wed, Sep 24, 2008 at 5:32 PM, Dinesh Shah (દિનેશ શાહ/दिनेश शाह)
man 5 crontab
use LOGNAME and MAILTO env variable as per your needs.
Thanx for reply .
In my perl Script I have written command
`cat stat_file.txt | mail -s "Some subject" admin@server.name`
and getting email properly on address admin@server.name In this email I getting from: root@server.name, my question is, Is it possible to change this email address to something like do_not_reply@server.name.
I think you are looking for rewrite rules. Each smtp server has it's own mechanism.
-- Arun Kha
On Wed, Sep 24, 2008 at 8:13 PM, Arun Khan knura@yahoo.com wrote:
I think you are looking for rewrite rules. Each smtp server has it's own mechanism.
-- Arun Kha
Thank u all I got it....
exim -f sender@server.name recipient
-- http://mm.glug-bom.org/mailman/listinfo/linuxers
Meghanand Acharekar wrote:
Hi,
I have written a perl/shell script on one of our servers which checks the server health and send alert emails to administrators.The script runs as a cron job under root privileges, it is working properly.But the email which we receive has From email address : root@server.name, Is there any way to change this email address ?
if you have root access, will it not be easier to setup a privileged user account to run such scripts with a name such as "noreply". or you can have a dummy user and send mail as that user with sudo, put the stat files in a path accessible to that user
Is this possible to chang 'from' email header ? If yes how ? and Is it possible to assign multiple email addresses to a single system user (not aliases)
user@server.name is usual for any mail server, any other assigned mail id is called as an alias as far as I know.
Regards Surya Pratap