diff options
Diffstat (limited to 'src/content/tils/2020/09/04')
-rw-r--r-- | src/content/tils/2020/09/04/cli-email-fun-profit.adoc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/content/tils/2020/09/04/cli-email-fun-profit.adoc b/src/content/tils/2020/09/04/cli-email-fun-profit.adoc index 5476fac..1da1154 100644 --- a/src/content/tils/2020/09/04/cli-email-fun-profit.adoc +++ b/src/content/tils/2020/09/04/cli-email-fun-profit.adoc @@ -15,7 +15,7 @@ Reason 3 is the fun part, reasons 1 and 2 are the profit part. First {ssmpt}[install and configure SSMTP] for using, say, Gmail as the email server: -[source,shell] +[source,sh] ---- # file /etc/ssmtp/ssmtp.conf FromLineOverride=YES @@ -31,7 +31,7 @@ AuthPass=password Now install {mailutils}[GNU Mailutils] (`sudo apt-get install mailutils` or the equivalent on your OS), and send yourself your first email: -[source,shell] +[source,sh] ---- echo body | mail -aFrom:email@example.com email@example.com -s subject ---- @@ -39,7 +39,7 @@ echo body | mail -aFrom:email@example.com email@example.com -s subject And that's about it, you've got mail. Here are some more places where it might be applicable: -[source,shell] +[source,sh] ---- # report a backup cronjob, attaching logs set -e @@ -62,10 +62,11 @@ trap finish EXIT do-long-backup-cmd-here ---- -.... +[source,sh] +---- # share the output of a cmd with someone some-program | mail someone@example.com -s "The weird logs that I was talking about" -.... +---- ...and so on. |