This blog will contain tips and recommendations for software and anything else catching my fancy

01 March 2010

64 Bit Opera and Java in Linux

In the past I've had some troubles with 64bit Opera and Java, not playing like nice kids do, so here is a quick fix (and as far as I know the -only- clean way to fix).

Go to the directory:

cd /opt/sun-jdk-version.number/jre/lib/amd64

Then create a symbolic link:

ln -s server/libjvm.so

This has to be done as root.

Restart your browser, and witness the Java-magic unfold :-)

22 February 2010

Signatures, GnuPG and Mutt

Well, just to round off the introduction to Mutt we will be looking at signatures and signing and encryption of emails. Luckily these are extremely easy :-)

First, we assume you have no GPG key (but have GnuPG installed), so let's start by creating one :-)

Now that that's done. Let's get on with Mutt :-)

Simply copy the gpg.rc (can be in a compressed format) from /usr/share/doc/gnupg-[whatever version you have installed]/OPENPGP[if this isn't there look for something called gpg or pgp] to your .mutt directory.

Now (unpack and) read the file. Once you've done reading, head over to my github, and have a look at my gpg.rc file.

And there you have it. That's it.

And now, to the signatures.

Make a .signature file (or .sig/.zig whatever makes sense to you anyway) in your .mutt directory open it and write your signature.
If you write:
"Best Regards John Doe" then it'll appear as
"--
Best Regards John Doe".

Now open your .muttrc and add the line:

set signature=~/.mutt/.signature

and there you go. It should work :-)

On an endnote. Compare your .muttrc file with mine as I'll be having it heavily documented and update it from time to time (there are some updates today compared to yesterday for instance).

This is what I have to say abotu mutt for now, but there may of course come more posts :-)

21 February 2010

Mutt and multiple imap accounts

Okay well as promised, I figured out the syntax for multiple accounts. And now, I present you with, the ultimate multiple imap account settings!

Okay, well let's dive into it.

We still need to set the configurations for the last post, as you have to have one account that you can see the tree of. Choose which one, but once you're done choosing you should have something akin to this:


set imap_user="user1@domain"
set imap_pass="pass1"
set from = "mail1"
set realname = "Your name"
set folder = "imap[s]://imapserver:port"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set record = imap[s]://imapserver/Sent
set smtp_url="smtp://user1@smtp.gmail.com:port/"
set smtp_pass="pass1"


Now that we have that settled, let's get on with the actual configuration :-)

First we need to set the mailboxes we want to connect to:


mailboxes 'imaps://user1@domain1@imapserver:port/mailbox' \
'imaps://user2@domain2@imapserver2:port/mailbox' \


At the very least you'll want those two, I personally also set Drafts and Sent to the one where I don't have the tree set up, that way I can always access my inbox/drafts/sent folders.

Now we'll work with some folder hooks, appearently you should also be able to work with account hooks but they don't really want to give me a working configuration, so I'm just using folder hooks, if you want/need account hooks you should however check out the links in the bottom of this post.
Anyway, the folderhooks:


folder-hook imaps://user1@domain1@imapserver1:port ' \
set from="user1@domain1" \
realname = "Your name" \
imap_user="user1@domain1" \
imap_pass="Pass1" \
smtp_url="smtp://user1@smtpserver1:port" \
smtp_pass = "Pass1" \
spoolfile = "+INBOX" \
record="+[Gmail]/Sent Mail" \
postponed="+[Gmail]/Drafts"'


It pretty much explains itself, and then you do the same for the second account:


folder-hook imaps://user2@domain2@imapserver2:port ' \
set from="user1@domain2" \
realname = "Your name" \
imap_user="user1@domain2" \
imap_pass="Pass1" \
smtp_url="smtp://user2@smtpserver2:port" \
smtp_pass = "Pass1" \
spoolfile = "+INBOX" \
record="+[Gmail]/Sent Mail" \
postponed="+[Gmail]/Drafts"'


And that's it. You should have a working mutt config now with two different imap accounts that you can switch between with c.

And here are the links for the account hooks:
Mutt Guide - Imap
Mutt user story
Mutt manual - Imap
My Mutt configurations

19 February 2010

Mutt and Imap

Well, my first entry. And about a tui mail application no less!

I've been looking for a while for a good email client after moving from KDE to Openbox, and I recently discovered Mutt. And I love it. It is intuitive and fast once you have it configured.

It took me some time to find some good resources on how to configure it properly with imap. But let's get into configuring.

Now there are several ways to configure Mutt, but here we'll focus on imap, with Mutt letting Gmail handle the outgoing mail, and let Mutt read the ingoing.
By the end of this post you should have a working mail account in Mutt. Well let's get into it.

