Problem :
I’m stucked when I’m trying send an email, using Mutt, but evry times that I run the script it prompt an menu with an verification. There is any way to bypass that verification or to inupt the option from the script without ask nothing?
#! /bin/bash
zip -r files.zip /home/user/folder/*.*
mutt -s "files[CONFIDENTIAL]" -a files.zip -- mail@mail.com
rm files.zip**strong text**
Solution :
If you don’t specify the body of the message in the command line, mutt will try to open your text editor so that you can enter it. If you specifically want to send an empty message, you can do it this way:
mutt -s "files[CONFIDENTIAL]" -a files.zip < /dev/null -- mail@mail.com
If it still shows a verification message, the problem may come from your .muttrc, and you may try the following:
mutt -s "files[CONFIDENTIAL]" -a files.zip -F /dev/null < /dev/null -- mail@mail.com
Unless your .muttrc defines a specific way of sending e-mail, for example if it contains something like:
set sendmail = "/usr/bin/msmtp -a you"
In this case, you may copy the interesting lines (all options that you want to use, such as set crypt_autoencrypt
if your files are confidential) of your .muttrc into a separate configuration file, and replace -F /dev/null
by -F ~/.yournewconfigurationfile
.
Hope that helps!