1 { lib, stdenv, fetchurl, pkg-config, perl
2 , openssl, db, cyrus_sasl, zlib
4 # Disabled by default as XOAUTH2 is an "OBSOLETE" SASL mechanism and this relies
5 # on a package that isn't really maintained anymore:
6 , withCyrusSaslXoauth2 ? false, cyrus-sasl-xoauth2, makeWrapper
9 stdenv.mkDerivation rec {
14 url = "mirror://sourceforge/isync/${pname}-${version}.tar.gz";
15 sha256 = "1zq0wwvmqsl9y71546dr0aygzn9gjjfiw19hlcq87s929y4p6ckw";
19 # Fixes "Fatal: buffer too small" error
20 ./0001-Increase-imap_vprintf-buffer-size.patch
21 # Fix #202595: SSL error "Socket error: ... unexpected eof while reading"
22 # Source: https://sourceforge.net/p/isync/isync/ci/b6c36624f04cd388873785c0631df3f2f9ac4bf0/
23 ./work-around-unexpected-EOF-error-messages-at-end-of-SSL-connections.patch
26 nativeBuildInputs = [ pkg-config perl ]
27 ++ lib.optionals withCyrusSaslXoauth2 [ makeWrapper ];
28 buildInputs = [ openssl db cyrus_sasl zlib ]
29 ++ lib.optionals stdenv.isDarwin [ Security ];
31 postInstall = lib.optionalString withCyrusSaslXoauth2 ''
32 wrapProgram "$out/bin/mbsync" \
33 --prefix SASL_PATH : "${lib.makeSearchPath "lib/sasl2" [ cyrus-sasl-xoauth2 cyrus_sasl.out ]}"
37 homepage = "http://isync.sourceforge.net/";
38 # https://sourceforge.net/projects/isync/
39 changelog = "https://sourceforge.net/p/isync/isync/ci/v${version}/tree/NEWS";
40 description = "Free IMAP and MailDir mailbox synchronizer";
42 mbsync (formerly isync) is a command line application which synchronizes
43 mailboxes. Currently Maildir and IMAP4 mailboxes are supported. New
44 messages, message deletions and flag changes can be propagated both ways.
46 license = licenses.gpl2Plus;
47 platforms = platforms.unix;
48 maintainers = with maintainers; [ primeos lheckemann ];
49 mainProgram = "mbsync";