aboutsummaryrefslogtreecommitdiff
path: root/locale/eo/LC_MESSAGES/_tils/2020-09-04-send-emails-using-the-command-line-for-fun-and-profit.po
blob: 1409e61f2afa23dda2a3edd913fd521a9b68afe5 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#
msgid ""
msgstr ""

msgid ""
"title: Send emails using the command line for fun and profit!\n"
"date: 2020-09-04\n"
"layout: post\n"
"lang: en\n"
"ref: send-emails-using-the-command-line-for-fun-and-profit"
msgstr ""

msgid "Here are a few reasons why:"
msgstr ""

msgid ""
"send yourself and other people notification of cronjobs, scripts runs, CI "
"jobs, *etc.*"
msgstr ""

msgid "leverage the POSIX pipe `|`, and pipe emails away!"
msgstr ""

msgid "because you can."
msgstr ""

msgid "Reason 3 is the fun part, reasons 1 and 2 are the profit part."
msgstr ""

msgid ""
"First [install and configure "
"SSMTP](https://wiki.archlinux.org/index.php/SSMTP) for using, say, Gmail as "
"the email server:"
msgstr ""

msgid ""
"Now install [GNU Mailutils](https://mailutils.org/) (`sudo apt-get install "
"mailutils` or the equivalent on your OS), and send yourself your first "
"email:"
msgstr ""

msgid ""
"And that's about it, you've got mail. Here are some more places where it "
"might be applicable:"
msgstr ""

msgid "...and so on."
msgstr ""

msgid ""
"You may consider adding a `alias mail='mail -aFrom:email@example.com'` so "
"you don't keep re-entering the \"From: \" part."
msgstr ""

msgid "Send yourself some emails to see it working!"
msgstr ""

msgid ""
"# file /etc/ssmtp/ssmtp.conf\n"
"FromLineOverride=YES\n"
"MailHub=smtp.gmail.com:587\n"
"UseSTARTTLS=YES\n"
"UseTLS=YES\n"
"rewriteDomain=gmail.com\n"
"root=username@gmail.com\n"
"AuthUser=username\n"
"AuthPass=password\n"
msgstr ""

msgid "echo body | mail -aFrom:email@example.com email@example.com -s subject\n"
msgstr ""

msgid ""
"# report a backup cronjob, attaching logs\n"
"set -e\n"
"\n"
"finish() {\n"
"  status=$?\n"
"  if [[ $status = 0 ]]; then\n"
"    STATUS=\"SUCCESS (status $status)\"\n"
"  else\n"
"    STATUS=\"FAILURE (status $status)\"\n"
"  fi\n"
"\n"
"  mail user@example.com                                 \\\n"
"       -s \"Backup job report on $(hostname): ${STATUS}\" \\\n"
"       --content-type 'text/plain; charset=utf-8'       \\\n"
"       -A\"$LOG_FILE\" <<< 'The log report is in the attachment.'\n"
"}\n"
"trap finish EXIT\n"
"\n"
"do-long-backup-cmd-here\n"
msgstr ""

msgid ""
"# share the output of a cmd with someone\n"
"some-program | mail someone@example.com -s \"The weird logs that I was talking about\"\n"
msgstr ""