Mutt, Exim4, Debian, Unbuntu and BCC. FAIL [fix included].

| No Comments

Take a default Ubuntu/Debian install using the Mutt mail client (MUA) then switch to exim4.

You get the most monumental FAIL - your bcc addresses will be included in the message to everyone else. Dangerous and embarrassing!

Happily there is a fix, but it seems insane that you should even need it. Read on for details.

Goal

  • The bcc header saved in Mutt’s Sent folder
  • but removed from emails that are actually sent.

Background

Mutt by default doesn’t remove bcc: headers. It will remove them if you set

write_bcc=no

but then mutt also removes the bcc header from the copy saved in your Sent folder.

When you later want to check who you sent that message to, anyone bcc’d will be lost from your historical archive.

exim by default doesn’t remove bcc: headers either. It will if it’s called with the -t switch.

You can do this in your muttrc:

set sendmail="/usr/sbin/sendmail -oem -oi -t"

You can find your current setting from within mutt with:

:set ?sendmail

However exim’s default behaviour is then to remove any addresses that are passed on the command line.

Guess what Mutt does? Passes all the addresses on the command line.

So telling mutt to use -t with sendmail results in exim thinking you’re trying to send the message to precisely nobody. No email sent.

Setting the following exim main configuration option:

extract_addresses_remove_arguments = false

reverses exim’s behaviour in this regard and augments the list of addresses rather than removing them.

Happily it also appears to de-dupe rather than sending the same message twice to each address. But dear me, this is fscked up. Is mutt+exim really that odd a choice?

Summary

For Debian or Ubuntu, edit /etc/exim4/conf.d/main/01_local_bcc so that it contains:

extract_addresses_remove_arguments = false

Then set its permissions

sudo chown root:root /etc/exim4/conf.d/main/01_local_bcc

and restart exim

sudo /etc/init.d/exim4 reload

Then, add the following line to your .muttrc and restart Mutt

set sendmail="/usr/sbin/sendmail -oem -oi -t"

Leave a comment

About this Entry

This page contains a single entry by snork published on April 28, 2009 8:11 PM.

Comments are now working again was the previous entry in this blog.

Apple Airport Extreme Syslog to a Linux / Debian / Ubuntu box is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.