[H-GEN] Automated Mail with Mutt
David Jericho
davidj at pisoftware.com
Thu Nov 13 01:56:46 EST 2003
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
irwa82 at froggy.com.au wrote:
> I looked up the man pages for mutt and found I could do the following.
> mutt mail at example.com -s "Subject" -i /path/message.txt -a /path/backup.sql
Firstly I think this is really evil. I find this evil because mutt is an
MUA, it exists for the user. metamail/metasend is designed to work at a
different layer. They're meant to work from cron or shell scripts rather
than as interactive programs. I understand you want to attach the sql as
the object, but it can be done cleaner using metamail.
[cartman at cheezypoof:~]$ metasend -b \
-m text/plain -D "message.txt" -f /path/message.txt -n \
-m text/plain -D "SQL backup $(date).sql" -f /path/backup.sql \
-s "Subject" -t mail at example.com \
-c firstcc at example.com -c secondcc at example.com
The nice thing is that SQL backups can be big, and they tend to be quite
compressable. You can compress the backup.sql file with gzip, and set
the mime type to "application/octet-stream".
If that won't work, you've got problems bigger than how to automate part
of mutt.
> The problem is that mutt comes up and wants you to confirm all the
> infomation. Is there a way to automatically send the email without
> confirmation from the user?
By my manual, section 6.3.10 and around there. You're looking for the
askbcc, askcc, along with autoedit, edit_headers, and fast_reply options.
--
David Jericho
Systems Administrator, Plugged In Software
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'. See http://www.humbug.org.au/
More information about the General
mailing list