anchor.diff:      ++ optional gssSupport  "--with-gss"
       ++ optional saslSupport "--with-sasl";
   
  +  postPatch = optionalString (smimeSupport || gpgmeSupport) ''
  +    sed -i 's#/usr/bin/openssl#${openssl}/bin/openssl#' smime_keys.pl
  +  '';
  +
  +  postInstall = optionalString smimeSupport ''
  +    # S/MIME setup
  +    cp contrib/smime.rc $out/etc/smime.rc
  +    sed -i 's#openssl#${openssl}/bin/openssl#' $out/etc/smime.rc
  +    echo "source $out/etc/smime.rc" >> $out/etc/Muttrc
  +  '' + optionalString gpgSupport ''
  +    # GnuPG setup
  +    cp contrib/gpg.rc $out/etc/gpg.rc
  +    sed -i 's#\(command="\)gpg #\1${gnupg}/bin/gpg #' $out/etc/gpg.rc
  +    echo "source $out/etc/gpg.rc" >> $out/etc/Muttrc
  +  '';
  +
     meta = {
       description = "A small but very powerful text-based mail client";
       homepage = http://www.mutt.org;
  
positive.code:     sha256 = "1c8vv4anl555a03pbnwf8wnf0d8pcnd4p35y3q8f5ikkcflq76vl";
    };
  
    patchPhase = optionalString (openssl != null) ''
      sed -i 's#/usr/bin/openssl#${openssl}/bin/openssl#' smime_keys.pl
    '';
  
    buildInputs =
      [ ncurses which perl ]
  
negative.code: assert headerCache  -> gdbm       != null;
  assert sslSupport   -> openssl    != null;
  assert saslSupport  -> cyrus_sasl != null;
  assert smimeSupport -> openssl    != null;
  assert gpgSupport   -> gnupg      != null;
  assert gpgmeSupport -> gpgme      != null && openssl != null;
  
  with stdenv.lib;
  
  