Different FROM field in cron emails? - Unix
This is a discussion on Different FROM field in cron emails? - Unix ; I set up a shell script that periodically backs up web host's account
using a crontab entry.
So far so good and I even get a nice email from that script whenever
the backup is complete.
However, the email sent ...
-
Different FROM field in cron emails?
I set up a shell script that periodically backs up web host's account
using a crontab entry.
So far so good and I even get a nice email from that script whenever
the backup is complete.
However, the email sent has the "From:" field set to
@.serverNNN.com.
Since I consider my web host's userid an important part of security
(i.e. password is important, but if userid is known it is even easier
to (illegally) break into the account.
Is there a way to make cron send an email FROM a different email
account?
Ideally it should be existingemailaccount@mydomain.com
Is this possible?
If so, how?
Thank!
Nick
-
Re: Different FROM field in cron emails?
manager59073...@shinedyoureyes.com wrote:
>
> I set up a shell script that periodically backs up web host's account
> using a crontab entry.
>
> So far so good and I even get a nice email from that script whenever
> the backup is complete.
>
> However, the email sent has the "From:" field set to
> @.serverNNN.com.
>
> Since I consider my web host's userid an important part of security
> (i.e. password is important, but if userid is known it is even easier
> to (illegally) break into the account.
>
> Is there a way to make cron send an email FROM a different email
> account?
>
> Ideally it should be existingemailacco...@mydomain.com
>
> Is this possible?
>
> If so, how?
Redirect all standard out to a log file. Near the end of the script,
call sendmail directly supplying the from line.
-
Re: Different FROM field in cron emails?
On Oct 13, 12:24*pm, Doug Freyburger wrote:
> manager59073...@shinedyoureyes.com wrote:
>
> > I set up a shell script that periodically backs up web host's account
> > using a crontab entry.
>
> > So far so good and I even get a nice email from that script whenever
> > the backup is complete.
>
> > However, the email sent has the "From:" field set to
> > @.serverNNN.com.
>
> > Since I consider my web host's userid an important part of security
> > (i.e. password is important, but if userid is known it is even easier
> > to (illegally) break into the account.
>
> > Is there a way to make cron send an email FROM a different email
> > account?
>
> > Ideally it should be existingemailacco...@mydomain.com
>
> > Is this possible?
>
> > If so, how?
>
> Redirect all standard out to a log file. *Near the end of the script,
> call sendmail directly supplying the from line.- Hide quoted text -
>
> - Show quoted text -
I usually have the "To:", "Subject:" as the first lines in the log
file. Something like:
From: existingmailaccount@mydomain.com
-or-
From: MyNickName
can be added there or directly at the sendmail command as noted
elsewhere