anchor.diff:        with python.pkgs; [ python wrapPython pygobject3 ]
       else
         with python.pkgs; [ python wrapPython pygtk pygobject2 ];
  +
  +  features = [
  +    { flags = [ "acpi_notifier-plugin" ]; enabled = enablePluginAcpiNotifier; }
  +    { flags = [ "address_keeper-plugin" ]; enabled = enablePluginAddressKeeper; }
  +    { flags = [ "archive-plugin" ]; enabled = enablePluginArchive; deps = [ libarchive ]; }
  +    { flags = [ "att_remover-plugin" ]; enabled = enablePluginAttRemover; }
  +    { flags = [ "attachwarner-plugin" ]; enabled = enablePluginAttachWarner; }
  +    { flags = [ "bogofilter-plugin" ]; enabled = enablePluginBogofilter; }
  +    { flags = [ "bsfilter-plugin" ]; enabled = enablePluginBsfilter; }
  +    { flags = [ "clamd-plugin" ]; enabled = enablePluginClamd; }
  +    { flags = [ "dbus" ]; enabled = enableDbus; deps = [ dbus dbus-glib ]; }
  +    { flags = [ "dillo-plugin" ]; enabled = enablePluginDillo; }
  +    { flags = [ "enchant" ]; enabled = enableEnchant; deps = [ enchant ]; }
  +    { flags = [ "fetchinfo-plugin" ]; enabled = enablePluginFetchInfo; }
  +    { flags = [ "gnutls" ]; enabled = enableGnuTLS; deps = [ gnutls ]; }
  +    { flags = [ "ldap" ]; enabled = enableLdap; deps = [ openldap ]; }
  +    { flags = [ "libetpan" ]; enabled = enableLibetpan; deps = [ libetpan ]; }
  +    { flags = [ "libravatar-plugin" ]; enabled = enablePluginLibravatar; }
  +    { flags = [ "libsm" ]; enabled = enableLibSM; deps = [ libSM ]; }
  +    { flags = [ "litehtml_viewer-plugin" ]; enabled = enablePluginLitehtmlViewer; deps = [ gumbo ]; }
  +    { flags = [ "mailmbox-plugin" ]; enabled = enablePluginMailmbox; }
  +    { flags = [ "managesieve-plugin" ]; enabled = enablePluginManageSieve; }
  +    { flags = [ "networkmanager" ]; enabled = enableNetworkManager; deps = [ networkmanager ]; }
  +    { flags = [ "newmail-plugin" ]; enabled = enablePluginNewMail; }
  +    { flags = [ "notification-plugin" ]; enabled = enablePluginNotification; deps = [ libnotify ] ++ [(if useGtk3 then libcanberra-gtk3 else libcanberra-gtk2)]; }
  +    { flags = [ "pdf_viewer-plugin" ]; enabled = enablePluginPdfViewer; deps = [ poppler ]; }
  +    { flags = [ "perl-plugin" ]; enabled = enablePluginPerl; deps = [ perl ]; }
  +    { flags = [ "pgpcore-plugin" "pgpinline-plugin" "pgpmime-plugin" ]; enabled = enablePluginPgp; deps = [ gnupg gpgme ]; }
  +    { flags = [ "python-plugin" ]; enabled = enablePluginPython; }
  +    { flags = [ "rssyl-plugin" ]; enabled = enablePluginRssyl; deps = [ libxml2 ]; }
  +    { flags = [ "smime-plugin" ]; enabled = enablePluginSmime; }
  +    { flags = [ "spam_report-plugin" ]; enabled = enablePluginSpamReport; }
  +    { flags = [ "spamassassin-plugin" ]; enabled = enablePluginSpamassassin; }
  +    { flags = [ "svg" ]; enabled = enableSvg; deps = [ librsvg ]; }
  +    { flags = [ "tnef_parse-plugin" ]; enabled = enablePluginTnefParse; deps = [ libytnef ]; }
  +    { flags = [ "valgrind" ]; enabled = enableValgrind; deps = [ valgrind ]; }
  +    { flags = [ "vcalendar-plugin" ]; enabled = enablePluginVcalendar; deps = [ libical ]; }
  +  ];
   in stdenv.mkDerivation rec {
     pname = "claws-mail";
     inherit version;
  
positive.code:     homepage = "https://www.claws-mail.org/";
      license = licenses.gpl3;
      platforms = platforms.linux;
      maintainers = with maintainers; [ fpletz globin orivej oxzi ];
    };
  }
  
negative.code:   buildInputs =
      [ curl gsettings-desktop-schemas glib-networking ]
      ++ [(if useGtk3 then gtk3 else gtk2)]
      ++ concatMap (f: optionals f.enabled f.deps) (filter (f: f ? deps) features)
    ;
  
    configureFlags =
  