瀏覽代碼

Email pic

Bob Mottram 9 年之前
父節點
當前提交
608a90ec25
共有 4 個檔案被更改,包括 562 行新增1323 行删除
  1. 1
    437
      doc/EN/usage.org
  2. 472
    0
      doc/EN/usage_email.org
  3. 二進制
      img/email.png
  4. 89
    886
      website/EN/usage.html

+ 1
- 437
doc/EN/usage.org 查看文件

@@ -18,8 +18,7 @@
18 18
 
19 19
 | [[Readme]]                 |
20 20
 | [[Improving ssh security]] |
21
-| [[Using Email]]            |
22
-| [[Mailing List]]           |
21
+| [[./usage_email.html][Using Email]]            |
23 22
 | [[Syncing to the Cloud]]   |
24 23
 | [[Play Music]]             |
25 24
 | [[Microblogging]]          |
@@ -67,441 +66,6 @@ There are advantages and disadvantages to using ssh keys for logins. The advanta
67 66
 
68 67
 If you wish to only use ssh keys then log in to the Freedombone, become the root user and open the control panel with the 'control' command. Select /Security Settings/ then keep hitting enter until you reach the question about allowing password logins. Select "no" for that, then apply the settings. Any subsequent attempts to log in via a password will then be denied.
69 68
 
