Software Programming · Emacs Lisp

Mailq modeline display

If you’ve not been following along, you might have missed it: it appears to me that even today, in 2011, mail systems work much better when setup the old way. Meaning with a local MTA for outgoing mail. With some niceties, such as sender dependent relayhost maps.

That’s why I needed M-x mailq to display the mail queue and have some easy shortcuts in order to operate it (mainly f runs the command mailq-mode-flush, but per site and per id delivery are useful too).

Now, I also happen to setup outgoing mail routes to walk through an SSH tunnel, which thanks to both ~/.ssh/config and cssh ( C-= runs the command cssh-term-remote-open, with completion) is a couple of keystrokes away to start. Well it still happens to me to forget about starting it, which causes mails to hold in a queue until I realise it’s not delivered, which always take just about too long.

A solution I’ve been thinking about is to add a little flag in the modeline in my gnus *Group* and *Summary* buffers. The flag would show up as ✔ when no mail is queued and waiting for me to open the tunnel, or ✘ as soon as the queue is not empty. Here’s what it looks like here:

Well I’m pretty happy with the setup. The flag is refreshed every minute, and here’s as an example how I did setup mailq in my el-get-sources setup:

(:name mailq
		:after (lambda () (mailq-modeline-display)))

I’m not sure how many of you dear readers are using a local MTA to deliver your mails, but well, the ones who do (or consider doing so) might even find this article useful!

The Art of PostgreSQL

Second Edition, Updated (2026)

PostgreSQL 10 through 18, a new pgvector chapter, 56 new figures, and a free practice lab.

See what's new →
Dimitri Fontaine
Dimitri Fontaine
PostgreSQL Major Contributor & author of The Art of PostgreSQL