I'm trying to set up a tool that emails me periodically (in my case, psad). It allows by default to define just a destination email for reports.

Is there a general way to get this or similar tools to use a non-default SMTP server, with TLS? (e.g. gmail's SMTP)

link|improve this question

49% accept rate
feedback

1 Answer

mailx can use SMTP. It's configure file is ~/.mailrc

Mailx using Gmail's SMTP:

(The configure can even be in one command)

mailx -v -s "$EMAIL_SUBJECT" \
-S smtp-use-starttls \
-S ssl-verify=ignore \
-S smtp-auth=login \
-S smtp=smtp://smtp.gmail.com:587 \
-S from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)" \
-S smtp-auth-user=$FROM_EMAIL_ADDRESS \
-S smtp-auth-password=$EMAIL_ACCOUNT_PASSWORD \
-S ssl-verify=ignore \
-S nss-config-dir=~/.mozilla/firefox/xxxxxxxx.default/ \
$TO_EMAIL_ADDRESS
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.