Feb 14

Well, I’ve done it. I’ve printed out the man pages for formail, procmail (it’s supplements) and fetchmail. I’m hoping to have a real understanding of these programs once I actually sit down and start reading.

I have mutt running on my machine and I’m using it to read email for 5 accounts. I have a basic idea of how mail is delivered to my machine and then sorted into folders, but that just isn’t enough for me. I’ve only been half learning things and as a result I feel like a dunce far too often. Starting with this project, I plan to fully understand everything I’m attempting.

Once done (as if learning has an end), I want to be able to explain what I’ve picked up with a few blog posts and hopefully help others who may stumble upon my writings get started with mail management.

Wish me luck.  I PROMISE to recycle if I ever get rid of these printouts.

written by M@ \\ tags:

Feb 11

I’ve been a terrible blogger lately. I’ve been so wrapped up in mutt and my email that I just haven’t had time for anything else. I’ve realized that if you’ve always been a GUI mail client user on Windows and somebody else manages your mail for you (i.e. your admin or ISP) that you may not know ANYTHING about email. I’m not even talking about transporting messages from machine to machine, just spend some time studying mail headers. There’s a LOT to them.

I’m using (evaluating?) procmail to do some mail sorting on my personal machine. Without going into detail (because at this point I simply can’t), procmail parses my email messages as they’re delivered and if one of my procmail recipes matches one of the headers in the message it moves it to a specific folder. It can do more than that, but I just haven’t gotten that far in my explorations.

What’s nice is I don’t have to use just the standard mail headers like to, cc & from to sort mail into folders. Many lists (sadly, not all) insert all sorts of terrific headers when a message is forwarded to subscribers. As an example, this is a chunk of headers from a full disc encryption list that I monitor.

X-BeenThere: fde [AT] www.xml-dev.com
X-Mailman-Version: 2.1.8
Precedence: list
Reply-To: fde [AT] www.xml-dev.com
List-Id: <fde.www.xml-dev.com>
List-Unsubscribe: <http://www.xml-dev.com/mailman/listinfo/fde>,
<mailto:fde-request [AT] www.xml-dev.com?subject=unsubscribe>
List-Archive: <http://www.xml-dev.com/pipermail/fde>
List-Post: <mailto:fde [AT] www.xml-dev.com>
List-Help: <mailto:fde-request [AT] www.xml-dev.com?subject=help>
List-Subscribe: <http://www.xml-dev.com/mailman/listinfo/fde>,
<mailto:fde-request [AT] www.xml-dev.com?subject=subscribe>

There’s a lot there, this list makes it easy for you to check archives, get help and unsubscribe just by reviewing the mail headers. It also inserts an X-BeenThere header that I use to sort on (I wish they all did, it would make sorting MUCH easier). Since that header is on every message from the list, I created a simple procmail recipe (below) that will move messages with that header into the “seclists” mail folder.

:0:
* ^X-BeenThere: fde [AT] www.xml-dev.com
$MAILDIR/seclists/

That’s just a simple example, but handy none-the-less. So that’s what I’ve been up to. Checking mail headers and learning how to manage my mail myself.

written by M@ \\ tags:

Jan 09

OK, this IS Linux related, in the way that you can run Thunderbird on Linux. I just thought this was pretty cool and I had a need for it. I recently joined the WFTL-LUG (how many times I type WTFL by the end of this who can even guess), which is a global Linux Users Group. While I have a real, physical LUG in my area, I’ve found the topics to be a little too technical for the beginner (to my dismay). Since I want to hear about the experiences of others and maybe even offer some tidbits of advice myself, I want to be involved in something with a good amount of Linux chatter. If something like this interests you, check out the link above. Not only is the LUG hella useful, but the site itself (http://www.marcelgagne.com) has a lot of great information. Thanks go to Jon Watson for directing me to the LUG.

What I wanted was a second (or third) gmail account that I could use just for the WFTL-LUG, and I wanted to be able to manage it in Thunderbird from two locations; work and home. Since there’s no IMAP for gmail, and I’m personally not ready to run an IMAP server on my own, I decided to enable POP on the account, grab the mail, and store it locally. This was a great idea until I remembered that once the email was downloaded into one mail client, the second client wouldn’t see those messages and they wouldn’t be downloaded. Well, this wasn’t going to work, I would either have to use one client, or worry about having some mail in one location and some in another. I can’t be the only one that has this problem. I googled for a solution and came up with “recent mode”. It works like this; you change the username (I did it on both mail clients, but one should have been enough) to recent:username@gmail.com. This retrieves all messages received in the last thirty days whether it’s been collected by another POP client or not. The exact wording for it is here.

Now I only need to worry about marking messages/threads read when I get home. Just thought I’d share as it saved me a headache :)

written by M@ \\ tags: , , ,

Nov 13

I’ve been working on backing up my home directory automatically, generally when I automate a process I like to get an email notification of completion and perhaps a log file as proof. Ubuntu doesn’t seem to have a command line mailer installed by default and many of the apps in the repos have heavy dependencies (such as exim or postfix). I don’t plan on running a mail server, and these programs add a level of complexity that just isn’t necessary (not to mention I’m just not ready to mess with them). I found a small script that does exactly what I need, sendEmail. It’s only dependency is perl and that should already be installed on your system.

sendEmail -f [from address] -t [to address] [another to address] -u ['subject'] -m ['body'] -a [attachment] -s [your SMTP server]

As the example above shows, you simply call the script, specify your from address, specify the to address (one or many), define a subject and body (if you are including spaces in the subject or body wrap them in quotes), attach a file if you like, and then give it the address of your SMTP server (which was provided to you by your ISP). It’s just that simple and it just works.

I couldn’t locate sendEmail in the Fedora repos (Ubuntu has it in the Universe repo) but it’s VERY easy to install yourself. Download the official release from http://caspian.dotconf.net/menu/Software/SendEmail/ to your home directory, then enter the commands below.

Note: At the time of this writing the current version is 1.54 and the downloaded filename is sendEmail-v1.54.tar.gz. The filename may change later so you’ll have to adjust the commands below accordingly. You will need the root password to install this script to the locations below.

Open a terminal window and go to your home folder (or the location of the downloaded file)

su -c ‘tar -xzvf sendEmail-v1.54.tar.gz -C /usr/lib/’
su -c ‘ln -s /usr/lib/sendEmail-v1.54/sendEmail /usr/bin/’

The first command will extract the files to /usr/lib/sendEmail-v1.54/. The second command just creates a symbolic link in /usr/bin/ that will allow you to call sendEmail from the command line. For those interested, su -c switches user to root, executes the command following the -c and then returns you to your normal user level. I tend to use this method so I don’t forget to log out of the root account and accidentally break something.

written by M@ \\ tags: , , , ,