symlink > writings > journal > 2009

Journal posts (2009)

dovecot --exec-mail and dotlock

(Of course, the real solution is to forget about /var/mail and use Maildir or dbox. – 2014‑08‑22)

To speed up mail checks, I access Dovecot imapd at my server through a SSH tunnel, which executes [dovecot --exec-mail imap] over the (multiplexed) SSH connection.

Being launched like this, Dovecot doesn't have the necessary access to create dotlock files in /var/mail, where my inbox is stored. (Usually Dovecot's imap-login process would start imap as root, and then it would switch itself to the group set in mail_privileged_group when necessary.) So I get a ton of messages like this:

IMAP(grawity): file_dotlock_create(/var/mail/grawity) failed: Permission denied (euid=1000(grawity) egid=100(users) missing +w perm: /var/mail) (set mail_privileged_group=mail)

...resulting in “Mutt: Mailbox readonly” warnings every time I try to delete something.

It would be possible to change the permissions of /var/mail to 01777 (sticky, read/write/execute for everyone), but this feels a little insecure compared to the default 02775 root:mail.

The solution is to give /usr/lib/dovecot/imap access to the mail group using the setgid bit:

chown :mail /usr/lib/dovecot/imap
chmod g+s /usr/lib/dovecot/imap

If you're using a Debian-based distro:

dpkg-statoverride --update --add root mail 2755 /usr/lib/dovecot/imap

unbreaking Calibri.ttf

(Update: The latest version of freetype2 has a quite good TrueType rendering engine with ClearType support, which makes such configuration no longer necessary... assuming your distro enables that feature, which I have to do manually in Arch. The config file has been moved, also. – 2014-08-22)

Calibri, one of Microsoft's ClearType fonts, has a few sets of bitmaps embedded into it, to make it look better when font smoothing is off. Which results in Calibri looking just plain ugly in X11/Freetype when you enable hinting.

To disable embedded bitmaps, put this into your ~/.config/fontconfig/fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="font">
        <test name="family" compare="eq">
            <string>Calibri</string>
            <string>Cambria</string>
        </test>
        <edit name="embeddedbitmap" mode="assign">
            <bool>false</bool>
        </edit>
    </match>
</fontconfig>

Installing Flash Player for Firefox

Previously:

  1. Open Firefox.
  2. Click http://get.adobe.com/flashplayer/ in Google.
  3. Click "Download", download a small .exe (which is a self-installing .zip)
  4. Run the .exe

Now:

  1. Open Firefox.
  2. Click http://get.adobe.com/flashplayer/ in Google.
  3. Uncheck "Free McAffee Security Crap"
  4. Click "Download", get nothing.
  5. Notice the Firefox info bar, approve adobe.com for installing software.
  6. Install the "Adobe DLM" extension.
  7. Click "Restart Firefox", wait for Firefox to restart.
  8. Wait while DLM installs itself.
  9. Wait for DLM to download the Flash Player installer.
  10. Uninstall Adobe DLM from Firefox.
  11. Uninstall Adobe DLM from "Add/Remove Programs"
  12. Notice that about:plugins still lists "getPlusPlus for Adobe", find the goddamn .dll file, and burn it in a fire.
  13. Notice that you could have avoided all of this if you clicked the "If it does not start, click here to download" link.

Adobe. You call this convenient?