July 09, 2004

Random Names in Mutt

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:

#!/usr/bin/perl

@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

June 14, 2004

Turning Off Auto Ignore

While I was speaking with Joi on IRC today, BitchX kept ignoring him (in all honesty though, he was pasting some stuff into messages to me, so they were coming in pretty quick). Anyways, after some digging, I found an undocumented command for turning off auto-ignore for a given nick:

/addnoflood nickname

Unfortunately, it appears that setting is not saved with the /save command, so I will need to add it to my ~/.bitchxrc file.

Posted by rayners | Comments (0) | TrackBack

June 03, 2004

Fun with BitchX

I have been on IRC quite a bit lately, and I have been having some fun getting my current client, BitchX, working nicely. I have not done too much so far, but I have got a few more tricks up my sleeve.

First of all, the following in my ~/.bitchxrc file automatically validates me with NickServ on Freenode and Wyldryde:

 # My "passwords"
assign FREENODE_PASSWORD password
assign WYLDRYDE_PASSWORD password

 # Command to register with NickServ
 # Sending the appropiate password to the network

alias nsreg {
    userhost NickServ -cmd {
        if ( rmatch($3@$4 NickServ@services.) ) {
            echo NSREG: Sending FreeNode Credentials
            ^msg nickserv identify $FREENODE_PASSWORD
        }
        if ( rmatch($3@$4 services@wyldryde.net) ) {
            echo NSREG: Sending WyldRyde Credientials
            ^msg nickserv identify $WYLDRYDE_PASSWORD
        }
    }
}

 # Catch the notice from NickServ that the nick is registered

on ^notice 'NickServ This nickname is \\[owned registered\\]*' {
    ^nsreg
}

And finally, since there are many people who refer to me without using my nick (rayners), I put in the following code to catch other words and highlight those messages:

assign AR_WORDLIST david raynes dave rayners

on ^public '% % *\\[$AR_WORDLIST\\]*' {
        echo $fparse(PUBLIC_AR "" $0 "" $2-)
}

I will probably add some more words later, but that is working well enough so far.

Posted by rayners | Comments (0) | TrackBack

January 04, 2004

Teaching Mutt about the wonders of Microsoft

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

December 30, 2003

FreeBSD and Subversion

After having some weird hang-ups in Subversion today, I tracked down a question and answer in the FAQ:

On FreeBSD, certain operations (especially svnadmin create) sometimes hang. Why?

This is usually due to a lack of available entropy on the system. You probably need to configure the system to gather entropy from sources such as hard-disk and network interrupts. Consult your system manpages, specifically random(4) and rndcontrol(8) on how to effect this change.

I was not sure initially if that was the problem I was having (mostly it was the mentioning of svnadmin create that threw me off). The thing was that everything was working fine on my server machine, which has almost the exact same setup as my personal machine. Commits were working just fine on the server, and hanging on my machine. Eventually, after futzing around with a few other thoughts, I decided to give it a try.

So, I read the rndcontrol manpage, and it said that:

Then I look at my dmesg output and discovered that my ethernet card was sitting on IRQ 11, so that is what I handed off to rndcontrol. Suddenly, things were working just fine again.

Minor Update (2003-12-31 09:58)

I forgot to mention the config file changes I made when I finally got all this working. I just added the following to my /etc/rc.conf file:

rand_irqs="11"

Posted by rayners | Comments (1) | TrackBack

November 06, 2003

Bringing Mutt and IMAP a little closer together

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 23, 2003

Sorting Mailing Lists with Procmail

Bill writes about the usefulness of list header metadata, so I thought I'd put up the procmail recipies I use to catch mailing list emails.


 # Yahoo Groups
 # (e.g. Mailing-List: list mt-dev@yahoogroups.com)
:0:
* ^Mailing-List: list \/[^@]+
lists/$MATCH

 # Mailman and other intelligent software lists
 # (e.g. List-Post: <mailto:Pluginmanager-l@rayners.org>)
:0:
* ^List-Post: \<mailto:\/[^@]+
lists/$MATCH

 # Other list software?
 # (e.g. X-Mailing-List: <ftjava-test@firedrake.org>)
:0:
* ^X-Mailing-List: \<\/[^@]+
lists/$MATCH

 # Mojo Lists
 # (e.g. List: lug)
:0:
* ^List-Software: Mojo Mail
* ^List: \/[^@]+
lists/$MATCH

 # ListProc (all those UMBC lists)
 # (e.g. Sender: owner-umbclinux@listproc.umbc.edu)
:0:
* ^Sender: owner-\/[^@]+
lists/$MATCH

 # More lists (realms-l)
 # (e.g. From owner-realms-l@ORACLE.WIZARDS.COM)
:0:
* ^From owner-\/[^@]+
lists/$MATCH

Most of the mailing list software out there adds the headers and I can catch them relatively easily. With others, however, I have to do a little digging. And the realms-l list drives me insane. Here's how it identifies itself within the email:

Sender: The Forgotten Realms Mailing List <REALMS-L@ORACLE.WIZARDS.COM>

I suppose I could look for that specifically, but that's exactly the point. I shouldn't have to write filters for specific mailing lists. It defeats the whole purpose of putting the list data in the email headers.

Anyways, for all you procmail/regexp experts out there, how do you think I could handle this odd case:

Sender: port-sgimips-owner@NetBSD.org

Posted by rayners | Comments (2) | TrackBack

July 08, 2003

Filtering Bug Reports from the MT Plugin Directory Bug Tracker

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

SubCategories

Archives:

Feeds:

Entry List