The Lumber Room

"Consign them to dust and damp by way of preserving them"

Posts Tagged ‘ubuntu

Using Gmail with mutt, the minimal way (IMAP update)

with 64 comments

As Gmail has IMAP access, it is fairly trivial to get it working with mutt. First, if you’re on Ubuntu/Debian, run sudo apt-get install openssl mutt to get mutt if you don’t already have it. Then, just put the following lines into your ~/.muttrc:

set imap_user = "username@gmail.com"
set imap_pass = "password"

set smtp_url = "smtp://username@smtp.gmail.com:587/"
set smtp_pass = "password"
set from = "username@gmail.com"
set realname = "Your Real Name"

set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed="+[Gmail]/Drafts"

set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no

Make sure your ~/.muttrc isn’t world-readable; it contains your password. (Alternatively, you can leave them out and mutt will prompt you for the password each time.) Also, if you copy-paste from the above, make sure that you have only “normal” quotes, not “smart quotes” which WordPress might have inserted here into this post.

[Other things I have:

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

ignore "Authentication-Results:"
ignore "DomainKey-Signature:"
ignore "DKIM-Signature:"
hdr_order Date From To Cc

I did not include above to justify the "minimal" :)]

Things work perfectly as you would expect them.
One thing to note is that the full headers will still contain the hostname of the computer you send messages from. I have not figured a way of hiding this, and perhaps it shouldn’t be possible.

The End

If for some reason you want to use POP, read on. And tell me why you would want to use POP. The rest of the post is an old version, which i had written before Gmail supported IMAP.

Old Stuff
There is a guide here, which is the first Google result on searching for the keywords Gmail, mutt and Ubuntu in any order, but I would advise against it: it does too much unnecessary stuff using too many unnecessary programs (okay if you don’t care), and involves putting your username and password in a world-readable file (not okay).

There is a guide here, but that site seems down, and so I guess it’s likely to be down again (a DynDNS domain; could be someone’s house), so putting a (fuller) guide here:

First, run sudo apt-get install openssl mutt

Next, in /etc/ssmtp/ssmtp.conf, put
mailhub=smtp.gmail.com:465
UseTLS=YES

Everything else seems to be optional.

Next, create a shell script with the contents
#!/bin/sh
/usr/sbin/ssmtp -au "gmail-address" -ap "password" $@
and put it somewhere in your path (~/bin/gmailout, say) and make it executable (chmod u+x ~/bin/gmailout, I mean) and make sure only you can read it! (chmod og-r ~/bin/gmailout).

Now in ~/.muttrc, put
set pop_host="pops://username:password@pop.gmail.com:995"
set pop_last
unset pop_delete #Just makes mutt not ask, GMail uses config option
set sendmail="~/bin/gmailout"
set write_bcc=no #Important; sSMTP makes bcc non-blind otherwise

and you’re set (remember to make this world-unreadable too: chmod og-rw ~/.muttrc)

You can start mutt, and hit “G” (uppercase G) whenever you want to fetch mail. Can also put exec fetch-mail in ~/.muttrc to have it happen whenever you start mutt, but I find that irritating.

Problems with POP: Not that everything is perfect. I can’t have other mail-transport-agents like sendmail or postfix installed alongside ssmtp. I can’t figure out how to get my crontab reports sent to root, but they do go into ~/dead.letter :D
Also, with mutt I had the habit of adding a my_hdr bcc: my-email-address so that the mail I send is threaded along with the mail I receive (yaay, like Gmail), but somehow there seems to be simply no way of getting Gmail to give me, through POP, those messages I send using an external client. It’s a quirk [bug!] in the way Gmail implements POP. This I’ve fixed by setting mutt’s fcc to /var/mail/my-username, my mail folder. (Of course, if I were in the habit of moving mail to my mbox, I could fcc to mbox too.)
Apart from that, it works fine!

Written by S

Tue, 2007-07-31 at 02:16:03 +05:30

Debian/Ubuntu: Find out which packages are taking the most space

leave a comment »

There is a package called debian-goodies (that’s what it’s called on Ubuntu as well :-)) which has this utility called dpigs — for telling you which packages are “pigging out” on your system. (So install it with sudo apt-get install debian-goodies, and then run dpigs). This and other utilities, from the description:

 debget       - Fetch a .deb for a package in APT's database
 dpigs        - Show which installed packages occupy the most space
 debman       - Easily view man pages from a binary .deb without extracting
 checkrestart - Help to find and restart processes which are using old
                versions of upgraded files (such as libraries)
 popbugs      - Display a customized release-critical bug list based on
                packages you use (using popularity-contest data)

Nice.

Written by S

Tue, 2007-02-06 at 02:20:17 +05:30

Posted in compknow

Tagged with , ,

Symbol’s function definition is void: outline-font-lock-level

with one comment

Using Emacs and todoo-mode (the todoo library / todoo.el).
I got the message

Symbol’s function definition is void: outline-font-lock-level

whenever I tried to insert a new sub-item (using C-c M-i which is bound to todoo-insert-sub-item) in my TODO file. Searching Google gave someone’s old diary, from which (although it’s in Japanese ;-)) I found that it’s related to Debian bug 244681: emacs-goodies-el: todoo.el doesn’t work at XEmacs21. I’m using GNU Emacs 22.0.92.1 and not XEmacs, though.

Update: Before you try the “fixes” below (and in the comment), try just downloading the latest version from Debian. It appears that this got reported as bug 447760, and got fixed.

Anyway, the fix (I haven’t learnt Emacs lisp, so this may be far from the “best” way to do it):

  1. Open the todoo.el file (M-x find-library RET todoo RET) and find the todoo-insert-sub-item function. (Better, use C-h f todoo-insert-sub-item RET and follow the link.)
  2. Replace (outline-font-lock-level) with a value, like 3 or something. You might also want to do the same in the other place that (outline-font-lock-level) is used — in the function todoo-indent-line
  3. Another solution, if you don’t want to / can’t edit the file (no permissions, for example), might be to define the function (outline-font-lock-level) — put (defun outline-font-lock-level nil 3) somewhere.

    Another solution might be to redefine the function entirely. This requires knowledge that I don’t have, but, for example, making some local transformations, I replaced it with this:

    (defun todoo-insert-sub-item ()
      "Insert a new todoo-sub-item."
      (interactive)
      (goto-char (- (todoo-item-end) 1))
      (insert (concat (make-string todoo-indent-column ? )
                      todoo-sub-item-marker " \n"))
      (backward-char))

    The space after the ? is important.

Written by S

Sun, 2007-02-04 at 20:14:31 +05:30

Amarok: MP3 on Ubuntu 6.06 (or later)

leave a comment »

Update[2007-11-22]: Just go to http://amarok.kde.org/wiki/MP3 for everything. Things should automatically work, anyway.

Old:

To get a working Amarok on Ubuntu 6.06 (“Dapper Drake”), follow these instructions:
http://amarok.kde.org/amarokwiki/index.php/MP3_on_Ubuntu_6.06.

(I created that page, sort of ;-).)

On Ubuntu 5.10 (“Breezy Badger”), follow these instructions:
http://amarok.kde.org/amarokwiki/index.php/MP3_on_Ubuntu_5.10.

For other distros (Fedora, SUSE, BSD) start at http://amarok.kde.org/amarokwiki/index.php/MP3.


Written by S

Sun, 2006-04-16 at 12:29:00 +05:30

Posted in compknow

Tagged with ,

Follow

Get every new post delivered to your Inbox.

Join 75 other followers