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>
Leave a comment