Handle long URLs in mutt

This commit is contained in:
Bob Mottram 2016-11-01 10:46:11 +00:00
parent e5248e8ddb
commit 5c2ab92ec1
3 changed files with 100 additions and 79 deletions

View File

@ -103,6 +103,7 @@ Some useful keys to know are:
| [ | Expand of collapse the current thread |
| CTRL-k | Import a PGP/GPG public key |
| v | View current email in different formats, such as HTML |
| CTRL-u | View long URLs |
| q | Quit |
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.
@ -111,6 +112,8 @@ One of the most common things which you might wish to do is to send an email. T
When reading emails you will initially need to enter your GPG password. It will be retained in RAM for a while afterwards.
There is one irksome thing about email within mutt, and that's if you get sent a confirmation with a very long URL. It's usually not possible to view URLs which span over multiple lines, and trying to copy/paste them is annoying. A solution is to use /CTRL-u/ then select the url and press Enter. You can then navigate to it via the lynx browser.
* Thunderbird/Icedove
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.

View File

@ -239,7 +239,7 @@ function email_client {
if [[ $(is_completed $FUNCNAME) == "1" ]]; then
return
fi
apt-get -yq install mutt-patched lynx abook
apt-get -yq install mutt-patched lynx abook urlview
if [ ! -f /etc/Muttrc ]; then
echo $"ERROR: Mutt does not appear to have installed. $CHECK_MESSAGE"
@ -264,6 +264,10 @@ function email_client {
echo 'set spoolfile="~/Maildir"' >> /etc/Muttrc
echo 'auto_view text/x-vcard text/html text/enriched' >> /etc/Muttrc
echo 'set header_cache="+.cache"' >> /etc/Muttrc
echo 'set markers=no' >> /etc/Muttrc
echo '' >> /etc/Muttrc
echo '# ctrl-u to view long URLs' >> /etc/Muttrc
echo 'macro pager \cu <pipe-entry>"urlview"<enter> "Follow links with urlview"' >> /etc/Muttrc
echo '' >> /etc/Muttrc
echo 'macro index S "<tag-prefix><decode-save>=.learn-spam<enter>" "move to learn-spam"' >> /etc/Muttrc
echo 'macro pager S "<decode-save>=.learn-spam<enter>" "move to learn-spam"' >> /etc/Muttrc
@ -339,8 +343,13 @@ function email_client {
echo '# Optional relay of SMTP via ISP' >> /etc/Muttrc
echo '#set smtp_url="smtps://username:password@isp_mail_domain:465/"' >> /etc/Muttrc
# For viewing long URLs
echo 'REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]' > /home/$MY_USERNAME/.urlview
echo 'COMMAND lynx -dump -width=78 -nolist %s' >> /home/$MY_USERNAME/.urlview
cp -f /etc/Muttrc /home/$MY_USERNAME/.muttrc
cp -f /etc/Muttrc /etc/skel/.muttrc
cp -f /home/$MY_USERNAME/.urlview /etc/skel/.urlview
touch /home/$MY_USERNAME/.mutt-alias
cp /home/$MY_USERNAME/.mutt-alias /etc/skel/.mutt-alias
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.muttrc

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2016-10-31 Mon 16:24 -->
<!-- 2016-11-01 Tue 10:45 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title>
@ -255,54 +255,54 @@ for the JavaScript code in this tag.
</colgroup>
<tbody>
<tr>
<td class="org-left"><a href="#org130e519">Things to be aware of</a></td>
<td class="org-left"><a href="#orgf390222">Things to be aware of</a></td>
</tr>
<tr>
<td class="org-left"><a href="#org7e9200e">A technical note about email transport security</a></td>
<td class="org-left"><a href="#orgffdc116">A technical note about email transport security</a></td>
</tr>
<tr>
<td class="org-left"><a href="#org1812103">Add a password to your GPG key</a></td>
<td class="org-left"><a href="#org228d2f2">Add a password to your GPG key</a></td>
</tr>
<tr>
<td class="org-left"><a href="#org93517c9">Publishing your GPG public key</a></td>
<td class="org-left"><a href="#org249b852">Publishing your GPG public key</a></td>
</tr>
<tr>
<td class="org-left"><a href="#orge53c55f">Mutt email client</a></td>
<td class="org-left"><a href="#org9aa5b3b">Mutt email client</a></td>
</tr>
<tr>
<td class="org-left"><a href="#org0438041">Thunderbird/Icedove</a></td>
<td class="org-left"><a href="#orgd5df7da">Thunderbird/Icedove</a></td>
</tr>
<tr>
<td class="org-left"><a href="#org9995c75">K9 Android client</a></td>
<td class="org-left"><a href="#org746ae3d">K9 Android client</a></td>
</tr>
<tr>
<td class="org-left"><a href="#org9c582ce">Subscribing to mailing lists</a></td>
<td class="org-left"><a href="#orge7d90d2">Subscribing to mailing lists</a></td>
</tr>
<tr>
<td class="org-left"><a href="#org86cf280">Adding email addresses to a group/folder</a></td>
<td class="org-left"><a href="#org7a22eb8">Adding email addresses to a group/folder</a></td>
</tr>
<tr>
<td class="org-left"><a href="#orgf44b5ff">Ignoring incoming emails</a></td>
<td class="org-left"><a href="#orgf579e55">Ignoring incoming emails</a></td>
</tr>
<tr>
<td class="org-left"><a href="#org681a4ed">Your own mailing list</a></td>
<td class="org-left"><a href="#orgf2e8d68">Your own mailing list</a></td>
</tr>
</tbody>
</table>
<div id="outline-container-org130e519" class="outline-2">
<h2 id="org130e519">Things to be aware of</h2>
<div class="outline-text-2" id="text-org130e519">
<div id="outline-container-orgf390222" class="outline-2">
<h2 id="orgf390222">Things to be aware of</h2>
<div class="outline-text-2" id="text-orgf390222">
<p>
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.
</p>
@ -316,9 +316,9 @@ So if you want to use your own email address hosted on your own system you do ne
</p>
</div>
</div>
<div id="outline-container-org7e9200e" class="outline-2">
<h2 id="org7e9200e">A technical note about email transport security</h2>
<div class="outline-text-2" id="text-org7e9200e">
<div id="outline-container-orgffdc116" class="outline-2">
<h2 id="orgffdc116">A technical note about email transport security</h2>
<div class="outline-text-2" id="text-orgffdc116">
<p>
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 <a href="https://www.eff.org/deeplinks/2014/11/starttls-downgrade-attacks">possible attacks against STARTTLS</a> 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.
</p>
@ -334,9 +334,9 @@ The researchers also uncovered mass scale attacks of STARTTLS sessions being str
</blockquote>
</div>
</div>
<div id="outline-container-org1812103" class="outline-2">
<h2 id="org1812103">Add a password to your GPG key</h2>
<div class="outline-text-2" id="text-org1812103">
<div id="outline-container-org228d2f2" class="outline-2">
<h2 id="org228d2f2">Add a password to your GPG key</h2>
<div class="outline-text-2" id="text-org228d2f2">
<p>
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.
</p>
@ -357,9 +357,9 @@ Having a password on your GPG key will prevent someone from reading your email <
</div>
</div>
<div id="outline-container-org93517c9" class="outline-2">
<h2 id="org93517c9">Publishing your GPG public key</h2>
<div class="outline-text-2" id="text-org93517c9">
<div id="outline-container-org249b852" class="outline-2">
<h2 id="org249b852">Publishing your GPG public key</h2>
<div class="outline-text-2" id="text-org249b852">
<p>
If you havn't already then you should publish your GPG public key so that others can find it.
</p>
@ -372,9 +372,9 @@ gpg --send-keys username@domainname
</div>
</div>
</div>
<div id="outline-container-orge53c55f" class="outline-2">
<h2 id="orge53c55f">Mutt email client</h2>
<div class="outline-text-2" id="text-orge53c55f">
<div id="outline-container-org9aa5b3b" class="outline-2">
<h2 id="org9aa5b3b">Mutt email client</h2>
<div class="outline-text-2" id="text-org9aa5b3b">
<div class="org-center">
<div class="figure">
@ -518,6 +518,11 @@ Some useful keys to know are:
<td class="org-left">View current email in different formats, such as HTML</td>
</tr>
<tr>
<td class="org-left">CTRL-u</td>
<td class="org-left">View long URLs</td>
</tr>
<tr>
<td class="org-left">q</td>
<td class="org-left">Quit</td>
@ -536,12 +541,16 @@ One of the most common things which you might wish to do is to send an email. T
<p>
When reading emails you will initially need to enter your GPG password. It will be retained in RAM for a while afterwards.
</p>
<p>
There is one irksome thing about email within mutt, and that's if you get sent a confirmation with a very long URL. It's usually not possible to view URLs which span over multiple lines, and trying to copy/paste them is annoying. A solution is to use <i>CTRL-u</i> then select the url and press Enter. You can then navigate to it via the lynx browser.
</p>
</div>
</div>
<div id="outline-container-org0438041" class="outline-2">
<h2 id="org0438041">Thunderbird/Icedove</h2>
<div class="outline-text-2" id="text-org0438041">
<div id="outline-container-orgd5df7da" class="outline-2">
<h2 id="orgd5df7da">Thunderbird/Icedove</h2>
<div class="outline-text-2" id="text-orgd5df7da">
<p>
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.
</p>
@ -551,9 +560,9 @@ The following instructions should be carried out on the client machines (laptop,
</p>
</div>
<div id="outline-container-org05016b6" class="outline-4">
<h4 id="org05016b6">Initial setup</h4>
<div class="outline-text-4" id="text-org05016b6">
<div id="outline-container-org514a92b" class="outline-4">
<h4 id="org514a92b">Initial setup</h4>
<div class="outline-text-4" id="text-org514a92b">
<p>
Install <b>Thunderbird</b> and <b>Enigmail</b>. How you do this just depends upon your distro and software manager or "app store".
</p>
@ -609,9 +618,9 @@ Select "<b>yes</b>" to change default settings.
</p>
</div>
</div>
<div id="outline-container-orgdebce31" class="outline-4">
<h4 id="orgdebce31">Import your GPG keys</h4>
<div class="outline-text-4" id="text-orgdebce31">
<div id="outline-container-org012e13a" class="outline-4">
<h4 id="org012e13a">Import your GPG keys</h4>
<div class="outline-text-4" id="text-org012e13a">
<p>
On the Freedombone export your GPG public and private keys.
</p>
@ -657,9 +666,9 @@ shred -zu ~/private_key.gpg
</div>
</div>
<div id="outline-container-orgf7564a9" class="outline-4">
<h4 id="orgf7564a9">Using for the first time</h4>
<div class="outline-text-4" id="text-orgf7564a9">
<div id="outline-container-org66bb228" class="outline-4">
<h4 id="org66bb228">Using for the first time</h4>
<div class="outline-text-4" id="text-org66bb228">
<p>
Click on the Thunderbird menu, which looks like three horizontal bars on the right hand side.
</p>
@ -694,9 +703,9 @@ Get into the habit of using email encryption and encourage others to do so. Rem
</div>
</div>
<div id="outline-container-org24a2903" class="outline-4">
<h4 id="org24a2903">Making folders visible</h4>
<div class="outline-text-4" id="text-org24a2903">
<div id="outline-container-org83cef94" class="outline-4">
<h4 id="org83cef94">Making folders visible</h4>
<div class="outline-text-4" id="text-org83cef94">
<p>
By default you won't be able to see any folders which you may have created earlier using the <i>mailinglistrule</i> script. To make folders visible select:
</p>
@ -712,12 +721,12 @@ Make sure that "<b>show only subscribed folders</b>" is not checked. Then click
</div>
</div>
<div id="outline-container-org9995c75" class="outline-2">
<h2 id="org9995c75">K9 Android client</h2>
<div class="outline-text-2" id="text-org9995c75">
</div><div id="outline-container-org53d2c8f" class="outline-4">
<h4 id="org53d2c8f">A point about GPG on Android</h4>
<div class="outline-text-4" id="text-org53d2c8f">
<div id="outline-container-org746ae3d" class="outline-2">
<h2 id="org746ae3d">K9 Android client</h2>
<div class="outline-text-2" id="text-org746ae3d">
</div><div id="outline-container-org6bd67f0" class="outline-4">
<h4 id="org6bd67f0">A point about GPG on Android</h4>
<div class="outline-text-4" id="text-org6bd67f0">
<p>
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.
</p>
@ -727,9 +736,9 @@ If you are going to use email on an Android device then ensure that you have ful
</p>
</div>
</div>
<div id="outline-container-org2982cfb" class="outline-4">
<h4 id="org2982cfb">Compiling the development version</h4>
<div class="outline-text-4" id="text-org2982cfb">
<div id="outline-container-org107e90b" class="outline-4">
<h4 id="org107e90b">Compiling the development version</h4>
<div class="outline-text-4" id="text-org107e90b">
<p>
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.
</p>
@ -929,9 +938,9 @@ Save and exit with <b>CTRL-o</b>, <b>CTRL-x</b>.
</div>
</div>
<div id="outline-container-org538ddd9" class="outline-4">
<h4 id="org538ddd9">Import your GPG key into OpenKeychain</h4>
<div class="outline-text-4" id="text-org538ddd9">
<div id="outline-container-org07edce2" class="outline-4">
<h4 id="org07edce2">Import your GPG key into OpenKeychain</h4>
<div class="outline-text-4" id="text-org07edce2">
<p>
With your device connected to a laptop via USB cable and with USB debugging enabled on it:
</p>
@ -955,9 +964,9 @@ Then on your device select OpenKeychain and import your key from file.
</p>
</div>
</div>
<div id="outline-container-org70b9aca" class="outline-4">
<h4 id="org70b9aca">Incoming server settings</h4>
<div class="outline-text-4" id="text-org70b9aca">
<div id="outline-container-orgc17196e" class="outline-4">
<h4 id="orgc17196e">Incoming server settings</h4>
<div class="outline-text-4" id="text-orgc17196e">
<ul class="org-ul">
<li>Select settings/account settings</li>
<li>Select Fetching mail/incoming server</li>
@ -969,9 +978,9 @@ Then on your device select OpenKeychain and import your key from file.
</ul>
</div>
</div>
<div id="outline-container-orge681a5b" class="outline-4">
<h4 id="orge681a5b">Outgoing (SMTP) server settings</h4>
<div class="outline-text-4" id="text-orge681a5b">
<div id="outline-container-org9f01618" class="outline-4">
<h4 id="org9f01618">Outgoing (SMTP) server settings</h4>
<div class="outline-text-4" id="text-org9f01618">
<ul class="org-ul">
<li>Select settings/account settings</li>
<li>Select Sending mail/outgoing server</li>
@ -984,9 +993,9 @@ Then on your device select OpenKeychain and import your key from file.
</ul>
</div>
</div>
<div id="outline-container-orge07f38c" class="outline-4">
<h4 id="orge07f38c">Crypto settings</h4>
<div class="outline-text-4" id="text-orge07f38c">
<div id="outline-container-orgcdec2d3" class="outline-4">
<h4 id="orgcdec2d3">Crypto settings</h4>
<div class="outline-text-4" id="text-orgcdec2d3">
<p>
Select <b>settings</b>, <b>Account settings</b>, <b>OpenKeychain</b> and then select your key and press <b>Allow</b>. You should now be able to decrypt emails by entering your GPG passphrase.
</p>
@ -996,9 +1005,9 @@ You may also want to change the amount of time for which passwords are remembere
</p>
</div>
</div>
<div id="outline-container-org99925ef" class="outline-4">
<h4 id="org99925ef">Folders</h4>
<div class="outline-text-4" id="text-org99925ef">
<div id="outline-container-org5f78e77" class="outline-4">
<h4 id="org5f78e77">Folders</h4>
<div class="outline-text-4" id="text-org5f78e77">
<p>
To view any new folders which you may have created using the <i>mailinglistrule</i> script from your inbox press the <b>K9 icon</b> at the top left to access folders, then press the <b>menu button</b> and select <b>refresh folder list</b>.
</p>
@ -1010,9 +1019,9 @@ If your folder still doesn't show up then press the <b>menu button</b>, select <
</div>
</div>
<div id="outline-container-org9c582ce" class="outline-2">
<h2 id="org9c582ce">Subscribing to mailing lists</h2>
<div class="outline-text-2" id="text-org9c582ce">
<div id="outline-container-orge7d90d2" class="outline-2">
<h2 id="orge7d90d2">Subscribing to mailing lists</h2>
<div class="outline-text-2" id="text-orge7d90d2">
<p>
To subscribe to a mailing list log in as your user (i.e. not the root user).
</p>
@ -1027,9 +1036,9 @@ Select <i>Administrator controls</i> then <b>Email filtering rules</b> then <b>A
</p>
</div>
</div>
<div id="outline-container-org86cf280" class="outline-2">
<h2 id="org86cf280">Adding email addresses to a group/folder</h2>
<div class="outline-text-2" id="text-org86cf280">
<div id="outline-container-org7a22eb8" class="outline-2">
<h2 id="org7a22eb8">Adding email addresses to a group/folder</h2>
<div class="outline-text-2" id="text-org7a22eb8">
<p>
Similar to adding mailing list folders you can also add specified email addresses into a group/folder.
</p>
@ -1044,9 +1053,9 @@ Select <i>Administrator controls</i> then <b>Email filtering rules</b> then <b>A
</p>
</div>
</div>
<div id="outline-container-orgf44b5ff" class="outline-2">
<h2 id="orgf44b5ff">Ignoring incoming emails</h2>
<div class="outline-text-2" id="text-orgf44b5ff">
<div id="outline-container-orgf579e55" class="outline-2">
<h2 id="orgf579e55">Ignoring incoming emails</h2>
<div class="outline-text-2" id="text-orgf579e55">
<p>
It is possible to ignore incoming emails if they are from a particular email address or if the subject line contains particular text.
</p>
@ -1061,9 +1070,9 @@ Select <i>Administrator controls</i> then <b>Email filtering rules</b> then <b>B
</p>
</div>
</div>
<div id="outline-container-org681a4ed" class="outline-2">
<h2 id="org681a4ed">Your own mailing list</h2>
<div class="outline-text-2" id="text-org681a4ed">
<div id="outline-container-orgf2e8d68" class="outline-2">
<h2 id="orgf2e8d68">Your own mailing list</h2>
<div class="outline-text-2" id="text-orgf2e8d68">
<p>
If you want to set up a public mailing list then when installing the system remember to set the <b>PUBLIC_MAILING_LIST</b> variable within <b>freedombone.cfg</b> 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.
</p>