July 09, 2004
I like to goof around with the email I send to my wife while she is at work. Mainly, I just switch the name her client displays to any number of our inside jokes. Yesterday, I implemented a way for mutt to pick one randomly.
First, I setup the send-hook:
send-hook "~C jenn@email.address" source ~/.mutt/for-jenn
Then, in ~/.mutt/for-jenn:
unmy_hdr From:
my_hdr From: \
`/usr/bin/perl /home/rayners/.mutt/from-names.pl` \
<my-home@email.address>
And, finally, the from-names.pl script:
@names = (
'Name 1',
'Name 2',
'Name 3',
);
print $names[rand @names];
So now whenever I start writing an email to her, the From: line of the email pops up with a different name.
Now, to make sure that normal emails from me are not affected, I placed the following send-hook before the earlier one:
send-hook . source ~/.mutt/from-rayners
And the ~/.mutt/from-rayners file:
unmy_hdr From:
my_hdr From: David Raynes <rayners@rayners.org>
Posted by rayners
| Comments (0)
| TrackBack
January 04, 2004
Normally, I cryptographically sign all my outgoing emails with GnuPG. Unfortunately, Outlook Express does not handle those signature attachments all too well. It has even gone so far as to mark those attachments as unsafe (as relayed to me in a recent email).
So, I have come up with the following additions to my mutt config file to handle this situation:
message-hook ~A "set pgp_autosign"
message-hook "~h 'X-Mailer: Microsoft Outlook Express'" "set nopgp_autosign"
Unfortunately, to make sure this is used, I need to be reading the message when I reply to it, instead of just hitting the reply key in the header list.
True, I could tell mutt to use the old-style cryptographic signatures (with pgp_create_traditional), but I feel like I am trying to make a point here. :)
Posted by rayners
| Comments (3)
| TrackBack
November 06, 2003
Recently I decided to tinker with my email paradigm on my network here at home. I used to run fetchmail on my main machine to gather all the email from my various accounts (passing it through procmail of course). Unfortunately, when I boot into Windows, I completely lose access to my mail. So, I installed dovecot on my extra/server machine, and copied over my fetchmail/procmail setup. Now I can access my email in both operating systems, and using practically any mail client I feel like using (usually mutt, but sometimes evolution or thunderbird).
Unfortunately, the little trick I used to let mutt know about all the mailboxes my procmail recipies create no longer works, as the folders are not physically located on my machine. I could do it manually, but IMAP already allows for something like this with its folder subscibing feature. Mutt supports this somewhat, but not to the extent that I would like (i.e. it can list subscribed folders, but it will not look for new mail in them, which is what I really want). So, I took a few minutes and threw together a quick perl script to list all my subsctibed folders in a mutt-compatible format.
Here's the code:
#!/usr/bin/perl
use Mail::IMAPClient;
my $server = shift;
my $user = shift;
my $pass = shift;
my $imap = Mail::IMAPClient->new (
Server => $server,
User => $user,
Password => $pass,
) or die "Cannot connect to $server as $user: $@";
my @subscribedFolders = $imap->subscribed
or warn "Could not find subscribed folders: $@\n";
map { print " =$_"; } @subscribedFolders;
It is certainly not robust, but it gets the job done for the time being. And besides, it gave me a good excuse to play around with Mail::IMAPClient.
Here is the line in my ~/.muttrc file that uses the script:
mailboxes `/usr/bin/perl ~/imapFolders.pl server rayners mypassword`
Posted by rayners
| Comments (1)
| TrackBack
July 08, 2003
I love procmail. I just spent a few minutes playing around with my ~/.procmailrc file and now any bug reports I get from the MT Plugin Directory Bug Tracker are now placed into ~/Mail/bugs/Project Name.
Here is the relevant portion of my ~/.procmailrc file:
# Catch bug reports from bugs.mt-plugins.org
:0:
* ^From: plugins@mt-plugins\.org
{
:0 B
* ^Proje[ck]t: \/.+
bugs/`echo "$MATCH" | sed -e 's/ /_/g'`
}
And from my ~/.muttrc file to see all those mailboxes:
mailboxes `for file in ~/Mail/bugs/*; do echo -n "=bugs/$(basename $file) "; done`
Update: (2003-06-08 18:14)
Thanks go to Mike for the suggestion. So, here's the updated recipe:
# Catch bug reports from bugs.mt-plugins.org
:0:
* ^From: plugins@mt-plugins\.org
* B ?? ^Proje[ck]t: \/.+
bugs/`echo "$MATCH" | sed -e 's/[^-_A-Za-z0-9]/_/g'`
Posted by rayners
| Comments (0)
| TrackBack