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

Re: MUTT file attachments are mandatory?



* fernando.olmos@xxxxxxxxxx <fernando.olmos@xxxxxxxxxx> [061211 22:03]:
> I already solved it, like you said, by testing the existence of the file
> before running MUTT. However, due to the nature of the reports that I
> need to attach this means IF THEN ELSE on every report, which means a
> lot of overheads with MUTT commands all over the shop. It would have
> been nice for MUTT to treat the '-a' switch as optional and I hence I
> would have only ONE command line for all my reports.

Why build this functionality into mutt, though?  I don't know what
language you are calling this from, but in shell script it's as simple
as something like (not tested)

#!/bin/bash
LIST=
for i in file1 file2
do
 [ -f $i ] && LIST="$LIST -a $i"
done
mutt recipient -s 'blah' $LIST < /dev/null


j

Attachment: pgpUNbiowIytx.pgp
Description: PGP signature