Sending Mail from Script: Setting Header
- From: Ronald Fischer <ronaldf@xxxxxx>
- Date: Fri, 20 Oct 2006 11:23:26 +0200
I have a zsh Script which dynacmically sends out a status mail.
The mail sent out contains Cc, Bcc and Reply-To headers and
Right now I'm using mutt for this task, because it is very
convenient to specify this information on the mutt command line,
REPLYTO=rtaddr mutt -b bccaddr -c ccaddr -a attachment -s subject toaddr <body
where body is the file containing a mailbody. This works very well so far.
Now I would like to extend the application in that the email being sent
also contains custom headers (such as X-Priority). There is no option
where I can tell mutt to put in additional headers.
This *can* be done, but both possibilities are a little bit complicated:
One way to do it would be to prepare the Email so that it already
contains *all* headers in addition to the mailbody, and then use
mutt -H ...
to send the mail. The other possibility is to generate dynamically
a mutt resource control file, in which the custom headers are placed,
and then use mutt's -F switch to load this file.
So before I try one of these, I would like to ask what approach other
users use to easily send mail using attachments from a script. A solution
working on shell level would be preferable, but different approaches
in Perl, Ruby, Tcl or Python would also be interesting.
Ronald Fischer <ronaldf@xxxxxx>
Posted via http://www.newsoffice.de/
- Prev by Date: Re: Flash Player 9 (beta) available!
- Next by Date: strace one child process
- Previous by thread: Uninterruptible Power Supply
- Next by thread: Re: Sending Mail from Script: Setting Header