From fdfba24a4fc57bf58042399de9b6850f35b50ce2 Mon Sep 17 00:00:00 2001 From: lesion Date: Thu, 9 Aug 2018 16:48:47 +0200 Subject: [PATCH] mpop/msmtp/procmail autoresponder to encrypted mail --- scripts/autoresponder/.mpoprc | 16 ++++++++++++++++ scripts/autoresponder/.msmtprc | 13 +++++++++++++ scripts/autoresponder/.procmailrc | 19 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 scripts/autoresponder/.mpoprc create mode 100644 scripts/autoresponder/.msmtprc create mode 100644 scripts/autoresponder/.procmailrc diff --git a/scripts/autoresponder/.mpoprc b/scripts/autoresponder/.mpoprc new file mode 100644 index 0000000..0a8e5e9 --- /dev/null +++ b/scripts/autoresponder/.mpoprc @@ -0,0 +1,16 @@ +defaults + +tls on +tls_starttls on +tls_certcheck on + +delivery mda "/usr/bin/procmail -f '%F' -d $USER" +auth on + +account anna +host ssl0.ovh.net +user anna@fugadalcontrollo.org +password ********* +tls_trust_file /etc/ssl/certs/ca-certificates.crt +keep on +only_new diff --git a/scripts/autoresponder/.msmtprc b/scripts/autoresponder/.msmtprc new file mode 100644 index 0000000..61e918b --- /dev/null +++ b/scripts/autoresponder/.msmtprc @@ -0,0 +1,13 @@ +account default +tls on +tls_starttls off +tls_certcheck on +tls_trust_file /etc/ssl/certs/ca-certificates.crt +host ssl0.ovh.net +port 465 +protocol smtp +auth on +from anna@fugadalcontrollo.org +user anna@fugadalcontrollo.org +password ******* + diff --git a/scripts/autoresponder/.procmailrc b/scripts/autoresponder/.procmailrc new file mode 100644 index 0000000..9b41d8d --- /dev/null +++ b/scripts/autoresponder/.procmailrc @@ -0,0 +1,19 @@ + +SHELL=/bin/sh +LOGFILE=$HOME/.procmail.log +LOG="" +VERBOSE=yes +MAILDIR=$HOME/Maildir +DEFAULT=Maildir/ + +:0c: +* ^TO_anna@fugadalcontrollo.org +{ + PGP_OK=`gpg --decrypt --auto-key-retrieve 1>/dev/null && echo 1` + :0 + * ? test -n "$PGP_OK" + | (formail -rI"From: anna@fugadalcontrollo.org" -I "Subject: [fugadalcontrollo] Grande, grazie della mail") | msmtp -a default -t + + :0 + | (formail -rI"From: anna@fugadalcontrollo.org" -I "Subject: [fugadalcontrollo] No! Così ci beccano") | msmtp -a default -t +}