Create email rules only after installing email clients #13

This commit is contained in:
Bob Mottram 2014-03-21 21:56:41 +00:00
parent a1a55386c0
commit 3c3efa2767
1 changed files with 148 additions and 145 deletions

View File

@ -330,6 +330,7 @@ apt-get dist-upgrade
#+BEGIN_SRC: bash #+BEGIN_SRC: bash
dpkg-reconfigure locales dpkg-reconfigure locales
apt-get install keyboard-configuration
#+END_SRC #+END_SRC
You may need to reboot for this to take effect. To verify the change. You may need to reboot for this to take effect. To verify the change.
@ -379,6 +380,8 @@ uname -mrs
The security of encryption depends upon the randomness of the random source used on your system. If it isn't very random then it may be far more vulnerable to cryptanalysis, and it's known that in the past some dubious agencies have encouraged the use of flawed random number generators to assist with their prurient activities. Randomness - typically referred to as /entropy/ - is often gathered from factors such as the timing of key presses or mouse movements, but since the BBB won't have such devices plugged into it this reduces the amount of entropy available. The security of encryption depends upon the randomness of the random source used on your system. If it isn't very random then it may be far more vulnerable to cryptanalysis, and it's known that in the past some dubious agencies have encouraged the use of flawed random number generators to assist with their prurient activities. Randomness - typically referred to as /entropy/ - is often gathered from factors such as the timing of key presses or mouse movements, but since the BBB won't have such devices plugged into it this reduces the amount of entropy available.
*** On the Beaglebone Black *** On the Beaglebone Black
TODO: is this relevant? http://www.reddit.com/r/netsec/comments/1x7ias/sha256_authentication_hardware_rng_and_protected/
Computers can't really generate truly random numbers by themselves, since they're deterministic and so operate in a highly predictable manner. Fortunately, the BBB has an onboard hardware random number generator, which is a physical process which behaves randomly and which can then be read into the computer and stored for later use in encryption algorithms. Computers can't really generate truly random numbers by themselves, since they're deterministic and so operate in a highly predictable manner. Fortunately, the BBB has an onboard hardware random number generator, which is a physical process which behaves randomly and which can then be read into the computer and stored for later use in encryption algorithms.
Information on exactly how the hardware random number generator on the Beaglebone AM335x CPU works [[http://e2e.ti.com/support/arm/sitara_arm/f/791/t/292794.aspx][seems hard to come by]], but we can later use some software to verify that it does indeed produce random numbers and hasn't been deliberately weakened. Information on exactly how the hardware random number generator on the Beaglebone AM335x CPU works [[http://e2e.ti.com/support/arm/sitara_arm/f/791/t/292794.aspx][seems hard to come by]], but we can later use some software to verify that it does indeed produce random numbers and hasn't been deliberately weakened.
@ -1601,151 +1604,6 @@ cp -r /home/myusername/.gnupg ~/
chown -R root:root ~/.gnupg chown -R root:root ~/.gnupg
#+END_SRC #+END_SRC
** Create Email folders and rules
#+BEGIN_VERSE
/Yes, the NSA set fire to the Internet but its the business models of Google, Facebook, etc, that provide the firewood. Trusting the companies supplying the firewood to be your fire fighters is naïve at best./
-- Aral Balkan
#+END_VERSE
*** Rules for mailing lists
A common situation with email is that you may be subscribed to various mailing lists and want incoming email from those to be automatically grouped into a separate folder for each list.
We can make a script to make adding mailing list rules easy:
#+BEGIN_SRC: bash
emacs /usr/bin/mailinglistrule
#+END_SRC
Add the following:
#+BEGIN_SRC: bash
#!/bin/bash
MYUSERNAME=$1
MAILINGLIST=$2
SUBJECTTAG=$3
MUTTRC=/home/$MYUSERNAME/.muttrc
PM=/home/$MYUSERNAME/.procmailrc
LISTDIR=/home/$MYUSERNAME/Maildir/$MAILINGLIST
if [ ! -d "$LISTDIR" ]; then
mkdir -m 700 $LISTDIR
mkdir -m 700 $LISTDIR/tmp
mkdir -m 700 $LISTDIR/new
mkdir -m 700 $LISTDIR/cur
fi
chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR
echo "" >> $PM
echo ":0" >> $PM
echo " * ^Subject:.*()\[$SUBJECTTAG\]" >> $PM
echo "$LISTDIR/new" >> $PM
chown $MYUSERNAME:$MYUSERNAME $PM
if [ ! -f "$MUTTRC" ]; then
cp /etc/Muttrc $MUTTRC
chown $MYUSERNAME:$MYUSERNAME $MUTTRC
fi
PROCMAILLOG=/home/$MYUSERNAME/log
if [ ! -d $PROCMAILLOG ]; then
mkdir $PROCMAILLOG
chown -R $MYUSERNAME:$MYUSERNAME $PROCMAILLOG
fi
#+END_SRC
Save and exit, then make the script executable.
#+BEGIN_SRC: bash
chmod +x /usr/bin/mailinglistrule
#+END_SRC
Now we can add a new mailing list rule with the following, where /myusername/ is your username, /mailinglistname/ is the name of the mailing list (with no spaces) and /subjecttag/ is the tag which usually appears within square brackets in the subject line of emails from the list.
#+BEGIN_SRC: bash
mailinglistrule [myusername] [mailinglistname] [subjecttag]
#+END_SRC
Repeat this command for as many mailing lists as you need. Then edit your local Mutt configuration.
#+BEGIN_SRC: bash
emacs /home/myusername/.muttrc
#+END_SRC
Search for the *mailboxes* variable and add entries for the mailing lists you just created. For example:
#+BEGIN_SRC: bash
mailboxes = =Sent =mailinglistname
#+END_SRC
Then save and exit.
*** Rules for specific email addresses
You can also make a script which will allow you to move mail from specific email addresses to a folder.
#+BEGIN_SRC: bash
emacs /usr/bin/emailrule
#+END_SRC
Add the following:
#+BEGIN_SRC: bash
#!/bin/bash
MYUSERNAME=$1
EMAILADDRESS=$2
MAILINGLIST=$3
MUTTRC=/home/$MYUSERNAME/.muttrc
PM=/home/$MYUSERNAME/.procmailrc
LISTDIR=/home/$MYUSERNAME/Maildir/$MAILINGLIST
if [ ! -d "$LISTDIR" ]; then
mkdir -m 700 $LISTDIR
mkdir -m 700 $LISTDIR/tmp
mkdir -m 700 $LISTDIR/new
mkdir -m 700 $LISTDIR/cur
fi
chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR
echo "" >> $PM
echo ":0" >> $PM
echo " * ^From: $EMAILADDRESS" >> $PM
echo "$LISTDIR/new" >> $PM
chown $MYUSERNAME:$MYUSERNAME $PM
if [ ! -f "$MUTTRC" ]; then
cp /etc/Muttrc $MUTTRC
chown $MYUSERNAME:$MYUSERNAME $MUTTRC
fi
PROCMAILLOG=/home/$MYUSERNAME/log
if [ ! -d $PROCMAILLOG ]; then
mkdir $PROCMAILLOG
chown -R $MYUSERNAME:$MYUSERNAME $PROCMAILLOG
fi
#+END_SRC
Save and exit, then make the script executable.
#+BEGIN_SRC: bash
chmod +x /usr/bin/emailrule
#+END_SRC
Then to add a particular email address to a folder run the command:
#+BEGIN_SRC: bash
emailrule [myusername] [emailaddress] [foldername]
#+END_SRC
If you want any mail from the given email address to be deleted then set the /foldername/ to /Trash/.
To ensure that the folder appears within Mutt.
#+BEGIN_SRC: bash
emacs /home/myusername/.muttrc
#+END_SRC
Search for the *mailboxes* variable and add entries for the mailing lists you just created. For example:
#+BEGIN_SRC: bash
mailboxes = =Sent =foldername
#+END_SRC
Then save and exit.
** Setting up a web site ** Setting up a web site
#+BEGIN_VERSE #+BEGIN_VERSE
@ -2478,6 +2336,151 @@ By default you won't be able to see any folders which you may have created earli
*Menu*, hover over *Preferences*, select *Account Settings*, select *Server Settings* then click on the *Advanced* button. *Menu*, hover over *Preferences*, select *Account Settings*, select *Server Settings* then click on the *Advanced* button.
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. 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.
** Create Email folders and rules
#+BEGIN_VERSE
/Yes, the NSA set fire to the Internet but its the business models of Google, Facebook, etc, that provide the firewood. Trusting the companies supplying the firewood to be your fire fighters is naïve at best./
-- Aral Balkan
#+END_VERSE
*** Rules for mailing lists
A common situation with email is that you may be subscribed to various mailing lists and want incoming email from those to be automatically grouped into a separate folder for each list.
We can make a script to make adding mailing list rules easy:
#+BEGIN_SRC: bash
emacs /usr/bin/mailinglistrule
#+END_SRC
Add the following:
#+BEGIN_SRC: bash
#!/bin/bash
MYUSERNAME=$1
MAILINGLIST=$2
SUBJECTTAG=$3
MUTTRC=/home/$MYUSERNAME/.muttrc
PM=/home/$MYUSERNAME/.procmailrc
LISTDIR=/home/$MYUSERNAME/Maildir/$MAILINGLIST
if [ ! -d "$LISTDIR" ]; then
mkdir -m 700 $LISTDIR
mkdir -m 700 $LISTDIR/tmp
mkdir -m 700 $LISTDIR/new
mkdir -m 700 $LISTDIR/cur
fi
chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR
echo "" >> $PM
echo ":0" >> $PM
echo " * ^Subject:.*()\[$SUBJECTTAG\]" >> $PM
echo "$LISTDIR/new" >> $PM
chown $MYUSERNAME:$MYUSERNAME $PM
if [ ! -f "$MUTTRC" ]; then
cp /etc/Muttrc $MUTTRC
chown $MYUSERNAME:$MYUSERNAME $MUTTRC
fi
PROCMAILLOG=/home/$MYUSERNAME/log
if [ ! -d $PROCMAILLOG ]; then
mkdir $PROCMAILLOG
chown -R $MYUSERNAME:$MYUSERNAME $PROCMAILLOG
fi
#+END_SRC
Save and exit, then make the script executable.
#+BEGIN_SRC: bash
chmod +x /usr/bin/mailinglistrule
#+END_SRC
Now we can add a new mailing list rule with the following, where /myusername/ is your username, /mailinglistname/ is the name of the mailing list (with no spaces) and /subjecttag/ is the tag which usually appears within square brackets in the subject line of emails from the list.
#+BEGIN_SRC: bash
mailinglistrule [myusername] [mailinglistname] [subjecttag]
#+END_SRC
Repeat this command for as many mailing lists as you need. Then edit your local Mutt configuration.
#+BEGIN_SRC: bash
emacs /home/myusername/.muttrc
#+END_SRC
Search for the *mailboxes* variable and add entries for the mailing lists you just created. For example:
#+BEGIN_SRC: bash
mailboxes = =Sent =mailinglistname
#+END_SRC
Then save and exit.
*** Rules for specific email addresses
You can also make a script which will allow you to move mail from specific email addresses to a folder.
#+BEGIN_SRC: bash
emacs /usr/bin/emailrule
#+END_SRC
Add the following:
#+BEGIN_SRC: bash
#!/bin/bash
MYUSERNAME=$1
EMAILADDRESS=$2
MAILINGLIST=$3
MUTTRC=/home/$MYUSERNAME/.muttrc
PM=/home/$MYUSERNAME/.procmailrc
LISTDIR=/home/$MYUSERNAME/Maildir/$MAILINGLIST
if [ ! -d "$LISTDIR" ]; then
mkdir -m 700 $LISTDIR
mkdir -m 700 $LISTDIR/tmp
mkdir -m 700 $LISTDIR/new
mkdir -m 700 $LISTDIR/cur
fi
chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR
echo "" >> $PM
echo ":0" >> $PM
echo " * ^From: $EMAILADDRESS" >> $PM
echo "$LISTDIR/new" >> $PM
chown $MYUSERNAME:$MYUSERNAME $PM
if [ ! -f "$MUTTRC" ]; then
cp /etc/Muttrc $MUTTRC
chown $MYUSERNAME:$MYUSERNAME $MUTTRC
fi
PROCMAILLOG=/home/$MYUSERNAME/log
if [ ! -d $PROCMAILLOG ]; then
mkdir $PROCMAILLOG
chown -R $MYUSERNAME:$MYUSERNAME $PROCMAILLOG
fi
#+END_SRC
Save and exit, then make the script executable.
#+BEGIN_SRC: bash
chmod +x /usr/bin/emailrule
#+END_SRC
Then to add a particular email address to a folder run the command:
#+BEGIN_SRC: bash
emailrule [myusername] [emailaddress] [foldername]
#+END_SRC
If you want any mail from the given email address to be deleted then set the /foldername/ to /Trash/.
To ensure that the folder appears within Mutt.
#+BEGIN_SRC: bash
emacs /home/myusername/.muttrc
#+END_SRC
Search for the *mailboxes* variable and add entries for the mailing lists you just created. For example:
#+BEGIN_SRC: bash
mailboxes = =Sent =foldername
#+END_SRC
Then save and exit.
** Install a Blog ** Install a Blog
#+BEGIN_VERSE #+BEGIN_VERSE