grufocom / vee-mail

Simple Script to get Mails from Free Veeam Agent for Linux
GNU Affero General Public License v3.0
49 stars 14 forks source link

missing install of sendemail with libio-socket-ssl-perl #18

Closed dragoangel closed 3 years ago

dragoangel commented 3 years ago

Plain SMTP without auth and encryption in many cases impossible and not secure, so to send mail need to handle something like this:

if [ $SENDM -eq 1 ]; then
 $SENDEMAIL -f $SMTPUSR -xu $SMTPUSR -xp $SMTPPWD -s $SMTPSRV:$SMTPPRT -u "[$STAT] $HN - $START" -t $EMAILTO -o tls=$SMTPTLS < $TEMPFILE
fi

in this case need adjust also build email to zero at start:

# build email
echo "" > $TEMPFILE

sendemail not installed out of the box so bash script missing install of it, as well addition dependency: libio-socket-ssl-perl to handle StartTLS, and of course adjust config template with new variables.

grufocom commented 3 years ago

Hi dragoangel, I added a working sendmail command as dependency! You could use nullmailer to get secure mail transport.

dragoangel commented 3 years ago

Hi @grufocom I mean that why not install sendemail exactly how you install sqlite and so on? And if user have set $SMTPUSR && $SMTPPWS && $SMTPSRV try send mail with auth, otherwise use your code without auth. Can I provide a PR? And if this will be acceptable to you - you will merge it 😃

grufocom commented 3 years ago

Hi @dragoangel, I use different configurations on my systems - sometimes there is postfix installed, sometimes nullmailer and there are systems without any mta installed.

In part, other programs depend on the configuration of the MTA. I actually already have a functioning mail service running on all systems before I install vee-mail.sh or a backup program in general.

Therefore, I assume that this will also be the case for many others.

With nullmailer, your suggestion is practically implemented in a configuration line, which then takes care of the encrypted sending perfectly without requiring any adjustments.

Many people will only use vee-mail internally and may even do without encrypted delivery altogether.

So I wonder if the effort (albeit small) is really necessary? But you are welcome to implement it, if the patch is not longer than the actual program, then the chances are not bad that I will integrate it! ;-)