Ads by Google

Saturday, August 1, 2009

Emacs 23.1, Gnus and msmtp

After I upgraded my Emacs to the latest version on Windows, I found that my mail sending was not working anymore. And I use msmtp on cygwin to send emails instead of sendmail by subbing the sendmail binary with msmtp.

;;;;dont set this if you use msmtp!!!
;; (setq message-send-mail-function 'smtpmail-send-it)
(setq sendmail-program "/usr/sbin/msmtp")


This has been working for ages without any issues and I had not made any changes to my .gnus file. Baffling.

What's more, the *Messages* buffer kept saying 'Starting Firefox...'

So, I checked whether msmtp was sending emails through the command line. Check. works fine.

Inspected my .gnus file to see whether the paths were pointing to Emacs 22.2 version. Check. Nothing.

There I was, staring at the .gnus buffer wondering what to do next. Maybe debug this? I set
(setq gnus-verbose 9)
(setq gnus-verbose-backends 9)

and try sending again. Nothing in the *Messages* buffer.

I stare some more at .gnus buffer.
;;;;dont set this if you use msmtp!!!
;; (setq message-send-mail-function 'smtpmail-send-it)
;; (setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))

hmmm...dimly I sort of make out message sending is not working. Maybe I better check out the documentation and see what it says.
I hit C-h v on message-send-mail-function and I see

Valid values include `message-send-mail-with-sendmail'
`message-send-mail-with-mh', `message-send-mail-with-qmail',
`message-smtpmail-send-it', `smtpmail-send-it',
`feedmail-send-it' and `message-send-mail-with-mailclient'. The
default is system dependent and determined by the function
`message-send-mail-function'.
See also `send-mail-function'.


I get into the Emacs manual and search for 'send-mail-function'. And I find this

The variable `send-mail-function' controls how the default mail user
agent sends mail. It should be set to a function. In most cases, the
default is `sendmail-send-it', which delivers mail using the Sendmail
installation on the local host. On Mac OS X and MS-Windows, however,
the default is normally `mailclient-send-it', which passes the mail
buffer on to the system's designated mail client (see `mailclient.el').
To send mail through an SMTP server, set `send-mail-function' to
`smtpmail-send-it' and set up the Emacs SMTP library (*note Emacs SMTP
Library: (smtpmail)Top.).

So, that's why it was invoking Firefox! The OS was thinking Firefox was the associated default mail client and Emacs was simply calling that.

So message-send-mail-function was calling message-send-mail-with-mailclient instead of message-send-mail-with-sendmail.

I set
(setq message-send-mail-function 'message-send-mail-with-sendmail)

and now everything is back to normal. Now, if you noticed the Emacs manual talks only about send-mail-function and not message-send-mail-function. But since Gnus uses message.el, it was easy for me to find the correct switches.






Thursday, July 30, 2009

Emacs-23.1 Released

Looks like the tarball is up there but the page is not yet updated and the windows binaries are not there yet.

Get. it. now.

Edit: Announcement here

Thursday, July 9, 2009

Last Pretest Emacs Released

Barring a major bug, the last pretest release of Emacs is out.  The windows binaries are here.

The tentative release date of Emacs 23.1  appears to be July 22. Mark your calendars.


Saturday, July 4, 2009

Quickly looking up words in Google through Emacs

Here is a post by Joe Fineman that outlines how to quickly look up something in Emacs.  You need to have w3m installed for it to work.  And it is indeed easier than switching to the browser and looking it up.

(defun google (what)
"Use google to search for WHAT."
(interactive "sSearch: ")
(save-window-excursion
(delete-other-windows)
(let ((dir default-directory))
(w3m-browse-url (concat "http://www.google.com/search?q="
(w3m-url-encode-string what)))
(cd dir)
(recursive-edit))))

(global-set-key "\C-Cg" 'google)






Wednesday, June 24, 2009

Sourceforge voting has started

As I mentioned in a few of my previous posts here and here, org-mode has been nominated  for the community choice awards 2009.

Well, the voting is now open.  Please vote for org-mode which is under the category 'Most likely to change the way you do everything'.  It hardly takes a minute.

Saturday, June 20, 2009

Another Emacs Pretest is out

A new version of the Emacs Pretest is available for download.  The Windows version can be found here, though it seems you might have to wait a bit, as the binary is not available as of posting.

Tuesday, June 16, 2009

Org video for the SourceForge Commmunity Choices Award 2009

In case you didn't know, org-mode has been shortlisted by Sourceforge for community choice award.  In the course of submission, the org-mode developers and users produced a video that showcases orgmode.

The youtube video is here.
Org-mode presentation

Maybe this will convince you to use orgmode?

Wednesday, June 10, 2009

A damn good introduction to org-mode

I'll have to second Carsten here on the awesome new tutorial on all things org by Bernt Hansen.  In Carsten's own words

If you are serious about using Org-mode to get organized, this is simply an awesome resource of ideas, customization snippets, tips and tricks.  I am learning looking at that, too.
And that's from the creator of org-mode!

it's just fantastic.  Give it a read or better still, take a printout and curl up with it.


Monday, June 8, 2009

Deleting mail source files in Gnus

When Gnus fetches mail, it typically stores them as Incomingxxxxxx files under ~/Mail directory and then splits it into nnml or nnfolder depending on your backend preferences.  If you fetch mail frequently, there will be lots of such files under the Mail directory.  One reason why these files exist is, in the rare case you corrupt some recent email or delete it accidently, it can still be retrieved by checking the Incoming files.

However if you want to delete them, you could set the following and it will automatically delete them after 2 days.  You could set it to any number you wish.

(setq mail-source-delete-incoming 2)
(setq mail-source-delete-old-incoming-confirm nil)


More information about other customisation options can be found at the node Mail Source Customization in the Gnus Manual.



Monday, June 1, 2009

Firefox users flip out over sneak MS add-on

This is certainly not going to go down well, is it?  Basically, Microsoft is supposedly pushing an add on that users cannot uninstall and probably not want in the first place.

The last paragraph alone is enough to make people think more about switching to Linux.

Methinks, there might be a lawsuit in the offing.