By now I assume you have Mutt installed the following options: sasl, ssl, smtp, and imap. And you'll probably want to install urlview as well, but we'll get back to this in a bit.

But before we dive into the .muttrc, we need to create some directories and files:

mkdir -p ~/.mutt/cache
touch certificates


Only create the certificates file if you're using ssl.

First I suggest we set the editor command:

set editor = 'emacs'

As you've probably guessed, this is the editor in which you'll be writing new mails and replies. Exchange "emacs" with your favourite editor.

Now we all have people we mail with often, and people that should be in our addressbook, and fear not! We can add an addressbook!
Simply create the file .mutt-alias (it doesn't matter where you put it as we'll be directing .muttrc to it, I keep mine in my .mutt directory)

Now direct your .muttrc to the addressbook file

source /path/to/.mutt-alias
set alias_file = /path/to/.mutt-alias


You add contacts with by pressing "a" in a message.

If you're subscribing to any mailing lists (or there are a group of people that you want to put together as one entity) then add this:

lists address [name]
subscribe address [list mail address]


Repeat for each list.

And now to the configuring of the email accounts!


# Name, password and such
set from = "email-address"
set realname = "The name you want displayed"
set imap_user = "your username"
set imap_pass = "password"


Time to look at the folders :-)

# Remote folders
set folder = "imap[s]://server:port"


We tell Mutt that the folders it is to edit are. Furthermore the [s] option in imap is in case you need ssl/tls encryption for the server.

set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set record = imap[s]://server/Sent


The spoolfile, is (as I understand it) your inbox.
I'm leaving the set postponed value with the +[Gmail] for example, this can be edited to +[Whatever domain]
Set record isn't strictly necessary, but I like it. If the domain hosting your email address doesn't save the outgoing messages, I'd recommend it. If it does save the outgoing messages, it's unnecessary really.

On to the local files (yes there are some of those as well ;-) )

# Local folders
set header_cache = ~/.mutt/cache/headers


The file for a cache of headers, users with "uncommon" characters in your language (read other than English) will need to look at this later.

set message_cachedir = ~/.mutt/cache/bodies

Surprise surprise, a cache for the message bodies

set certificate_file = ~/.mutt/certificates

This is where the necessary certificates will be saved.

And finally configuring the outgoing mail

# Outgoing/SMTP
set smtp_url="smtp[s]://username@outgoingserver:port/"
set smtp_pass = "password"


Now an option that I'm betting you want is

set move = no

This prevents Mutt from moving the mails from your inbox.

Well, this is pretty straightforward. smtp url and password. The password isn't necessary, and if you prefer to type it in every time (more secure obviously) then just omit the line.

Now for all of those using a non-english keyboard, and have need to be able to see special characters you need to set the character set as well as make sure your LC_CTYPE is set correctly. In my .muttrc I have:

set charset=ISO-8859-1

and setting LC_CTYPE is done by export LC_CTYPE="the proper setting" Mine is set to
LC_CTYPE=en_US.ISO_8859-1

So in my case I had to write:

export LC_CTYPE=en_US.ISO_8859-1

We're almost done with .muttrc. To be able to view urls in your favourite browser you'll need urlview and you'll need to set a macro:

macro pager \cb 'urlview' 'Follow links with urlview'

And just as importantly, the .mailcap file. Again it doesn't matter where it is, as we define the location in .muttrc. The .mailcap file contains the actions that need to be taken by Mutt with the different filetypes you might be mailed, but to begin with we'll just set the variable in .muttrc and return to the .mailcap file later.

set mailcap_path=/path/to/.mailcap

We're almost done with .muttrc, all that's missing are the looks. Mutt is highly configurable and for now I've gotten my colours from Linux Journal (link at the end)

I like having my messages set in threads when applicable, so of course I have:

et sort = threads
set sort_aux = 'last-date-received'


and the sort_aux, simply the order, we want the newest mails first :-)

And now it's time to have a look at .mailcap file:
Here's my .mailcap file, it'll give you an idea on how it's set up, and a link should be enough to get you started:

text/html; lynx -dump %s | more
application/pdf; /usr/bin/xpdf %s
image/jpeg; /usr/bin/comix %s
image/gif; /usr/bin/comix %s
image/png; /usr/bin/comix %s


The only option that might be necessary to explain is the first. That's simply to have lynx convert html to plaintext.

Anyway, here are some links to get a further understanding. (Remember to read the MuttWiki and MuttGuide, there's a lot to pick up)

The Mutt Guide
Mutt Wiki
The Mutt Manual
"Power Up Your E-Mail with Mutt" - Linux Journal

I'll be trying to set up Mutt with more than one imap account. It seems like a lot of the syntax is different, so I'll post a guide as soon as I have it working.

That's it for this time

Zeerak