1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
5 ;;; Copyright © 2014 Sou Bunnbu <iyzsong@gmail.com>
6 ;;; Copyright © 2014 Julien Lepiller <julien@lepiller.eu>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
9 ;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
10 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
11 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
13 ;;; Copyright © 2016 Al McElrath <hello@yrns.org>
14 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
15 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
16 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
17 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
18 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
19 ;;; Copyright © 2016 Clément Lassieur <clement@lassieur.org>
20 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
22 ;;; This file is part of GNU Guix.
24 ;;; GNU Guix is free software; you can redistribute it and/or modify it
25 ;;; under the terms of the GNU General Public License as published by
26 ;;; the Free Software Foundation; either version 3 of the License, or (at
27 ;;; your option) any later version.
29 ;;; GNU Guix is distributed in the hope that it will be useful, but
30 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 ;;; GNU General Public License for more details.
34 ;;; You should have received a copy of the GNU General Public License
35 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37 (define-module (gnu packages mail)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages backup)
42 #:use-module (gnu packages bash)
43 #:use-module (gnu packages bison)
44 #:use-module (gnu packages curl)
45 #:use-module (gnu packages cyrus-sasl)
46 #:use-module (gnu packages databases)
47 #:use-module (gnu packages dejagnu)
48 #:use-module (gnu packages emacs)
49 #:use-module (gnu packages enchant)
50 #:use-module (gnu packages ghostscript)
51 #:use-module (gnu packages glib)
52 #:use-module (gnu packages gnome)
53 #:use-module (gnu packages gnupg)
54 #:use-module (gnu packages gsasl)
55 #:use-module (gnu packages gtk)
56 #:use-module (gnu packages guile)
57 #:use-module (gnu packages flex)
58 #:use-module (gnu packages libcanberra)
59 #:use-module (gnu packages libidn)
60 #:use-module (gnu packages linux)
61 #:use-module (gnu packages m4)
62 #:use-module (gnu packages ncurses)
63 #:use-module (gnu packages pcre)
64 #:use-module (gnu packages perl)
65 #:use-module (gnu packages python)
66 #:use-module (gnu packages readline)
67 #:use-module (gnu packages search)
68 #:use-module (gnu packages texinfo)
69 #:use-module (gnu packages compression)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages pkg-config)
72 #:use-module (gnu packages flex)
73 #:use-module (gnu packages gdb)
74 #:use-module (gnu packages samba)
75 #:use-module (gnu packages tls)
76 #:use-module (gnu packages networking)
77 #:use-module (gnu packages web)
78 #:use-module (gnu packages xml)
79 #:use-module (gnu packages xorg)
80 #:use-module ((guix licenses)
81 #:select (gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+
82 non-copyleft (expat . license:expat) bsd-3
84 #:use-module (guix packages)
85 #:use-module (guix download)
86 #:use-module (guix git-download)
87 #:use-module (guix utils)
88 #:use-module (guix build-system gnu)
89 #:use-module (guix build-system perl)
90 #:use-module (guix build-system python)
91 #:use-module (guix build-system trivial))
93 (define-public mailutils
99 (uri (string-append "mirror://gnu/mailutils/mailutils-"
103 "0szbqa12zqzldqyw97lxqax3ja2adis83i7brdfsxmrfw68iaf65"))
104 (patches (search-patches "m4-gets-undeclared.patch"))))
105 (build-system gnu-build-system)
107 '(;; TODO: Add `--with-sql'.
108 #:phases (alist-cons-before
111 ;; Use Guile 2.0's public API.
112 (substitute* "libmu_scm/mu_message.c"
113 (("scm_i_string_length")
114 "scm_c_string_length"))
116 ;; This file should be generated to use the right
117 ;; value of $(libdir) et al.
118 (delete-file "libmu_scm/mailutils.scm")
120 ;; Use the right file name for `cat'.
121 (substitute* "testsuite/lib/mailutils.exp"
125 #:parallel-tests? #f))
127 `(("dejagnu" ,dejagnu)
134 ;; With Readline 6.3, examples/pop3client.c fails to build because it
135 ;; uses the now undefined 'CPPFunction' type.
136 ("readline" ,readline-6.2)
138 ("linux-pam" ,linux-pam)
141 (home-page "http://www.gnu.org/software/mailutils/")
142 (synopsis "Utilities and library for reading and serving mail")
144 "GNU Mailutils is a collection of programs for managing, viewing and
145 processing electronic mail. It contains both utilities and server daemons
146 and all operate in a protocol-agnostic way. The underlying libraries are
147 also available, simplifying the addition of mail capabilities to new
150 ;; Libraries are under LGPLv3+, and programs under GPLv3+.
151 (list gpl3+ lgpl3+))))
153 (define-public fetchmail
159 (uri (string-append "mirror://sourceforge/fetchmail/branch_6.3/fetchmail-"
163 "0l78ayvi9dm8hd190gl139cs2xqsrf7r9ncilslw20mgvd6cbd3r"))))
164 (build-system gnu-build-system)
166 `(("openssl" ,openssl)))
168 `(#:configure-flags (list (string-append "--with-ssl="
169 (assoc-ref %build-inputs "openssl")))))
170 (home-page "http://www.fetchmail.info/")
171 (synopsis "Remote-mail retrieval and forwarding utility")
173 "Fetchmail is a full-featured, robust, well-documented remote-mail
174 retrieval and forwarding utility intended to be used over on-demand
175 TCP/IP links (such as SLIP or PPP connections). It supports every
176 remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP,
177 KPOP, all flavors of IMAP, ETRN, and ODMR. It can even support IPv6
180 Fetchmail retrieves mail from remote mail servers and forwards it via SMTP,
181 so it can then be read by normal mail user agents such as mutt, elm
182 or BSD Mail. It allows all your system MTA's filtering, forwarding, and
183 aliasing facilities to work just as they would on normal mail.")
184 (license gpl2+))) ; most files are actually public domain or x11
192 (uri (string-append "ftp://ftp.mutt.org/pub/mutt/mutt-"
196 "0idkamdiwj9fgqaz1vzkfg78cnmkzp74skv0ibw2xjfq6ds9hghx"))
197 (patches (search-patches "mutt-store-references.patch"))))
198 (build-system gnu-build-system)
200 `(("cyrus-sasl" ,cyrus-sasl)
207 `(#:configure-flags '("--enable-smtp"
211 "--enable-hcache" ; for header caching
215 ;; so that mutt does not check whether the path
216 ;; exists, which it does not in the chroot
217 "--with-mailpath=/var/mail")))
218 (home-page "http://www.mutt.org/")
219 (synopsis "Mail client")
221 "Mutt is a small but very powerful text-based mail client for Unix
231 (uri (string-append "mirror://gnome/sources/gmime/"
232 (version-major+minor version)
233 "/gmime-" version ".tar.xz"))
236 "0rfzbgsh8ira5p76kdghygl5i3fvmmx4wbw5rp7f8ajc4vxp18g0"))))
237 (build-system gnu-build-system)
239 `(("pkg-config" ,pkg-config)
240 ("gnupg" ,gnupg))) ; for tests only
241 (inputs `(("glib" ,glib)
246 (modify-phases %standard-phases
248 'unpack 'patch-paths-in-tests
250 ;; The test programs run several programs using 'system' with
251 ;; hard-coded paths. Here we patch them all.
252 ;; We use ISO-8859-1 here because test-iconv.c contains
253 ;; raw byte sequences in several different encodings.
254 (with-fluids ((%default-port-encoding #f))
255 (substitute* (find-files "tests" "\\.c$")
256 (("(system *\\(\")(/[^ ]*)" all pre prog-path)
257 (let* ((base (basename prog-path))
260 (or prog (error "not found: " base))))))))))))
261 (home-page "http://spruce.sourceforge.net/gmime/")
262 (synopsis "MIME message parser and creator library")
264 "GMime provides a core library and set of utilities which may be used for
265 the creation and parsing of messages using the Multipurpose Internet Mail
267 (license (list lgpl2.1+ gpl2+ gpl3+))))
269 (define-public bogofilter
275 (uri (string-append "mirror://sourceforge/bogofilter/bogofilter-"
276 version "/bogofilter-"
280 "1d56n2m9inm8gnzm88aa27xl2a7sp7aff3484vmflpqkinjqf0p1"))))
281 (build-system gnu-build-system)
283 '(#:phases (alist-cons-before
286 (substitute* "src/tests/t.frame"
288 (string-append "GREP=" (which "grep") "\n"))))
290 (native-inputs `(("flex" ,flex)))
291 (inputs `(("bdb" ,bdb)))
292 (home-page "http://bogofilter.sourceforge.net/")
293 (synopsis "Mail classifier based on a Bayesian filter")
295 "Bogofilter is a mail filter that classifies mail as spam or ham
296 (non-spam) by a statistical analysis of the message's header and
297 content (body). The program is able to learn from the user's classifications
298 and corrections. It is based on a Bayesian filter.")
301 (define-public offlineimap
307 (uri (string-append "https://github.com/OfflineIMAP/offlineimap/"
308 "archive/v" version ".tar.gz"))
309 (file-name (string-append name "-" version ".tar.gz"))
312 "1msg0v5i3v4mvjm2c5alzz91dk5y20h4xdr60lcz3507fv80407m"))))
313 (build-system python-build-system)
314 (inputs `(("python2-pysqlite" ,python2-pysqlite)
315 ("python2-six" ,python2-six)))
317 ;; The setup.py script expects python-2.
319 ;; Tests require a modifiable IMAP account.
322 (modify-phases %standard-phases
323 (add-after 'install 'wrap-binary
324 (lambda* (#:key inputs outputs #:allow-other-keys)
325 (let* ((out (assoc-ref outputs "out"))
326 (bin (string-append out "/bin/offlineimap")))
328 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
330 (home-page "http://www.offlineimap.org")
331 (synopsis "Sync emails between two repositories")
333 "OfflineImap synchronizes emails between two repositories, so that you
334 can read the same mailbox from multiple computers. It supports IMAP as REMOTE
335 repository and Maildir/IMAP as LOCAL repository.")
344 (uri (string-append "https://github.com/djcb/mu/archive/v"
346 (file-name (string-append "mu-" version ".tar.gz"))
349 "0p7hqri1r1x6750x138cc29mh81kdav2dcim26y58s8an206h25g"))))
350 (build-system gnu-build-system)
352 `(("pkg-config" ,pkg-config)
353 ("glib" ,glib "bin") ; for gtester
354 ("autoconf" ,autoconf)
355 ("automake" ,automake)
356 ("emacs" ,emacs-minimal)
358 ("texinfo" ,texinfo)))
359 ;; TODO: Add webkit and gtk to build the mug GUI.
365 ("tzdata" ,tzdata))) ;for mu/test/test-mu-query.c
367 `(#:modules ((guix build gnu-build-system)
369 (guix build emacs-utils))
370 #:imported-modules (,@%gnu-build-system-modules
371 (guix build emacs-utils))
373 (modify-phases %standard-phases
374 (add-after 'unpack 'patch-configure.ac
375 ;; By default, elisp code goes to "share/emacs/site-lisp/mu4e",
376 ;; so our Emacs package can't find it. Setting "--with-lispdir"
377 ;; configure flag doesn't help because "mu4e" will be added to
378 ;; the lispdir anyway, so we have to modify "configure.ac".
380 (substitute* "configure.ac"
381 (("^ +lispdir=.*") ""))
383 (add-after 'patch-configure.ac 'autoreconf
385 (zero? (system* "autoreconf" "-vi"))))
386 (add-before 'check 'check-tz-setup
387 (lambda* (#:key inputs #:allow-other-keys)
388 ;; For mu/test/test-mu-query.c
390 (string-append (assoc-ref inputs "tzdata")
393 (add-after 'install 'install-emacs-autoloads
394 (lambda* (#:key outputs #:allow-other-keys)
395 (emacs-generate-autoloads
397 (string-append (assoc-ref outputs "out")
398 "/share/emacs/site-lisp"))
400 (home-page "http://www.djcbsoftware.nl/code/mu/")
401 (synopsis "Quickly find emails")
403 "Mu is a tool for dealing with e-mail messages stored in the
404 Maildir-format. Mu's purpose in life is to help you to quickly find the
405 messages you need; in addition, it allows you to view messages, extract
406 attachments, create new maildirs, and so on.")
415 ;; package author intends on distributing via github rather
417 ;; https://github.com/pazz/alot/issues/877#issuecomment-230173331
418 (uri (string-append "https://github.com/pazz/alot/archive/"
420 (file-name (string-append "alot-" version ".tar.gz"))
423 "09md9llg38r6xby8l0y0zf8nhlh91cr4xs0r15b294hhp8hl2bgx"))))
424 (build-system python-build-system)
426 `(#:tests? #f ; no tests
427 ;; python 3 is unsupported, more info:
428 ;; https://github.com/pazz/alot/blob/0.3.7/docs/source/faq.rst
431 `(("python2-magic" ,python2-magic)
432 ("python2-configobj" ,python2-configobj)
433 ("python2-twisted" ,python2-twisted)
434 ("python2-urwid" ,python2-urwid)
435 ("python2-urwidtrees" ,python2-urwidtrees)
436 ("python2-pygpgme" ,python2-pygpgme)
437 ("python2-notmuch" ,python2-notmuch)))
438 (home-page "https://github.com/pazz/alot")
439 (synopsis "Commandline MUA using notmuch")
441 "Alot is an experimental terminal mail user agent (MUA) based on
442 @code{notmuch} mail. It is written in Python using the @code{urwid} toolkit.")
445 (define-public notmuch
451 (uri (string-append "https://notmuchmail.org/releases/notmuch-"
455 "0jwpda3q023dn3sp41n8648951i7iagfv8zzpriv7hpkjivlafg7"))))
456 (build-system gnu-build-system)
458 '(#:tests? #f ; FIXME: 694 tests; 170 fail and 100 are skipped
459 ; with perl input: 50 fail and 100 are skipped
460 #:phases (modify-phases %standard-phases
462 (lambda* (#:key outputs #:allow-other-keys)
464 (setenv "CONFIG_SHELL" (which "sh"))
466 (let ((out (assoc-ref outputs "out")))
467 (zero? (system* "./configure"
468 (string-append "--prefix=" out)))))))))
470 `(("bash-completion" ,bash-completion)
471 ("emacs" ,emacs-minimal)
472 ("pkg-config" ,pkg-config)
474 ("python-docutils" ,python2-docutils)
475 ("python-sphinx" ,python2-sphinx)))
482 (home-page "http://notmuchmail.org/")
483 (synopsis "Thread-based email index, search, and tagging")
485 "Notmuch is a command-line based program for indexing, searching, read-
486 ing, and tagging large collections of email messages.")
489 (define-public notmuch-addrlookup-c
491 (name "notmuch-addrlookup-c")
496 "https://github.com/aperezdc/" name "/archive/v"
498 (file-name (string-append name "-" version ".tar.gz"))
501 "0rslg2ifgyhl6asv3yr1f62m9xjfcinv7i6qb07h2k217jqlmrri"))))
502 (build-system gnu-build-system)
504 '(#:tests? #f ; no tests
505 #:make-flags (list "CC=gcc"
506 (string-append "PREFIX="
507 (assoc-ref %outputs "out")))
508 #:phases (modify-phases %standard-phases
510 ;; Remove vim code completion config, it's not needed to
511 ;; build (or be patched).
512 (add-before 'patch-source-shebangs 'delete-ycm-file
513 (lambda _ (delete-file ".ycm_extra_conf.py")))
515 (lambda* (#:key outputs #:allow-other-keys)
516 (let ((bin (string-append
517 (assoc-ref outputs "out") "/bin")))
518 (install-file "notmuch-addrlookup" bin)))))))
520 `(("pkg-config" ,pkg-config)))
523 ("notmuch" ,notmuch)))
524 (home-page "https://github.com/aperezdc/notmuch-addrlookup-c")
525 (synopsis "Address lookup tool for Notmuch")
526 (description "This is an address lookup tool using a Notmuch database,
527 useful for email address completion.")
528 (license license:expat)))
530 (define-public python-notmuch
532 (name "python-notmuch")
534 ;; Notmuch python bindings are now unavailable on pypi. The
535 ;; bindings are distributed via the notmuch release tarball.
536 (source (package-source notmuch))
537 (build-system python-build-system)
538 (inputs `(("notmuch" ,notmuch)))
540 `(#:tests? #f ; no "test" target
542 (modify-phases %standard-phases
543 ;; This python package lives in a subdirectory of the notmuch source
544 ;; tree, so chdir into it before building.
545 (add-after 'unpack 'enter-python-dir
546 (lambda _ (chdir "bindings/python") #t))
547 ;; Make sure the correct notmuch shared library gets loaded.
548 (add-before 'build 'set-libnotmuch-file-name
549 (lambda* (#:key inputs #:allow-other-keys)
550 (let ((notmuch (assoc-ref inputs "notmuch")))
551 (substitute* "notmuch/globals.py"
552 (("libnotmuch\\.so\\.")
553 (string-append notmuch "/lib/libnotmuch.so.")))
555 (home-page "http://notmuchmail.org/")
556 (synopsis "Python bindings of the Notmuch mail indexing library")
558 "This package provides Python bindings to use the Notmuch mail indexing
559 and search library.")
562 (define-public python2-notmuch
563 (package-with-python2 python-notmuch))
565 (define-public getmail
572 (uri (string-append "http://pyropus.ca/software/getmail/old-versions/"
573 name "-" version ".tar.gz"))
576 "1m0yzxd05fklwbmjj1n2q4sx397c1j5qi9a0r5fv3h8pplz4lv0w"))))
577 (build-system python-build-system)
579 `(#:tests? #f ; no tests
581 (home-page "http://pyropus.ca/software/getmail/")
582 (synopsis "Mail retriever")
584 "A flexible, extensible mail retrieval system with support for
585 POP3, IMAP4, SSL variants of both, maildirs, mboxrd files, external MDAs,
586 arbitrary message filtering, single-user and domain-mailboxes, and many other
589 ;; License is specified in file '__init__.py'.
592 (define-public libetpan
598 (uri (string-append "https://github.com/dinhviethoa/" name
599 "/archive/" version ".tar.gz"))
600 (file-name (string-append name "-" version ".tar.gz"))
602 (base32 "081ixgj3skglq9i7v0jb835lmfx21zi4i5b7997igwr0lj174y9j"))))
603 (build-system gnu-build-system)
604 (native-inputs `(("autoconf" ,(autoconf-wrapper))
605 ("automake" ,automake)
607 ("pkg-config" ,pkg-config)))
609 ;; 'libetpan-config --libs' returns '-lssl -lcrypto -lsasl2', so these
610 ;; libraries need to be propagated.
611 `(("cyrus-sasl" ,cyrus-sasl)
612 ("openssl" ,openssl)))
619 (modify-phases %standard-phases
620 (add-after 'unpack 'autogen
622 (setenv "NOCONFIGURE" "true")
623 (zero? (system* "sh" "autogen.sh")))))
625 '("--disable-static" "--disable-db")))
626 (home-page "http://www.etpan.org/libetpan.html")
627 (synopsis "Portable middleware for email access")
629 "The purpose of this mail library is to provide a portable, efficient
630 framework for different kinds of mail access: IMAP, SMTP, POP and NNTP. It
631 provides an API for C language. It's the low-level API used by MailCore and
633 (license (non-copyleft "file://COPYING"))))
635 (define-public claws-mail
642 "http://www.claws-mail.org/releases/" name "-" version
646 "0nfchgga3ir91s8rky0a0vnz8cgj2f6h716wh3cmb466a01xfss6"))))
647 (build-system gnu-build-system)
648 (native-inputs `(("pkg-config" ,pkg-config)))
649 (inputs `(("bogofilter" ,bogofilter)
651 ("dbus-glib" ,dbus-glib)
654 ("ghostscript" ,ghostscript)
655 ("hicolor-icon-theme" ,hicolor-icon-theme)
660 ("libarchive" ,libarchive)
661 ("libcanberra" ,libcanberra)
662 ("libetpan" ,libetpan)
663 ("libnotify" ,libnotify)
667 ("python-2" ,python-2)
668 ("mime-info" ,shared-mime-info)))
671 '("--enable-gnutls" "--enable-pgpmime-plugin" "--enable-enchant")
672 #:phases (modify-phases %standard-phases
673 (add-before 'build 'patch-mime
674 (lambda* (#:key inputs #:allow-other-keys)
675 (substitute* "src/procmime.c"
676 (("/usr/share/mime/globs")
677 (string-append (assoc-ref inputs "mime-info")
678 "/share/mime/globs"))))))))
679 (synopsis "GTK-based Email client")
681 "Claws-Mail is an email client (and news reader) based on GTK+. The
682 appearance and interface are designed to be familiar to new users coming from
683 other popular email clients, as well as experienced users. Almost all commands
684 are accessible with the keyboard. Plus, Claws-Mail is extensible via addons
685 which can add many functionalities to the base client.")
686 (home-page "http://www.claws-mail.org/")
687 (license gpl3+))) ; most files are actually public domain or x11
696 (uri (string-append "mirror://sourceforge/msmtp/msmtp/" version
697 "/msmtp-" version ".tar.xz"))
700 "01jh9ba49bih8zsh40myw6qq1ll210q1vw0jg865vrn7jc3dd83n"))))
701 (build-system gnu-build-system)
704 ("libsecret" ,libsecret)
709 `(("pkg-config" ,pkg-config)))
710 (home-page "http://msmtp.sourceforge.net/")
712 `(#:configure-flags (list "--with-libgsasl"
716 (modify-phases %standard-phases
717 (add-after 'install 'install-msmtpq
718 (lambda* (#:key outputs #:allow-other-keys)
719 (let* ((out (assoc-ref outputs "out"))
720 (bin (string-append out "/bin"))
721 (doc (string-append out "/share/doc/msmtp"))
722 (msmtpq (string-append "scripts/msmtpq")))
723 (install-file (string-append msmtpq "/msmtpq") bin)
724 (install-file (string-append msmtpq "/msmtp-queue") bin)
725 (install-file (string-append msmtpq "/README.msmtpq") doc)
728 "Simple and easy to use SMTP client with decent sendmail compatibility")
730 "msmtp is an SMTP client. In the default mode, it transmits a mail to
731 an SMTP server (for example at a free mail provider) which takes care of further
742 (uri (list (string-append "ftp://ftp.exim.org/pub/exim/exim4/exim-"
744 (string-append "ftp://ftp.exim.org/pub/exim/exim4/old/exim-"
745 version ".tar.bz2")))
748 "1jbxn13shq90kpn0s73qpjnx5xm8jrpwhcwwgqw5s6sdzw6iwsbl"))))
749 (build-system gnu-build-system)
760 `(("pcre" ,pcre "bin")
766 ;; We'd use #:make-flags but the top-level Makefile calls others
767 ;; recursively, so just set all variables this way.
768 (lambda* (#:key outputs inputs #:allow-other-keys)
769 (substitute* '("Makefile" "OS/Makefile-Default")
770 (("(RM_COMMAND=).*" all var)
771 (string-append var "rm\n")))
772 (copy-file "src/EDITME" "Local/Makefile")
773 (copy-file "exim_monitor/EDITME" "Local/eximon.conf")
774 (let ((out (assoc-ref outputs "out"))
775 (gzip (assoc-ref inputs "gzip"))
776 (bzip2 (assoc-ref inputs "bzip2"))
777 (xz (assoc-ref inputs "xz")))
778 (substitute* '("Local/Makefile")
779 (("(BIN_DIRECTORY=).*" all var)
780 (string-append var out "/bin\n"))
781 (("(CONFIGURE_FILE=).*" all var)
782 (string-append var out "/etc/exim.conf\n"))
783 (("(EXIM_USER=).*" all var)
784 (string-append var "nobody\n"))
785 (("(FIXED_NEVER_USERS=).*" all var)
786 (string-append var "\n")) ;XXX no root in build environment
787 (("(COMPRESS_COMMAND=).*" all var)
788 (string-append var gzip "/bin/gzip\n"))
789 (("(ZCAT_COMMAND=).*" all var)
790 (string-append var gzip "/bin/zcat\n")))
791 ;; This file has hardcoded names for tools despite the zcat
792 ;; configuration above.
793 (substitute* '("src/exigrep.src")
794 (("'zcat'") (string-append "'" gzip "/bin/zcat'"))
795 (("'bzcat'") (string-append "'" bzip2 "/bin/bzcat'"))
796 (("'xzcat'") (string-append "'" xz "/bin/xzcat'"))
797 (("'lzma'") (string-append "'" xz "/bin/lzma'")))))
800 (lambda* (#:key inputs #:allow-other-keys)
801 (substitute* '("scripts/lookups-Makefile" "scripts/reversion")
802 (("SHELL=/bin/sh") "SHELL=sh"))
803 (substitute* '("scripts/Configure-config.h")
804 (("\\| /bin/sh") "| sh"))
805 (let ((bash (assoc-ref inputs "bash")))
806 (substitute* '("scripts/Configure-eximon")
807 (("#!/bin/sh") (string-append "#!" bash "/bin/sh")))))
809 #:make-flags '("INSTALL_ARG=-no_chown")
810 ;; No 'check' target.
812 (home-page "http://www.exim.org/")
814 "Message Transfer Agent (MTA) developed at the University of Cambridge")
816 "Exim is a message transfer agent (MTA) developed at the University of
817 Cambridge for use on Unix systems connected to the Internet. In style it is
818 similar to Smail 3, but its facilities are more general. There is a great
819 deal of flexibility in the way mail can be routed, and there are extensive
820 facilities for checking incoming mail.")
823 (define-public dovecot
830 (uri (string-append "http://www.dovecot.org/releases/"
831 (version-major+minor version) "/"
832 name "-" version ".tar.gz"))
834 "0rwn5wc5b8j9fzqcjggdgpzmb77myrf4ra294z1gg5v3hhng7nfq"))))
835 (build-system gnu-build-system)
837 `(("pkg-config" ,pkg-config)))
839 `(("openssl" ,openssl)
843 ("linux-pam" ,linux-pam)))
845 `(#:configure-flags '("--sysconfdir=/etc"
846 "--localstatedir=/var")
847 #:phases (modify-phases %standard-phases
849 'configure 'pre-configure
851 ;; Simple hack to avoid installing in /etc
852 (substitute* '("doc/Makefile.in"
853 "doc/example-config/Makefile.in")
854 (("pkgsysconfdir = .*")
855 "pkgsysconfdir = /tmp/etc"))
857 (home-page "http://www.dovecot.org")
858 (synopsis "Secure POP3/IMAP server")
860 "Dovecot is a mail server whose major goals are security and reliability.
861 It supports mbox/Maildir and its own dbox/mdbox formats.")
862 ;; Most source files are covered by either lgpl2.1 or expat. The SHA code
863 ;; is covered by a variant of BSD-3, and UnicodeData.txt is covered by the
864 ;; Unicode, Inc. License Agreement for Data Files and Software.
865 (license (list lgpl2.1 license:expat (non-copyleft "file://COPYING")))))
874 (uri (string-append "mirror://sourceforge/isync/isync/"
875 version "/isync-" version ".tar.gz"))
877 "1bij6nm06ghkg98n2pdyacam2fyg5y8f7ajw0d5653m0r4ldw5p7"))))
878 (build-system gnu-build-system)
881 ("openssl" ,openssl)))
882 (home-page "http://isync.sourceforge.net/")
883 (synopsis "Mailbox synchronization program")
885 "isync/mbsync is command line tool for two-way synchronization of
886 mailboxes. Currently Maildir and IMAP are supported types.")
889 (define-public perl-email-abstract
891 (name "perl-email-abstract")
896 (uri (string-append "mirror://cpan/authors/id/R/RJ/RJBS/"
897 "Email-Abstract-" version ".tar.gz"))
900 "0h42rhvp769wb421cpbbg6v6xjp8iv86mvz70pqgfgf4nsn6jwgw"))))
901 (build-system perl-build-system)
903 `(("perl-email-simple" ,perl-email-simple)
904 ("perl-module-pluggable" ,perl-module-pluggable)
905 ("perl-mro-compat" ,perl-mro-compat)))
906 (home-page "http://search.cpan.org/dist/Email-Abstract")
907 (synopsis "Interface to mail representations")
908 (description "Email::Abstract provides module writers with the ability to
909 write simple, representation-independent mail handling code.")
910 (license (package-license perl))))
912 (define-public perl-email-address
914 (name "perl-email-address")
919 (uri (string-append "mirror://cpan/authors/id/R/RJ/RJBS/"
920 "Email-Address-" version ".tar.gz"))
923 "1ai4r149pzjv9dc2vddir8zylj0z1pii93rm4g591lx7avim71hx"))))
924 (build-system perl-build-system)
925 (home-page "http://search.cpan.org/dist/Email-Address")
926 (synopsis "Email address parsing and creation")
927 (description "Email::Address implements a regex-based RFC 2822 parser that
928 locates email addresses in strings and returns a list of Email::Address
929 objects found. Alternatively you may construct objects manually.")
930 (license (package-license perl))))
932 (define-public perl-email-date-format
934 (name "perl-email-date-format")
939 (uri (string-append "mirror://cpan/authors/id/R/RJ/RJBS/"
940 "Email-Date-Format-" version ".tar.gz"))
943 "012ivfwpnbl3wr50f9c6f4azhdlxnm31pdn72528g79v61z6372p"))))
944 (build-system perl-build-system)
945 (home-page "http://search.cpan.org/dist/Email-Date-Format")
946 (synopsis "Produce RFC 2822 date strings")
947 (description "Email::Date::Format provides a means for generating an RFC
948 2822 compliant datetime string.")
949 (license (package-license perl))))
951 (define-public perl-email-messageid
953 (name "perl-email-messageid")
958 (uri (string-append "mirror://cpan/authors/id/R/RJ/RJBS/"
959 "Email-MessageID-" version ".tar.gz"))
962 "09216naz21x99ff33wdm3j3zq1zhdbxhrsmx8bvavjrw3gjsvrq3"))))
963 (build-system perl-build-system)
964 (home-page "http://search.cpan.org/dist/Email-MessageID")
965 (synopsis "Generate world unique message-ids")
966 (description "Email::MessageID generates recommended message-ids to
967 identify a message uniquely.")
968 (license (package-license perl))))
970 (define-public perl-email-mime
972 (name "perl-email-mime")
977 (uri (string-append "mirror://cpan/authors/id/R/RJ/RJBS/"
978 "Email-MIME-" version ".tar.gz"))
981 "1sf7dldg4dvicyw6dl1vx6s1gjq3fcppi0103ikl0vi6v5xjdjdh"))))
982 (build-system perl-build-system)
984 `(("perl-email-address" ,perl-email-address)
985 ("perl-email-messageid" ,perl-email-messageid)
986 ("perl-email-mime-contenttype" ,perl-email-mime-contenttype)
987 ("perl-email-mime-encodings" ,perl-email-mime-encodings)
988 ("perl-email-simple" ,perl-email-simple)
989 ("perl-mime-types" ,perl-mime-types)))
990 (home-page "http://search.cpan.org/dist/Email-MIME")
991 (synopsis "MIME message handling")
992 (description "Email::MIME is an extension of the Email::Simple module, to
993 handle MIME encoded messages. It takes a message as a string, splits it up
994 into its constituent parts, and allows you access to various parts of the
995 message. Headers are decoded from MIME encoding.")
996 (license (package-license perl))))
998 (define-public perl-email-mime-contenttype
1000 (name "perl-email-mime-contenttype")
1005 (uri (string-append "mirror://cpan/authors/id/R/RJ/RJBS/"
1006 "Email-MIME-ContentType-" version ".tar.gz"))
1009 "1cl1l97lg690dh7i704hqi7yhxalq1chy7ylld5yc5v38jqa6gcn"))))
1010 (build-system perl-build-system)
1012 `(("perl-capture-tiny" ,perl-capture-tiny)))
1013 (home-page "http://search.cpan.org/dist/Email-MIME-ContentType")
1014 (synopsis "Parse MIME Content-Type headers")
1015 (description "Email::MIME::ContentType parses a MIME Content-Type
1017 (license (package-license perl))))
1019 (define-public perl-email-mime-encodings
1021 (name "perl-email-mime-encodings")
1026 (uri (string-append "mirror://cpan/authors/id/R/RJ/RJBS/"
1027 "Email-MIME-Encodings-" version ".tar.gz"))
1030 "0p5b8g9gh35m8fqrpx60g4bp98rvwd02n5b0vm9wh7mk0xah8wac"))))
1031 (build-system perl-build-system)
1033 `(("perl-capture-tiny" ,perl-capture-tiny)))
1034 (home-page "http://search.cpan.org/dist/Email-MIME-Encodings")
1035 (synopsis "Unified interface to MIME encoding and decoding")
1036 (description "This module wraps MIME::Base64 and MIME::QuotedPrint.")
1037 (license (package-license perl))))
1039 (define-public perl-email-sender
1041 (name "perl-email-sender")
1042 (version "1.300016")
1046 (uri (string-append "mirror://cpan/authors/id/R/RJ/RJBS/"
1047 "Email-Sender-" version ".tar.gz"))
1050 "18x26fjh399q3s2g8dajb9r10633c46jrnbvycpnpclgnzhjs100"))))
1051 (build-system perl-build-system)
1053 `(("perl-capture-tiny" ,perl-capture-tiny)))
1055 `(("perl-email-abstract" ,perl-email-abstract)
1056 ("perl-email-address" ,perl-email-address)
1057 ("perl-email-simple" ,perl-email-simple)
1058 ("perl-list-moreutils" ,perl-list-moreutils)
1059 ("perl-module-runtime" ,perl-module-runtime)
1060 ("perl-moo" ,perl-moo)
1061 ("perl-moox-types-mooselike" ,perl-moox-types-mooselike)
1062 ("perl-sub-exporter" ,perl-sub-exporter)
1063 ("perl-throwable" ,perl-throwable)
1064 ("perl-try-tiny" ,perl-try-tiny)))
1065 (home-page "http://search.cpan.org/dist/Email-Sender")
1066 (synopsis "Perl library for sending email")
1067 (description "Email::Sender replaces the old and sometimes problematic
1068 Email::Send library.")
1069 (license (package-license perl))))
1071 (define-public perl-email-simple
1073 (name "perl-email-simple")
1078 (uri (string-append "mirror://cpan/authors/id/R/RJ/RJBS/"
1079 "Email-Simple-" version ".tar.gz"))
1082 "19dpy3j5na2k9qw1jcpc8ia25038068r9j1bn34f9yyrisz7s522"))))
1083 (build-system perl-build-system)
1085 `(("perl-email-date-format" ,perl-email-date-format)))
1086 (home-page "http://search.cpan.org/dist/Email-Simple")
1087 (synopsis "Parsing of RFC 2822 messages")
1088 (description "Email::Simple provides simple parsing of RFC 2822 message
1089 format and headers.")
1090 (license (package-license perl))))
1092 (define-public libesmtp
1099 (uri (string-append "http://www.stafford.uklinux.net/libesmtp/libesmtp-"
1100 version ".tar.bz2"))
1103 "02zbniyz7qys1jmx3ghx21kxmns1wc3hmv80gp7ag7yra9f1m9nh"))))
1104 (build-system gnu-build-system)
1106 `(("openssl" ,openssl)))
1107 (home-page "http://www.stafford.uklinux.net/libesmtp/")
1108 (synopsis "Library for sending mail via remote hosts using SMTP")
1109 (description "libESMTP is an SMTP client which manages posting (or
1110 submission of) electronic mail via a preconfigured Mail Transport Agent (MTA).
1111 It may be used as part of a Mail User Agent (MUA) or other program that must
1112 be able to post electronic mail where mail functionality may not be that
1113 program's primary purpose.")
1114 (license (list lgpl2.1+ gpl2+))))
1116 (define-public esmtp
1124 (url "https://github.com/andywingo/esmtp.git")
1125 (commit "01bf9fc")))
1128 "1ay282rrl92h0m0m8z5zzjnwiiagi7c78aq2qvhia5mw7prwfyw2"))
1129 (file-name (string-append name "-" version "-checkout"))))
1131 `(#:phases (modify-phases %standard-phases
1133 'configure 'autoconf
1134 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
1135 (build-system gnu-build-system)
1139 ("autoconf" ,autoconf)
1140 ("automake" ,automake)
1141 ("libtool" ,libtool)))
1143 `(("libesmtp" ,libesmtp)))
1144 (home-page "http://sourceforge.net/projects/esmtp/")
1145 (synopsis "Relay-only mail transfer agent (MTA)")
1146 (description "Esmtp is a simple relay-only mail transfer agent built using
1147 libESMTP. It sends e-mail via a remote SMTP server using credentials from the
1148 user's @file{$HOME/.esmtprc} configuration file; see the @command{esmtprc} man
1149 page for more on configuration. This package also provides minimal
1150 compatibility shims for the @command{sendmail}, @command{mailq}, and
1151 @command{newaliases} commands.")
1160 (uri (string-append "https://github.com/nicm/fdm/releases/download/"
1163 (file-name (string-append name "-" version ".tar.gz"))
1165 (base32 "054rscijahiza5f9qha79rg3siji3bk5mk10f8c2vqx7m4w6qh8n"))))
1166 (build-system gnu-build-system)
1169 ("openssl" ,openssl)
1171 (home-page "https://github.com/nicm/fdm")
1172 (synopsis "Mail Retrieval Agent (MRA) and Mail Delivery Agent (MDA)")
1173 (description "fdm is a program designed to fetch mail from POP3
1174 or IMAP servers, or receive local mail from stdin, and
1175 deliver it in various ways.")
1177 ;; Why point to a source file? Well, all the individual files have a
1178 ;; copy of this license in their headers, but there's no seprate file
1179 ;; with that information.
1180 (non-copyleft "https://github.com/nicm/fdm/blob/master/command.c"))))
1183 (define-public procmail
1191 "ftp://ftp.fu-berlin.de/pub/unix/mail/procmail/procmail-"
1196 "05z1c803n5cppkcq99vkyd5myff904lf9sdgynfqngfk9nrpaz08"))
1197 ;; The following patch fixes an ambiguous definition of
1198 ;; getline() in formail.c. The patch is provided by Debian as
1200 (patches (search-patches "procmail-ambiguous-getline-debian.patch"
1201 "procmail-CVE-2014-3618.patch"))))
1203 `(#:phases (modify-phases %standard-phases
1206 (substitute* "Makefile"
1210 (assoc-ref %outputs "out"))
1214 #:tests? #f)) ;; There are no tests indicating a successful
1215 ;; build. Some tests of basic locking mechanisms provided by the
1216 ;; file system are performed during 'make install'. However, these
1217 ;; are performed before the actual build process.
1218 (build-system gnu-build-system)
1219 (inputs `(("exim" ,exim)))
1220 (home-page "http://www.procmail.org/")
1221 (synopsis "Versatile mail delivery agent (MDA)")
1222 (description "Procmail is a mail delivery agent (MDA) featuring support
1223 for a variety of mailbox formats such as mbox, mh and maildir. Incoming mail
1224 can be sorted into separate files/directories and arbitrary commands can be
1225 executed on mail arrival. Procmail is considered stable, but is no longer
1227 (license gpl2+))) ;; procmail allows to choose the
1228 ;; nonfree Artistic License 1.0
1229 ;; as alternative to the GPL2+.
1230 ;; This option is not listed here.
1232 (define-public khard
1238 (uri (pypi-uri name version))
1241 "0y83rji4f270hbb41m4jpr0z3yzvpvbsl32mpg9d38hlydw8fk1s"))))
1242 (build-system python-build-system)
1244 `(#:python ,python-2 ; only python-2 is supported.
1246 (modify-phases %standard-phases
1247 (add-before 'build 'disable-egg-compression
1248 ;; Do not compress the egg.
1250 (let ((port (open-file "setup.cfg" "a")))
1251 (display "\n[easy_install]\nzip_ok = 0\n"
1255 (add-after 'install 'install-doc
1256 (lambda* (#:key outputs #:allow-other-keys)
1257 (let* ((out (assoc-ref outputs "out"))
1258 (doc (string-append out "/share/doc/khard")))
1259 (copy-recursively "misc/khard" doc)))))))
1261 `(("python2-setuptools" ,python2-setuptools)))
1263 `(("python2-vobject" ,python2-vobject)
1264 ("python2-pyyaml" ,python2-pyyaml)
1265 ("python2-atomicwrites" ,python2-atomicwrites)
1266 ("python2-configobj" ,python2-configobj)))
1267 (synopsis "Console address book using CardDAV")
1268 (description "Khard is an address book for the console. It creates, reads,
1269 modifies and removes CardDAV address book entries at your local machine. For
1270 synchronizing with a remote address book, @command{vdirsyncer} is recommended.
1271 Khard can also be used from within the email client @command{mutt}.")
1272 (home-page "https://github.com/scheibler/khard")
1275 (define-public perl-mail-spf
1277 (name "perl-mail-spf")
1283 "mirror://cpan/authors/id/J/JM/JMEHNLE/mail-spf/Mail-SPF-"
1288 "0qk1rfgfm5drj4iyniiabrasrpqv570vzhgz66lwgb67y4amkjv1"))))
1289 (build-system perl-build-system)
1291 `(("perl-module-build" ,perl-module-build)
1292 ("perl-net-dns-resolver-programmable"
1293 ,perl-net-dns-resolver-programmable)))
1295 `(#:phases (modify-phases %standard-phases
1296 (add-before 'configure 'modify-Build.PL
1297 (lambda* (#:key outputs #:allow-other-keys)
1298 (substitute* "Build.PL"
1299 (("'/usr/sbin'") (string-append "'"
1300 (assoc-ref outputs "out")
1304 `(("perl-error" ,perl-error)
1305 ("perl-net-dns" ,perl-net-dns)
1306 ("perl-netaddr-ip" ,perl-netaddr-ip)
1307 ("perl-uri" ,perl-uri)))
1309 "http://search.cpan.org/dist/Mail-SPF")
1311 "Perl implementation of Sender Policy Framework")
1312 (description "Mail::SPF is the Sender Policy Framework implemented
1316 (define-public mb2md
1323 "http://batleth.sapienti-sat.org/projects/mb2md/mb2md-"
1327 "0bvkky3c90738h3skd2f1b2yy5xzhl25cbh9w2dy97rs86ssjidg"))))
1328 (build-system trivial-build-system)
1330 '(#:modules ((guix build utils))
1333 (use-modules (guix build utils))
1334 (let* ((source (assoc-ref %build-inputs "source"))
1335 (out (assoc-ref %outputs "out"))
1336 (bin (string-append out "/bin"))
1337 (perl (assoc-ref %build-inputs "perl"))
1338 (gzip (assoc-ref %build-inputs "gzip"))
1339 (perl-timedate (assoc-ref %build-inputs "perl-timedate"))
1340 (perl5lib (string-append perl-timedate "/lib/perl5/site_perl")))
1342 (with-directory-excursion bin
1343 (copy-file source "mb2md.gz")
1344 (system* (string-append gzip "/bin/gzip") "-d" "mb2md.gz")
1345 (substitute* "mb2md"
1346 (("#!/usr/bin/perl")
1347 (string-append "#!/usr/bin/perl -I " perl5lib)))
1348 (patch-shebang "mb2md" (list (string-append perl "/bin")))
1349 (chmod "mb2md" #o555))
1351 (native-inputs `(("gzip", gzip)))
1352 (inputs `(("perl" ,perl)
1353 ("perl-timedate" ,perl-timedate)))
1354 (home-page "http://batleth.sapienti-sat.org/projects/mb2md/")
1355 (synopsis "Mbox to maildir converter")
1357 "Mb2md is a Perl script that takes one or more mbox format files and
1358 converts them to maildir format directories.")
1359 (license public-domain)))
1368 (uri (string-append "http://downloads.sourceforge.net/mpop/mpop-"
1372 "0n0ij258kn8lfa6nyr6l6plc4hf1wvyf1hkwicvdbjqdqrgjnq81"))))
1373 (build-system gnu-build-system)
1375 `(("gnutls" ,gnutls)
1376 ("libidn" ,libidn)))
1378 `(("pkg-config" ,pkg-config)))
1380 `(#:configure-flags (list "--with-tls=gnutls")))
1381 (home-page "http://mpop.sourceforge.net/")
1382 (synopsis "POP3 mail client")
1383 (description "mpop is a small and fast POP3 client suitable as a
1384 fetchmail replacement.
1386 mpop supports multiple accounts, header based mail filtering, delivery
1387 to mbox files, maildir folders or a Mail Delivery Agent (MDA),
1388 TLS/SSL, several authentication methods, Internationalized Domain
1389 Names (IDN) and SOCKS proxies.")
1392 (define-public mhonarc
1399 (uri (string-append "mirror://cpan/authors/id/E/EH/EHOOD/MHonArc-"
1403 "0ll3v93yji334zqp6xfzfxc0127pmjcznmai1l5q6dzawrs2igzq"))))
1404 (build-system perl-build-system)
1405 (home-page "https://www.mhonarc.org/")
1406 (synopsis "Create HTML archives of mail/news messages")
1408 "MHonArc is a Perl mail-to-HTML converter. MHonArc
1409 provides HTML mail archiving with index, mail thread linking,
1410 etc; plus other capabilities including support for MIME and
1411 powerful user customization features.")