anchor.diff:  
     patches = [
       # Make dovecot look for plugins in /etc/dovecot/modules
  -    # so we can symlink plugins from several packages there
  -    # The symlinking needs to be done in NixOS, as part of the
  -    # dovecot service start-up
  +    # so we can symlink plugins from several packages there.
  +    # The symlinking needs to be done in NixOS.
       ./2.2.x-module_dir.patch
     ];
   
  
positive.code:     # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626211
      "--localstatedir=/var"
      "--with-ldap"
      "--with-lucene"
      "--with-ssl=openssl"
      "--with-sqlite"
      "--with-zlib"
      "--with-bzlib"
    ] ++ stdenv.lib.optionals (stdenv.isLinux) [
      "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
    ];
  
    meta = {
      homepage = "http://dovecot.org/";
  
negative.code:   };
  
    preConfigure = ''
      patchShebangs src/config/settings-get.pl
    '';
  
    postInstall = lib.optionalString stdenv.isDarwin ''
      install_name_tool -change libclucene-shared.1.dylib \
          ${clucene_core_2}/lib/libclucene-shared.1.dylib \
          $out/lib/dovecot/lib21_fts_lucene_plugin.so
  