70
-* Using Email
71
-** A technical note about email transport security
72
-Port 465 is used for SMTP and this is supposedly deprecated for secure email. However, using TLS from the start of the communications seems far more secure than starting off with insecure communications and then trying to upgrade it with a command to begin TLS, as happens with STARTTLS. There are [[https://www.eff.org/deeplinks/2014/11/starttls-downgrade-attacks][possible attacks against STARTTLS]] in which the command to begin secure communications is removed or overwritten which could then result in email being transferred in plain text over the internet and be readable by third parties.
73
-
74
-From http://motherboard.vice.com/read/email-encryption-is-broken:
75
-
76
-#+BEGIN_QUOTE
77
-The researchers also uncovered mass scale attacks of STARTTLS sessions being stripped of their encryption. That attack itself isn't new: internet service providers sometimes do it to monitor users; organizations may use it to keep an eye on employees; or it may come from a malicious actor
78
-#+END_QUOTE
79
-** Add a password to your GPG key
80
-If you didn't use existing GPG keys during the Freedombone installation then you'll need to add a password to your newly generated private key. This is highly recommended. Go through the following sequence of commands to ssh into the Freedombone and then change your GPG password.
81
-
82
-#+BEGIN_SRC bash
83
-ssh username@domainname -p 2222
84
-gpg --edit-key username@domain
85
-passwd
86
-save
87
-quit
88
-exit
89
-#+END_SRC
90
-
91
-Having a password on your GPG key will prevent someone from reading your email /even if your server gets lost or stolen/ or if someone else has physical access to it. Make the password something long and unlikely to be guessable or vulnerable to a brute force [[http://en.wikipedia.org/wiki/Dictionary_attack][dictionary attack]].
92
-
93
-** Publishing your GPG public key
94
-If you havn't already then you should publish your GPG public key so that others can find it.
95
-
96
-#+BEGIN_SRC bash
97
-ssh username@domainname -p 2222
98
-gpg --send-keys username@domainname
99
-exit
100
-#+END_SRC
101
-** Mutt email client
102
-Mutt is a terminal based email client which comes already installed onto the Freedombone. To access it you'll need to access it via ssh with:
103
-
104
-#+BEGIN_SRC bash
105
-ssh username@domainname -p 2222
106
-#+END_SRC
107
-
108
-If you're using Windows there is an ssh client called putty, on Linux just open a terminal and enter the above command with your username and domain name. On Android you can use the ConnectBot app with the hostname *username@domain:2222*
109
-
110
-Once you have logged in via ssh then just type *mutt*. Like most terminal programs mutt is quite easy once you've learned the main keys.
111
-
112
-Some useful keys to know are:
113
-
114
-| "/"    | Search for text within headers                          |
115
-| *      | Move to the last message                                |
116
-| TAB    | Move to the next unread message                         |
117
-| d      | Delete a message                                        |
118
-| u      | Undelete a mail which is pending deletion               |
119
-| $      | Delete all messages selected and check for new messages |
120
-| a      | Add to the address book                                 |
121
-| m      | Send a new mail                                         |
122
-| ESC-m  | Mark all messages as having been read                   |
123
-| S      | Mark a message as spam                                  |
124
-| H      | Mark a message as ham                                   |
125
-| CTRL-b | Toggle side bar on/off                                  |
126
-| CTRL-n | Next mailbox (on side bar)                              |
127
-| CTRL-p | Previous mailbox (on side bar)                          |
128
-| CTRL-o | Open mailbox (on side bar)                              |
129
-| r      | Reply to an email                                       |
130
-| L      | Reply to a mailing list email                           |
131
-| ]      | Expand or collapse all threads                          |
132
-| [      | Expand of collapse the current thread                   |
133
-| CTRL-k | Import a PGP/GPG public key                             |
134
-| q      | Quit                                                    |
135
-
136
-To use the address book system open an email by pressing the enter key on it and then to add the sender to the address list press the A key.  It will ask you for an alias which may be used the next time you want to send a mail.  Alternatively you may just edit the *~/.mutt-alias* file directly to add email addresses.
137
-
138
-One of the most common things which you might wish to do is to send an email.  To do this first press /m/ to create a new message.  Enter the address to send to and the subject, then after a few seconds the Emacs editor will appear with a blank document.  Type your email then press /CTRL-x CTRL-s/ to save it and /CTRL-x CTRL-c/ to exit.  You will then see a summary of the email to be sent out.  Press /y/ to send it and then enter your GPG key passphrase (the one you gave when creating a PGP/GPG key).  The purpose of that is to add a signature which is a strong proof that the email was written by you and not by someone else.
139
-
140
-When reading emails you will initially need to enter your GPG password. It will be retained in RAM for a while afterwards.
141
-
142
-** Thunderbird/Icedove
143
-Another common way in which you may want to access email is via Thunderbird (also known as Icedove on Debian).  This may be especially useful if you're trying to convert former Windows users who may previously have been using some version of Outlook.
144
-
145
-The following instructions should be carried out on the client machines (laptop, etc), not on the BBB itself.
146
-
147
-*** Initial setup
148
-
149
-Install *Thunderbird* and *Enigmail*.  How you do this just depends upon your distro and software manager or "app store".
150
-
151
-Open Thinderbird
152
-
153
-Select "*Skip this and use existing email*"
154
-
155
-Enter your name, email address (myusername@mydomainname.com) and the password for your user.
156
-
157
-You'll get a message saying "/Thunderbird failed to find the settings/"
158
-
159
-The settings should be as follows, substituting /mydomainname.com/ for your domain name and /myusername/ for the username.
160
-
161
-  * Incoming: IMAP, mydomainname.com, 993, SSL/TLS, Normal Password
162
-  * Outgoing: SMTP, mydomainname.com, 465, SSL/TLS, Normal Password
163
-  * Username: myusername
164
-
165
-Click *Done*.
166
-
167
-Click *Get Certificate* and make sure "*permanently store this exception*" is selected", then click *Store Security Exception*.
168
-
169
-From OpenPGP setup select "*Yes, I would like the wizard to get me started*".  If the wizard doesn't start automatically then "setup wizard" can be selected from OpenPGP on the menu bar.
170
-
171
-Select "*Yes, I want to sign all of my email*"
172
-
173
-Select "*No, I will create per-recipient rules*"
174
-
175
-Select "*yes*" to change default settings.
176
-*** Import your GPG keys
177
-On the Freedombone export your GPG public and private keys.
178
-
179
-#+BEGIN_SRC bash
180
-ssh username@domainname -p 2222
181
-gpg --list-keys username@domainname
182
-gpg --output ~/public_key.gpg --armor --export KEY_ID
183
-gpg --output ~/private_key.gpg --armor --export-secret-key KEY_ID
184
-#+END_SRC
185
-
186
-On your laptop or desktop you can import the keys with:
187
-
188
-#+BEGIN_SRC bash
189
-scp -P 2222 username@domain:/home/username/*.gpg ~/
190
-#+END_SRC
191
-
192
-Select "*I have existing public and private keys*".
193
-
194
-Select your public and private GPG exported key files.
195
-
196
-Select the account which you want to use and click *Next*, *Next* and *Finish*.
197
-
198
-Remove your exported key files, both on your laptop/desktop and also on the Freedombone.
199
-
200
-#+BEGIN_SRC bash
201
-shred -zu ~/public_key.gpg
202
-shred -zu ~/private_key.gpg
203
-#+END_SRC
204
-
205
-*** Using for the first time
206
-
207
-Click on the Thunderbird menu, which looks like three horizontal bars on the right hand side.
208
-
209
-Hover over *preferences* and then *Account settings*.
210
-
211
-Select *OpenPGP Security* and make sure that *use PGP/MIME by default* is ticked. This will enable you to sign/encrypt attachments, HTML bodies and UTF-8 without any problems.
212
-
213
-Select *Synchronization & Storage*.
214
-
215
-Make sure that *Keep messages for this account on this computer* is unticked, then click *Ok*.
216
-
217
-Click on *Inbox*.  Depending upon how much email you have it may take a while to import the subject lines.
218
-
219
-Note that when sending an email for the first time you will also need to accept the SSL certificate.
220
-
221
-Get into the habit of using email encryption and encourage others to do so.  Remember that you may not think that your emails are very interesting but the Surveillance State is highly interested in them and will be actively trying to data mine your private life looking for "suspicious" patterns, regardless of whether you are guilty of any crime or not.
222
-
223
-*** Making folders visible
224
-By default you won't be able to see any folders which you may have created earlier using the /mailinglistrule/ script.  To make folders visible select:
225
-
226
-*Menu*, hover over *Preferences*, select *Account Settings*, select *Server Settings* then click on the *Advanced* button.
227
-
228
-Make sure that "*show only subscribed folders*" is not checked.  Then click the *ok* buttons.  Folders will be re-scanned, which may take some time depending upon how much email you have, but your folders will then appear.
229
-
230
-** K9 Android client
231
-*** A point about GPG on Android
232
-Before trying to set up email on Android you may want to consider whether you really need to do this. Android (and its variants) is not a particularly secure operating system and whether or not you wish to store GPG keys on it depends on your threat model and in what situations you'll be using your device.
233
-
234
-If you are going to use email on an Android device then ensure that you have full encryption enabled via the security settings, so that if you subsequently lose it, or if it gets stolen, the chances of encryption keys being exposed are minimised.
235
-*** Compiling the development version
236
-To get K9 working with Freedombone you'll need to install development versions of OpenKeychain and K9. At the time of writing the versions available in F-Droid do not support PGP/MIME or the "hidden recipient" feature of GPG. It is hoped that at some stage the patches will be integrated into the mainline or functionally equivalent changes made. Admittedly, this is not at all user friendly, but currently it's the only way to read Freedombone email on Android systems.
237
-
238
-Build script for OpenKeychain:
239
-
240
-#+BEGIN_SRC bash
241
-mkdir ~/develop
242
-cd ~/develop
243
-git clone https://github.com/bashrc/open-keychain
244
-cd open-keychain
245
-git checkout origin/bashrc/hidden-recipient-minimal
246
-git checkout -b bashrc/hidden-recipient-minimal
247
-cd tools
248
-nano build.sh
249
-#+END_SRC
250
-
251
-Then add the following:
252
-
253
-#+BEGIN_SRC bash
254
-#!/bin/bash
255
-
256
-# This script is intended to be used on Debian systems for building
257
-# the project. It has been tested with Debian 8
258
-
259
-USERNAME=$USER
260
-SIGNING_NAME='openkeychain'
261
-SDK_VERSION='r23.3.4'
262
-SDK_DIR=$HOME/android-sdk
263
-
264
-cd ..
265
-
266
-PROJECT_HOME=$(pwd)
267
-
268
-sudo apt-get install build-essential default-jdk \
269
-     lib32stdc++6 lib32z1 lib32z1-dev
270
-
271
-if [ ! -d $SDK_DIR ]; then
272
-    mkdir -p $SDK_DIR
273
-fi
274
-cd $SDK_DIR
275
-
276
-# download the SDK
277
-if [[ ! -f $SDK_DIR/android-sdk_$SDK_VERSION-linux.tgz ]]; then
278
-    wget https://dl.google.com/android/android-sdk_$SDK_VERSION-linux.tgz
279
-fi
280
-tar -xzvf android-sdk_$SDK_VERSION-linux.tgz
281
-SDK_DIR=$SDK_DIR/android-sdk-linux
282
-
283
-echo 'Check that you have the SDK tools installed for Android 22, SDK 21.1.2'
284
-
285
-export ANDROID_HOME=$SDK_DIR
286
-echo "sdk.dir=$SDK_DIR" > $ANDROID_HOME/local.properties
287
-export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
288
-
289
-cd $SDK_DIR/tools
290
-./android sdk
291
-
292
-if [ ! -f $SDK_DIR/tools/android ]; then
293
-    echo "$SDK_DIR/tools/android not found"
294
-    exit -1
295
-fi
296
-cd $SDK_DIR
297
-chmod -R 0755 $SDK_DIR
298
-chmod a+rx $SDK_DIR/tools
299
-
300
-# android sdk
301
-cd $PROJECT_HOME
302
-git submodule init && git submodule update
303
-
304
-if [ ! -f $SDK_DIR/tools/templates/gradle/wrapper/gradlew ]; then
305
-    echo "$SDK_DIR/tools/templates/gradle/wrapper/gradlew not found"
306
-    exit -2
307
-fi
308
-. $PROJECT_HOME/gradlew assembleDebug
309
-
310
-# cleaning up
311
-cd $PROJECT_HOME/OpenKeychain/build/outputs/apk
312
-if [ ! -f OpenKeychain-debug.apk ]; then
313
-    echo 'OpenKeychain-debug.apk was not found'
314
-    exit -3
315
-fi
316
-
317
-echo 'Build script ended successfully'
318
-echo -n 'apk is available at: '
319
-echo "$PROJECT_HOME/OpenKeychain/build/outputs/apk/OpenKeychain-debug.apk"
320
-exit 0
321
-#+END_SRC
322
-
323
-Save and exit with *CTRL-o*, *CTRL-x*.
324
-
325
-#+BEGIN_SRC bash
326
-chmod +x build.sh
327
-./build.sh
328
-#+END_SRC
329
-
330
-Build script for K9:
331
-
332
-#+BEGIN_SRC bash
333
-cd ~/develop
334
-git clone https://github.com/k9mail/k-9
335
-cd k-9
336
-cd tools
337
-nano build.sh
338
-#+END_SRC
339
-
340
-Then add the following:
341
-
342
-#+BEGIN_SRC bash
343
-#!/bin/bash
344
-
345
-# This script is intended to be used on Debian systems for building
346
-# the project. It has been tested with Debian 8
347
-
348
-USERNAME=$USER
349
-SIGNING_NAME='k-9'
350
-SDK_VERSION='r24.3.3'
351
-SDK_DIR=$HOME/android-sdk
352
-
353
-cd ..
354
-
355
-PROJECT_HOME=$(pwd)
356
-
357
-sudo apt-get install build-essential default-jdk \
358
-     lib32stdc++6 lib32z1 lib32z1-dev
359
-
360
-if [ ! -d $SDK_DIR ]; then
361
-    mkdir -p $SDK_DIR
362
-fi
363
-cd $SDK_DIR
364
-
365
-# download the SDK
366
-if [ ! -f $SDK_DIR/android-sdk_$SDK_VERSION-linux.tgz ]; then
367
-    wget https://dl.google.com/android/android-sdk_$SDK_VERSION-linux.tgz
368
-    tar -xzvf android-sdk_$SDK_VERSION-linux.tgz
369
-fi
370
-SDK_DIR=$SDK_DIR/android-sdk-linux
371
-
372
-echo 'Check that you have the SDK tools installed for Android 17, SDK 19.1'
373
-if [ ! -f $SDK_DIR/tools/android ]; then
374
-    echo "$SDK_DIR/tools/android not found"
375
-    exit -1
376
-fi
377
-cd $SDK_DIR
378
-chmod -R 0755 $SDK_DIR
379
-chmod a+rx $SDK_DIR/tools
380
-
381
-ANDROID_HOME=$SDK_DIR
382
-echo "sdk.dir=$SDK_DIR" > $ANDROID_HOME/local.properties
383
-PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
384
-
385
-android sdk
386
-cd $PROJECT_HOME
387
-
388
-if [ ! -f $SDK_DIR/tools/templates/gradle/wrapper/gradlew ]; then
389
-    echo "$SDK_DIR/tools/templates/gradle/wrapper/gradlew not found"
390
-    exit -2
391
-fi
392
-. $PROJECT_HOME/gradlew assembleDebug
393
-
394
-# cleaning up
395
-cd $PROJECT_HOME/k9mail/build/outputs/apk
396
-if [ ! -f k9mail-debug.apk ]; then
397
-    echo 'k9mail-debug.apk was not found'
398
-    exit -3
399
-fi
400
-echo 'Build script ended successfully'
401
-echo -n 'apk is available at: '
402
-echo "$PROJECT_HOME/k9mail/build/outputs/apk/k9mail-debug.apk"
403
-exit 0
404
-#+END_SRC
405
-
406
-Save and exit with *CTRL-o*, *CTRL-x*.
407
-
408
-#+BEGIN_SRC bash
409
-chmod +x build.sh
410
-./build.sh
411
-#+END_SRC
412
-
413
-*** Import your GPG key into OpenKeychain
414
-With your device connected to a laptop via USB cable and with USB debugging enabled on it:
415
-
416
-#+BEGIN_SRC bash
417
-ssh username@domainname -p 2222
418
-gpg --list-keys username@domainname
419
-gpg --output ~/public_key.gpg --armor --export KEY_ID
420
-gpg --output ~/private_key.gpg --armor --export-secret-key KEY_ID
421
-cat ~/public_key.gpg ~/private_key.gpg > ~/mygpgkey.asc
422
-exit
423
-scp -P 2222 username@domainname:/home/username/mygpgkey.asc ~/
424
-sudo apt-get install android-tools-adb
425
-push ~/mygpgkey.asc /sdcard/
426
-shred -zu ~/mygpgkey.asc
427
-#+END_SRC
428
-
429
-Then on your device select OpenKeychain and import your key from file.
430
-*** Incoming server settings
431
- * Select settings/account settings
432
- * Select Fetching mail/incoming server
433
- * Enter your username and password
434
- * IMAP server should be your domain name
435
- * Security: SSL/TLS (always)
436
- * Authentication: Plain
437
- * Port: 993
438
-*** Outgoing (SMTP) server settings
439
- * Select settings/account settings
440
- * Select Sending mail/outgoing server
441
- * Set SMTP server to your domain name
442
- * Set Security to SSL/TLS (always)
443
- * Set port to 465
444
- * Set authentication to PLAIN
445
- * Enter your username and password
446
- * Accept the SSL certificate
447
-*** Crypto settings
448
-Select *settings*, *Account settings*, *OpenKeychain* and then select your key and press *Allow*. You should now be able to decrypt emails by entering your GPG passphrase.
449
-
450
-You may also want to change the amount of time for which passwords are remembered, so that you don't need to enter your passphrase very often.
451
-*** Folders
452
-To view any new folders which you may have created using the /mailinglistrule/ script from your inbox press the *K9 icon* at the top left to access folders, then press the *menu button* and select *refresh folder list*.
453
-
454
-If your folder still doesn't show up then press the *menu button*, select *show folders* and select *all folders*.
455
-
456
-** Subscribing to mailing lists
457
-To subscribe to a mailing list log in as your user (i.e. not the root user).
458
-
459
-#+BEGIN_SRC bash
460
-ssh username@domainname -p 2222
461
-freedombone-addlist -l <mailing list name> -s <subject tag> -e <list email address>
462
-exit
463
-#+END_SRC
464
-
465
-The subject tag should be the word or phrase which appears within the brackets in the subject line of emails from the mailing list. The mailing list name should be something short so that it is readable within the left side column of the mutt email client, and contain no spaces. You can also use the *freedombone-rmlist* if you wish not to show a particular list within Mutt.
466
-** Adding email addresses to a group/folder
467
-Similar to adding mailing list folders you can also add specified email addresses into a group/folder.
468
-
469
-#+BEGIN_SRC bash
470
-ssh username@domainname -p 2222
471
-freedombone-addemail -e <email address> -g <group name>
472
-exit
473
-#+END_SRC
474
-
475
-The group name should be something short so that it is readable within the left side column of the mutt email client, and not contain any spaces. You can also use the *freedombone-rmemail* command to remove an email address rule.
476
-
477
-** Ignoring incoming emails
478
-It is possible to ignore incoming emails if they are from a particular email address or if the subject line contains particular text.
479
-
480
-#+BEGIN_SRC bash
481
-ssh username@domainname -p 2222
482
-freedombone-ignore -e baduser@baddomain
483
-exit
484
-#+END_SRC
485
-
486
-Or:
487
-
488
-#+BEGIN_SRC bash
489
-ssh username@domainname -p 2222
490
-freedombone-ignore -t "make $$$ now!"
491
-exit
492
-#+END_SRC
493
-
494
-You can also reverse this by using the *freedombone-unignore* command with the same options.
495
-* Mailing List
496
-If you want to set up a public mailing list then when installing the system remember to set the *PUBLIC_MAILING_LIST* variable within *freedombone.cfg* to the name of your list. The name should have no spaces in it. Public mailing lists are unencrypted so anyone will be able to read the contents, including non subscribers.
497
-
498
-To subscribe to your list send a cleartext email to:
499
-
500
-#+BEGIN_SRC bash
501
-mymailinglistname+subscribe@domainname
502
-#+END_SRC
503
-
504
-Tip: When using the Mutt email client if you want to send an email in cleartext then press *p* (for PGP) on the sending screen and select *clear*. Unsecure email is treated as being the exception rather than the default.
505 69
 * Syncing to the Cloud
506 70
 ** Initial install
507 71
 Within a browser go to your owncloud domain, then create an administrator account. The username and password can be anything, and ideally should be generated from a password manager.

+ 472
- 0
doc/EN/usage_email.org 查看文件

@@ -0,0 +1,472 @@
1
+#+TITLE:
2
+#+AUTHOR: Bob Mottram
3
+#+EMAIL: bob@robotics.uk.to
4
+#+KEYWORDS: freedombox, debian, beaglebone, hubzilla, email, web server, home server, internet, censorship, surveillance, social network, irc, jabber
5
+#+DESCRIPTION: Turn the Beaglebone Black into a personal communications server
6
+#+OPTIONS: ^:nil toc:nil
7
+
8
+#+BEGIN_HTML
9
+<center>
10
+<a href="index.html"><img style="max-width: 100%; max-height: 100%; padding: 0; margin: 0; display: block; width:100%; top: 0; left: 0; float:right;" src="images/email.png"/></a>
11
+</center>
12
+<br><br><br><br><br>
13
+#+END_HTML
14
+
15
+#+BEGIN_HTML
16
+<font color="white">.</font> 
17
+#+END_HTML
18
+
19
+| [[Things to be aware of]]                           |
20
+| [[A technical note about email transport security]] |
21
+| [[Add a password to your GPG key]]                  |
22
+| [[Publishing your GPG public key]]                  |
23
+| [[Mutt email client]]                               |
24
+| [[Thunderbird/Icedove]]                             |
25
+| [[K9 Android client]]                               |
26
+| [[Subscribing to mailing lists]]                    |
27
+| [[Adding email addresses to a group/folder]]        |
28
+| [[Ignoring incoming emails]]                        |
29
+| [[Your own mailing list]]                           |
30
+
31
+* Things to be aware of
32
+Even though this system makes it easy to set up an email server, running your own email system is still not easy and this is mainly due to the huge amount of collatoral damage caused by spammers over a long period of time, which in turn is due to the inherent insecurity of email protocols which enabled spam to become a big problem. Email is still very popular though and most internet services require that you have an email address in order to register.
33
+
34
+In using an email address hosted on your own system you will quite likely find that it is blocked and bounced by other popular email systems. Such blocking is almost never based upon any evidence that your system is actually producing spam and usually it's just because your IP address happens to be within a certain range.  Rather arrogantly many of the anti-spam rule sets assume that if an email is sent from an IP address range which is "residential" (i.e. not a company or other organisation) then /it must therefore be spam/.
35
+
36
+So if you want to use your own email address hosted on your own system you do need to be prepared to encounter some difficulties and annoyances. Sadly, often these annoyances will be unsolvable and are not a matter of using different software or configuring things differently.
37
+* A technical note about email transport security
38
+Port 465 is used for SMTP and this is supposedly deprecated for secure email. However, using TLS from the start of the communications seems far more secure than starting off with insecure communications and then trying to upgrade it with a command to begin TLS, as happens with STARTTLS. There are [[https://www.eff.org/deeplinks/2014/11/starttls-downgrade-attacks][possible attacks against STARTTLS]] in which the command to begin secure communications is removed or overwritten which could then result in email being transferred in plain text over the internet and be readable by third parties.
39
+
40
+From http://motherboard.vice.com/read/email-encryption-is-broken:
41
+
42
+#+BEGIN_QUOTE
43
+The researchers also uncovered mass scale attacks of STARTTLS sessions being stripped of their encryption. That attack itself isn't new: internet service providers sometimes do it to monitor users; organizations may use it to keep an eye on employees; or it may come from a malicious actor
44
+#+END_QUOTE
45
+* Add a password to your GPG key
46
+If you didn't use existing GPG keys during the Freedombone installation then you'll need to add a password to your newly generated private key. This is highly recommended. Go through the following sequence of commands to ssh into the Freedombone and then change your GPG password.
47
+
48
+#+BEGIN_SRC bash
49
+ssh username@domainname -p 2222
50
+gpg --edit-key username@domain
51
+passwd
52
+save
53
+quit
54
+exit
55
+#+END_SRC
56
+
57
+Having a password on your GPG key will prevent someone from reading your email /even if your server gets lost or stolen/ or if someone else has physical access to it. Make the password something long and unlikely to be guessable or vulnerable to a brute force [[http://en.wikipedia.org/wiki/Dictionary_attack][dictionary attack]].
58
+
59
+* Publishing your GPG public key
60
+If you havn't already then you should publish your GPG public key so that others can find it.
61
+
62
+#+BEGIN_SRC bash
63
+ssh username@domainname -p 2222
64
+gpg --send-keys username@domainname
65
+exit
66
+#+END_SRC
67
+* Mutt email client
68
+Mutt is a terminal based email client which comes already installed onto the Freedombone. To access it you'll need to access it via ssh with:
69
+
70
+#+BEGIN_SRC bash
71
+ssh username@domainname -p 2222
72
+#+END_SRC
73
+
74
+If you're using Windows there is an ssh client called putty, on Linux just open a terminal and enter the above command with your username and domain name. On Android you can use the ConnectBot app with the hostname *username@domain:2222*
75
+
76
+Once you have logged in via ssh then just type *mutt*. Like most terminal programs mutt is quite easy once you've learned the main keys.
77
+
78
+Some useful keys to know are:
79
+
80
+| "/"    | Search for text within headers                          |
81
+| *      | Move to the last message                                |
82
+| TAB    | Move to the next unread message                         |
83
+| d      | Delete a message                                        |
84
+| u      | Undelete a mail which is pending deletion               |
85
+| $      | Delete all messages selected and check for new messages |
86
+| a      | Add to the address book                                 |
87
+| m      | Send a new mail                                         |
88
+| ESC-m  | Mark all messages as having been read                   |
89
+| S      | Mark a message as spam                                  |
90
+| H      | Mark a message as ham                                   |
91
+| CTRL-b | Toggle side bar on/off                                  |
92
+| CTRL-n | Next mailbox (on side bar)                              |
93
+| CTRL-p | Previous mailbox (on side bar)                          |
94
+| CTRL-o | Open mailbox (on side bar)                              |
95
+| r      | Reply to an email                                       |
96
+| L      | Reply to a mailing list email                           |
97
+| ]      | Expand or collapse all threads                          |
98
+| [      | Expand of collapse the current thread                   |
99
+| CTRL-k | Import a PGP/GPG public key                             |
100
+| q      | Quit                                                    |
101
+
102
+To use the address book system open an email by pressing the enter key on it and then to add the sender to the address list press the A key.  It will ask you for an alias which may be used the next time you want to send a mail.  Alternatively you may just edit the *~/.mutt-alias* file directly to add email addresses.
103
+
104
+One of the most common things which you might wish to do is to send an email.  To do this first press /m/ to create a new message.  Enter the address to send to and the subject, then after a few seconds the Emacs editor will appear with a blank document.  Type your email then press /CTRL-x CTRL-s/ to save it and /CTRL-x CTRL-c/ to exit.  You will then see a summary of the email to be sent out.  Press /y/ to send it and then enter your GPG key passphrase (the one you gave when creating a PGP/GPG key).  The purpose of that is to add a signature which is a strong proof that the email was written by you and not by someone else.
105
+
106
+When reading emails you will initially need to enter your GPG password. It will be retained in RAM for a while afterwards.
107
+
108
+* Thunderbird/Icedove
109
+Another common way in which you may want to access email is via Thunderbird (also known as Icedove on Debian).  This may be especially useful if you're trying to convert former Windows users who may previously have been using some version of Outlook.
110
+
111
+The following instructions should be carried out on the client machines (laptop, etc), not on the BBB itself.
112
+
113
+*** Initial setup
114
+
115
+Install *Thunderbird* and *Enigmail*.  How you do this just depends upon your distro and software manager or "app store".
116
+
117
+Open Thinderbird
118
+
119
+Select "*Skip this and use existing email*"
120
+
121
+Enter your name, email address (myusername@mydomainname.com) and the password for your user.
122
+
123
+You'll get a message saying "/Thunderbird failed to find the settings/"
124
+
125
+The settings should be as follows, substituting /mydomainname.com/ for your domain name and /myusername/ for the username.
126
+
127
+  * Incoming: IMAP, mydomainname.com, 993, SSL/TLS, Normal Password
128
+  * Outgoing: SMTP, mydomainname.com, 465, SSL/TLS, Normal Password
129
+  * Username: myusername
130
+
131
+Click *Done*.
132
+
133
+Click *Get Certificate* and make sure "*permanently store this exception*" is selected", then click *Store Security Exception*.
134
+
135
+From OpenPGP setup select "*Yes, I would like the wizard to get me started*".  If the wizard doesn't start automatically then "setup wizard" can be selected from OpenPGP on the menu bar.
136
+
137
+Select "*Yes, I want to sign all of my email*"
138
+
139
+Select "*No, I will create per-recipient rules*"
140
+
141
+Select "*yes*" to change default settings.
142
+*** Import your GPG keys
143
+On the Freedombone export your GPG public and private keys.
144
+
145
+#+BEGIN_SRC bash
146
+ssh username@domainname -p 2222
147
+gpg --list-keys username@domainname
148
+gpg --output ~/public_key.gpg --armor --export KEY_ID
149
+gpg --output ~/private_key.gpg --armor --export-secret-key KEY_ID
150
+#+END_SRC
151
+
152
+On your laptop or desktop you can import the keys with:
153
+
154
+#+BEGIN_SRC bash
155
+scp -P 2222 username@domain:/home/username/*.gpg ~/
156
+#+END_SRC
157
+
158
+Select "*I have existing public and private keys*".
159
+
160
+Select your public and private GPG exported key files.
161
+
162
+Select the account which you want to use and click *Next*, *Next* and *Finish*.
163
+
164
+Remove your exported key files, both on your laptop/desktop and also on the Freedombone.
165
+
166
+#+BEGIN_SRC bash
167
+shred -zu ~/public_key.gpg
168
+shred -zu ~/private_key.gpg
169
+#+END_SRC
170
+
171
+*** Using for the first time
172
+
173
+Click on the Thunderbird menu, which looks like three horizontal bars on the right hand side.
174
+
175
+Hover over *preferences* and then *Account settings*.
176
+
177
+Select *OpenPGP Security* and make sure that *use PGP/MIME by default* is ticked. This will enable you to sign/encrypt attachments, HTML bodies and UTF-8 without any problems.
178
+
179
+Select *Synchronization & Storage*.
180
+
181
+Make sure that *Keep messages for this account on this computer* is unticked, then click *Ok*.
182
+
183
+Click on *Inbox*.  Depending upon how much email you have it may take a while to import the subject lines.
184
+
185
+Note that when sending an email for the first time you will also need to accept the SSL certificate.
186
+
187
+Get into the habit of using email encryption and encourage others to do so.  Remember that you may not think that your emails are very interesting but the Surveillance State is highly interested in them and will be actively trying to data mine your private life looking for "suspicious" patterns, regardless of whether you are guilty of any crime or not.
188
+
189
+*** Making folders visible
190
+By default you won't be able to see any folders which you may have created earlier using the /mailinglistrule/ script.  To make folders visible select:
191
+
192
+*Menu*, hover over *Preferences*, select *Account Settings*, select *Server Settings* then click on the *Advanced* button.
193
+
194
+Make sure that "*show only subscribed folders*" is not checked.  Then click the *ok* buttons.  Folders will be re-scanned, which may take some time depending upon how much email you have, but your folders will then appear.
195
+
196
+* K9 Android client
197
+*** A point about GPG on Android
198
+Before trying to set up email on Android you may want to consider whether you really need to do this. Android (and its variants) is not a particularly secure operating system and whether or not you wish to store GPG keys on it depends on your threat model and in what situations you'll be using your device.
199
+
200
+If you are going to use email on an Android device then ensure that you have full encryption enabled via the security settings, so that if you subsequently lose it, or if it gets stolen, the chances of encryption keys being exposed are minimised.
201
+*** Compiling the development version
202
+To get K9 working with Freedombone you'll need to install development versions of OpenKeychain and K9. At the time of writing the versions available in F-Droid do not support PGP/MIME or the "hidden recipient" feature of GPG. It is hoped that at some stage the patches will be integrated into the mainline or functionally equivalent changes made. Admittedly, this is not at all user friendly, but currently it's the only way to read Freedombone email on Android systems.
203
+
204
+Build script for OpenKeychain:
205
+
206
+#+BEGIN_SRC bash
207
+mkdir ~/develop
208
+cd ~/develop
209
+git clone https://github.com/bashrc/open-keychain
210
+cd open-keychain
211
+git checkout origin/bashrc/hidden-recipient-minimal
212
+git checkout -b bashrc/hidden-recipient-minimal
213
+cd tools
214
+nano build.sh
215
+#+END_SRC
216
+
217
+Then add the following:
218
+
219
+#+BEGIN_SRC bash
220
+#!/bin/bash
221
+
222
+# This script is intended to be used on Debian systems for building
223
+# the project. It has been tested with Debian 8
224
+
225
+USERNAME=$USER
226
+SIGNING_NAME='openkeychain'
227
+SDK_VERSION='r23.3.4'
228
+SDK_DIR=$HOME/android-sdk
229
+
230
+cd ..
231
+
232
+PROJECT_HOME=$(pwd)
233
+
234
+sudo apt-get install build-essential default-jdk \
235
+     lib32stdc++6 lib32z1 lib32z1-dev
236
+
237
+if [ ! -d $SDK_DIR ]; then
238
+    mkdir -p $SDK_DIR
239
+fi
240
+cd $SDK_DIR
241
+
242
+# download the SDK
243
+if [[ ! -f $SDK_DIR/android-sdk_$SDK_VERSION-linux.tgz ]]; then
244
+    wget https://dl.google.com/android/android-sdk_$SDK_VERSION-linux.tgz
245
+fi
246
+tar -xzvf android-sdk_$SDK_VERSION-linux.tgz
247
+SDK_DIR=$SDK_DIR/android-sdk-linux
248
+
249
+echo 'Check that you have the SDK tools installed for Android 22, SDK 21.1.2'
250
+
251
+export ANDROID_HOME=$SDK_DIR
252
+echo "sdk.dir=$SDK_DIR" > $ANDROID_HOME/local.properties
253
+export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
254
+
255
+cd $SDK_DIR/tools
256
+./android sdk
257
+
258
+if [ ! -f $SDK_DIR/tools/android ]; then
259
+    echo "$SDK_DIR/tools/android not found"
260
+    exit -1
261
+fi
262
+cd $SDK_DIR
263
+chmod -R 0755 $SDK_DIR
264
+chmod a+rx $SDK_DIR/tools
265
+
266
+# android sdk
267
+cd $PROJECT_HOME
268
+git submodule init && git submodule update
269
+
270
+if [ ! -f $SDK_DIR/tools/templates/gradle/wrapper/gradlew ]; then
271
+    echo "$SDK_DIR/tools/templates/gradle/wrapper/gradlew not found"
272
+    exit -2
273
+fi
274
+. $PROJECT_HOME/gradlew assembleDebug
275
+
276
+# cleaning up
277
+cd $PROJECT_HOME/OpenKeychain/build/outputs/apk
278
+if [ ! -f OpenKeychain-debug.apk ]; then
279
+    echo 'OpenKeychain-debug.apk was not found'
280
+    exit -3
281
+fi
282
+
283
+echo 'Build script ended successfully'
284
+echo -n 'apk is available at: '
285
+echo "$PROJECT_HOME/OpenKeychain/build/outputs/apk/OpenKeychain-debug.apk"
286
+exit 0
287
+#+END_SRC
288
+
289
+Save and exit with *CTRL-o*, *CTRL-x*.
290
+
291
+#+BEGIN_SRC bash
292
+chmod +x build.sh
293
+./build.sh
294
+#+END_SRC
295
+
296
+Build script for K9:
297
+
298
+#+BEGIN_SRC bash
299
+cd ~/develop
300
+git clone https://github.com/k9mail/k-9
301
+cd k-9
302
+cd tools
303
+nano build.sh
304
+#+END_SRC
305
+
306
+Then add the following:
307
+
308
+#+BEGIN_SRC bash
309
+#!/bin/bash
310
+
311
+# This script is intended to be used on Debian systems for building
312
+# the project. It has been tested with Debian 8
313
+
314
+USERNAME=$USER
315
+SIGNING_NAME='k-9'
316
+SDK_VERSION='r24.3.3'
317
+SDK_DIR=$HOME/android-sdk
318
+
319
+cd ..
320
+
321
+PROJECT_HOME=$(pwd)
322
+
323
+sudo apt-get install build-essential default-jdk \
324
+     lib32stdc++6 lib32z1 lib32z1-dev
325
+
326
+if [ ! -d $SDK_DIR ]; then
327
+    mkdir -p $SDK_DIR
328
+fi
329
+cd $SDK_DIR
330
+
331
+# download the SDK
332
+if [ ! -f $SDK_DIR/android-sdk_$SDK_VERSION-linux.tgz ]; then
333
+    wget https://dl.google.com/android/android-sdk_$SDK_VERSION-linux.tgz
334
+    tar -xzvf android-sdk_$SDK_VERSION-linux.tgz
335
+fi
336
+SDK_DIR=$SDK_DIR/android-sdk-linux
337
+
338
+echo 'Check that you have the SDK tools installed for Android 17, SDK 19.1'
339
+if [ ! -f $SDK_DIR/tools/android ]; then
340
+    echo "$SDK_DIR/tools/android not found"
341
+    exit -1
342
+fi
343
+cd $SDK_DIR
344
+chmod -R 0755 $SDK_DIR
345
+chmod a+rx $SDK_DIR/tools
346
+
347
+ANDROID_HOME=$SDK_DIR
348
+echo "sdk.dir=$SDK_DIR" > $ANDROID_HOME/local.properties
349
+PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
350
+
351
+android sdk
352
+cd $PROJECT_HOME
353
+
354
+if [ ! -f $SDK_DIR/tools/templates/gradle/wrapper/gradlew ]; then
355
+    echo "$SDK_DIR/tools/templates/gradle/wrapper/gradlew not found"
356
+    exit -2
357
+fi
358
+. $PROJECT_HOME/gradlew assembleDebug
359
+
360
+# cleaning up
361
+cd $PROJECT_HOME/k9mail/build/outputs/apk
362
+if [ ! -f k9mail-debug.apk ]; then
363
+    echo 'k9mail-debug.apk was not found'
364
+    exit -3
365
+fi
366
+echo 'Build script ended successfully'
367
+echo -n 'apk is available at: '
368
+echo "$PROJECT_HOME/k9mail/build/outputs/apk/k9mail-debug.apk"
369
+exit 0
370
+#+END_SRC
371
+
372
+Save and exit with *CTRL-o*, *CTRL-x*.
373
+
374
+#+BEGIN_SRC bash
375
+chmod +x build.sh
376
+./build.sh
377
+#+END_SRC
378
+
379
+*** Import your GPG key into OpenKeychain
380
+With your device connected to a laptop via USB cable and with USB debugging enabled on it:
381
+
382
+#+BEGIN_SRC bash
383
+ssh username@domainname -p 2222
384
+gpg --list-keys username@domainname
385
+gpg --output ~/public_key.gpg --armor --export KEY_ID
386
+gpg --output ~/private_key.gpg --armor --export-secret-key KEY_ID
387
+cat ~/public_key.gpg ~/private_key.gpg > ~/mygpgkey.asc
388
+exit
389
+scp -P 2222 username@domainname:/home/username/mygpgkey.asc ~/
390
+sudo apt-get install android-tools-adb
391
+push ~/mygpgkey.asc /sdcard/
392
+shred -zu ~/mygpgkey.asc
393
+#+END_SRC
394
+
395
+Then on your device select OpenKeychain and import your key from file.
396
+*** Incoming server settings
397
+ * Select settings/account settings
398
+ * Select Fetching mail/incoming server
399
+ * Enter your username and password
400
+ * IMAP server should be your domain name
401
+ * Security: SSL/TLS (always)
402
+ * Authentication: Plain
403
+ * Port: 993
404
+*** Outgoing (SMTP) server settings
405
+ * Select settings/account settings
406
+ * Select Sending mail/outgoing server
407
+ * Set SMTP server to your domain name
408
+ * Set Security to SSL/TLS (always)
409
+ * Set port to 465
410
+ * Set authentication to PLAIN
411
+ * Enter your username and password
412
+ * Accept the SSL certificate
413
+*** Crypto settings
414
+Select *settings*, *Account settings*, *OpenKeychain* and then select your key and press *Allow*. You should now be able to decrypt emails by entering your GPG passphrase.
415
+
416
+You may also want to change the amount of time for which passwords are remembered, so that you don't need to enter your passphrase very often.
417
+*** Folders
418
+To view any new folders which you may have created using the /mailinglistrule/ script from your inbox press the *K9 icon* at the top left to access folders, then press the *menu button* and select *refresh folder list*.
419
+
420
+If your folder still doesn't show up then press the *menu button*, select *show folders* and select *all folders*.
421
+
422
+* Subscribing to mailing lists
423
+To subscribe to a mailing list log in as your user (i.e. not the root user).
424
+
425
+#+BEGIN_SRC bash
426
+ssh username@domainname -p 2222
427
+freedombone-addlist -l <mailing list name> -s <subject tag> -e <list email address>
428
+exit
429
+#+END_SRC
430
+
431
+The subject tag should be the word or phrase which appears within the brackets in the subject line of emails from the mailing list. The mailing list name should be something short so that it is readable within the left side column of the mutt email client, and contain no spaces. You can also use the *freedombone-rmlist* if you wish not to show a particular list within Mutt.
432
+* Adding email addresses to a group/folder
433
+Similar to adding mailing list folders you can also add specified email addresses into a group/folder.
434
+
435
+#+BEGIN_SRC bash
436
+ssh username@domainname -p 2222
437
+freedombone-addemail -e <email address> -g <group name>
438
+exit
439
+#+END_SRC
440
+
441
+The group name should be something short so that it is readable within the left side column of the mutt email client, and not contain any spaces. You can also use the *freedombone-rmemail* command to remove an email address rule.
442
+
443
+* Ignoring incoming emails
444
+It is possible to ignore incoming emails if they are from a particular email address or if the subject line contains particular text.
445
+
446
+#+BEGIN_SRC bash
447
+ssh username@domainname -p 2222
448
+freedombone-ignore -e baduser@baddomain
449
+exit
450
+#+END_SRC
451
+
452
+Or:
453
+
454
+#+BEGIN_SRC bash
455
+ssh username@domainname -p 2222
456
+freedombone-ignore -t "make $$$ now!"
457
+exit
458
+#+END_SRC
459
+
460
+You can also reverse this by using the *freedombone-unignore* command with the same options.
461
+* Your own mailing list
462
+If you want to set up a public mailing list then when installing the system remember to set the *PUBLIC_MAILING_LIST* variable within *freedombone.cfg* to the name of your list. The name should have no spaces in it. Public mailing lists are unencrypted so anyone will be able to read the contents, including non subscribers.
463
+
464
+To subscribe to your list send a cleartext email to:
465
+
466
+#+BEGIN_SRC bash
467
+mymailinglistname+subscribe@domainname
468
+#+END_SRC
469
+
470
+Tip: When using the Mutt email client if you want to send an email in cleartext then press *p* (for PGP) on the sending screen and select *clear*. Unsecure email is treated as being the exception rather than the default.[fn:1]
471
+
472
+[fn:1] Photo by [[https://www.flickr.com/photos/geishaboy500/2326873674/in/photolist-4xBQtC-6uHCJT-oBkgPg-oB7VnC-oBk2Ux-oB7LXS-oB7KeS-bSZiLK-cFssXu-ojQef5-oKRZxL-oKC3Ee-otpoLL-otpDnP-otpCnx-oKBZ4r-otp4U8-oKTLjk-oHRU19-otp3JJ-otp1GB-otoYme-otpcYU-otoXe5-otoWkm-otoVvq-oHRKsh-otoTkJ-otp7zh-otp6du-otp4YA-otp4km-oHRDgj-oHRC3C-otph7x-oHRAf9-otpeqv-otpdun-otoVbq-oKTmrk-oKTkvx-otoRPq-oHRs8N-oKBrSt-otoxTh-otouMX-otoHRG-otoYqF-oKBj28-oKReiy][THOR]], CC BY 2.0

二進制
img/email.png 查看文件


+ 89
- 886
website/EN/usage.html
文件差異過大導致無法顯示
查看文件