Hardware Reference
In-Depth Information
N
Note
Remember that all scripts must be given the execute attribute.
With these simple rules, you can now create user accounts (and consequently e-mail addresses) for each of the
rooms in your house and add scripts to control the lights, appliances, and teakettles, as you see fit.
N You can extend the dictation program we created in Chapter 2 by using the voice recognition macro to start
(and stop) recording.
Note
You can also use a house@ e-mail address to process more complex tasks, such as waiting for a message that
reads “coming home” and then waiting one hour (or however long your commute is) before switching on the teakettle
just ahead of time, as well as the porch and living room lights. This creates a welcoming sight, without wasting any
electricity. Or you could place the .procmailrc scripts on your own e-mail account to watch for messages from
your girlfriend (that are so important they must be replied to immediately, of course!) or on threads that include the
words free and beer , in that order! To stop Procmail from processing this mail and discarding it, you must “clone” the
message before passing it to the recipe by adding a c to the first line. The following example demonstrates this by
making a vocal announcement on receipt of such a mail and sending the original to the inbox:
:0c
* ^From- steev.*
|/usr/bin/play /media/voices/messages/youve-got-mail.wav
Security Issues
As a plain-text method of data transfer, e-mail is often likened to the sending of a postcard rather than a letter, because
its contents (in theory) can be read by any delivery server en route. It is also a public protocol, allowing anyone in the
world to send a message to your server. These two elements combined make it difficult to ensure that no one else is
going to try to e-mail your light switches.
I have taken some basic precautions here, including the following:
u
Nondisclosure of the e-mail address or format
u
A strict command format (an e-mail signature will cause the parse to fail in most cases)
u
No acknowledgment of correct, or incorrect, messages
u
Restricting the sender (albeit primitively)
Again, we've adopted security through obscurity. But, even so, there is still the possibility for hackers to create
mischief. If you are intending to use e-mail as a primary conduit, then it is worth the time and effort to secure it
properly by installing GnuPG, generating certificates for all of your e-mail accounts, and validating the sender using
their public keys. This does mean that new users cannot control the house without first having their key manually
acknowledged by the system administrator. The only time that this method breaks down is when you're unable to
get to a registered e-mail account (when you're on vacation, for example) and you need to send a command from a
temporary address. This is a rare case, however, and it is hoped that anything that serious would be dealt with through
an SSH connection, or you'd have a suitable spare e-mail account configured for such an emergency.
 
Search WWH ::




Custom Search