<<< Date Index >>>     <<< Thread Index >>>

Re: mutt attachments html and cron



On Wed, Jul 02, 2008 at 05:19:39PM +0300, Paul -Spawn- Rysevets wrote:
> Hello Mutt-users,
> 
>   i'm a bit new to linux world, but my current task needs to be
> finished though...
> 
>   okay.. here is the deal:
>   i need to send html - e-mail from commandline with bunch of
> attachments.. every day ..
>   i've wrote bash-script already..
>   and when run from console (like direct-execute) everything goes
> fine.. just as planned..
> --------------------
> mutt -s "System summary report for $THEDATE" \
>   -e 'my_hdr From: ----scrapped eMail------' \
>   -e 'set content_type="text/html"' \
>   -a $TMPDIR"/d6intprod1_cpu.png" \
>   p.rysevets@xxxxxxxxxxxxxxxxx < 
> /home/master/stat/getsend_rrdstat_template.html
> --------------------
> 
> this way.. mutt sets content type of std-in'ed .html to text/html...
> and all the mailers read it properly and display right html-page with
> attached pictures... i.e. fine, as i wanted it..
> 
> but... here comes the troubles...
> 
> when i set this script to run by cron... - everything works except
> ----------
>   -e 'set content_type="text/html"' \
> ----------
> even the change of "From:" is working fine... but not the content
> type :( ...
> 
> please help.. i'm stuck with only this...
> 
> ah.. btw.. when run by cron i've managet to get error-out:
> ----------------------
> Error in /home/webmaster/.muttrc, line 2: header_cache: unknown variable
> source: errors in /home/webmaster/.muttrc
> Error in command line: content_type: unknown variable
> ----------------------
> 

So on the one hand you've got a bash script that you've run as your
user, and on the other hand you have the same bash script as called
from cron, perhaps by a different user? Does your script actually
declare #!/bin/bash at the top? Cron may not use bash by default on
your system. Run from the CLI as the same user that'll be doing it in
cron and see if it fails that way. Make sure your run from CLI matches
what's happening in cron exactly.

Cheers,
-- 
Cristóbal Palmer
ibiblio.org systems administrator