1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages mail)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages autotools)
23 #:use-module (gnu packages base)
24 #:use-module (gnu packages cyrus-sasl)
25 #:use-module (gnu packages dejagnu)
26 #:use-module (gnu packages emacs)
27 #:use-module (gnu packages gdbm)
28 #:use-module (gnu packages glib)
29 #:use-module (gnu packages gnupg)
30 #:use-module (gnu packages gnutls)
31 #:use-module (gnu packages guile)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages m4)
34 #:use-module (gnu packages mysql)
35 #:use-module (gnu packages ncurses)
36 #:use-module (gnu packages openssl)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages readline)
40 #:use-module (gnu packages search)
41 #:use-module (gnu packages texinfo)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages glib)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages flex)
46 #:use-module (gnu packages bdb)
47 #:use-module (gnu packages gdb)
48 #:use-module (gnu packages samba)
49 #:use-module ((guix licenses)
50 #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ lgpl3+))
51 #:use-module (guix packages)
52 #:use-module (guix download)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system python)
55 #:use-module (srfi srfi-1))
57 (define-public mailutils
63 (uri (string-append "mirror://gnu/mailutils/mailutils-"
67 "0szbqa12zqzldqyw97lxqax3ja2adis83i7brdfsxmrfw68iaf65"))
68 (patches (list (search-patch "m4-gets-undeclared.patch")))))
69 (build-system gnu-build-system)
71 '(;; TODO: Add `--with-sql'.
72 #:phases (alist-cons-before
75 ;; Use Guile 2.0's public API.
76 (substitute* "libmu_scm/mu_message.c"
77 (("scm_i_string_length")
78 "scm_c_string_length"))
80 ;; This file should be generated to use the right
81 ;; value of $(libdir) et al.
82 (delete-file "libmu_scm/mailutils.scm")
84 ;; Use the right file name for `cat'.
85 (substitute* "testsuite/lib/mailutils.exp"
89 #:parallel-tests? #f))
91 `(("dejagnu" ,dejagnu)
98 ;; With Readline 6.3, examples/pop3client.c fails to build because it
99 ;; uses the now undefined 'CPPFunction' type.
100 ("readline" ,readline-6.2)
102 ("linux-pam" ,linux-pam)
105 (home-page "http://www.gnu.org/software/mailutils/")
106 (synopsis "Utilities and library for reading and serving mail")
108 "GNU Mailutils is a collection of programs for managing, viewing and
109 processing electronic mail. It contains both utilities and server daemons
110 and all operate in a protocol-agnostic way. The underlying libraries are
111 also available, simplifying the addition of mail capabilities to new
114 ;; Libraries are under LGPLv3+, and programs under GPLv3+.
115 (list gpl3+ lgpl3+))))
117 (define-public fetchmail
123 (uri (string-append "mirror://sourceforge/fetchmail/branch_6.3/fetchmail-"
127 "0l78ayvi9dm8hd190gl139cs2xqsrf7r9ncilslw20mgvd6cbd3r"))))
128 (build-system gnu-build-system)
130 `(("openssl" ,openssl)))
132 `(#:configure-flags (list (string-append "--with-ssl="
133 (assoc-ref %build-inputs "openssl")))))
134 (home-page "http://fetchmail.berlios.de/")
135 (synopsis "Remote-mailr etrieval and forwarding utility")
137 "Fetchmail is a full-featured, robust, well-documented remote-mail
138 retrieval and forwarding utility intended to be used over on-demand
139 TCP/IP links (such as SLIP or PPP connections). It supports every
140 remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP,
141 KPOP, all flavors of IMAP, ETRN, and ODMR. It can even support IPv6
144 Fetchmail retrieves mail from remote mail servers and forwards it via SMTP,
145 so it can then be read by normal mail user agents such as mutt, elm
146 or BSD Mail. It allows all your system MTA's filtering, forwarding, and
147 aliasing facilities to work just as they would on normal mail.")
148 (license gpl2+))) ; most files are actually public domain or x11
156 (uri (list ;; Temporarily put bitbucket first, because
157 ;; ftp.mutt.org has been down for a while.
158 (string-append "https://bitbucket.org/mutt/mutt/downloads/mutt-"
160 (string-append "ftp://ftp.mutt.org/mutt/devel/mutt-"
164 "0dzx4qk50pjfsb6cs5jahng96a52k12f7pm0sc78iqdrawg71w1s"))))
165 (build-system gnu-build-system)
167 `(("cyrus-sasl" ,cyrus-sasl)
173 `(#:configure-flags '("--enable-smtp"
179 ;; so that mutt does not check whether the path
180 ;; exists, which it does not in the chroot
181 "--with-mailpath=/var/mail")))
182 (home-page "http://www.mutt.org/")
183 (synopsis "Mail client")
185 "Mutt is a small but very powerful text-based mail client for Unix
195 (uri (string-append "mirror://gnome/sources/gmime/"
196 (string-join (take (string-split version #\.)
199 "/gmime-" version ".tar.xz"))
202 "0jm1fgbjgh496rsc0il2y46qd4bqq2ln9168p4zzh68mk4ml1yxg"))))
203 (build-system gnu-build-system)
205 `(("pkg-config" ,pkg-config)
206 ("gnupg" ,gnupg))) ; for tests only
207 (inputs `(("glib" ,glib)
213 'unpack 'patch-paths-in-tests
215 ;; The test programs run several programs using 'system'
216 ;; with hard-coded paths. Here we patch them all. We also
217 ;; change "gpg" to "gpg2".
218 (substitute* (find-files "tests" "\\.c$")
219 (("(system *\\(\")(/[^ ]*)" all pre prog-path)
220 (let* ((base (basename prog-path))
221 (prog (which (if (string=? base "gpg") "gpg2" base))))
222 (string-append pre (or prog (error "not found: " base)))))))
224 (home-page "http://spruce.sourceforge.net/gmime/")
225 (synopsis "MIME message parser and creator library")
227 "GMime provides a core library and set of utilities which may be used for
228 the creation and parsing of messages using the Multipurpose Internet Mail
230 (license (list lgpl2.1+ gpl2+ gpl3+))))
232 (define-public bogofilter
238 (uri (string-append "mirror://sourceforge/bogofilter/bogofilter-"
239 version "/bogofilter-"
243 "1d56n2m9inm8gnzm88aa27xl2a7sp7aff3484vmflpqkinjqf0p1"))))
244 (build-system gnu-build-system)
246 '(#:phases (alist-cons-before
249 (substitute* "src/tests/t.frame"
251 (string-append "GREP=" (which "grep") "\n"))))
253 (native-inputs `(("flex" ,flex)))
254 (inputs `(("bdb" ,bdb)))
255 (home-page "http://bogofilter.sourceforge.net/")
256 (synopsis "Mail classifier based on a Bayesian filter")
258 "Bogofilter is a mail filter that classifies mail as spam or ham
259 (non-spam) by a statistical analysis of the message's header and
260 content (body). The program is able to learn from the user's classifications
261 and corrections. It is based on a Bayesian filter.")
264 (define-public offlineimap
270 (uri (string-append "https://github.com/OfflineIMAP/offlineimap/"
271 "archive/v" version ".tar.gz"))
274 "00k84qagph3xnxss6rkxm61x07ngz8fvffx4z9jyw5baf3cdd32p"))))
275 (build-system python-build-system)
276 (native-inputs `(("python" ,python-2)))
278 ;; The setup.py script expects python-2.
280 ;; Tests require a modifiable IMAP account.
282 (home-page "http://www.offlineimap.org")
283 (synopsis "Synch emails between two repositories")
285 "OfflineImap synchronizes emails between two repositories, so that you
286 can read the same mailbox from multiple computers. It supports IMAP as REMOTE
287 repository and Maildir/IMAP as LOCAL repository.")
296 (uri (string-append "https://mu0.googlecode.com/files/mu-"
300 "1hwkliyb8fjrz5sw9fcisssig0jkdxzhccw0ld0l9a10q1l9mqhp"))))
301 (build-system gnu-build-system)
303 `(("pkg-config" ,pkg-config)
304 ("texinfo" ,texinfo)))
305 ;; TODO: Add webkit and gtk to build the mug GUI.
312 ("tzdata" ,tzdata))) ;for mu/test/test-mu-query.c
314 '(#:phases (alist-cons-before
315 'check 'check-tz-setup
316 (lambda* (#:key inputs #:allow-other-keys)
317 ;; For mu/test/test-mu-query.c
319 (string-append (assoc-ref inputs "tzdata")
322 (home-page "http://www.djcbsoftware.nl/code/mu/")
323 (synopsis "Quickly find emails")
325 "Mu is a tool for dealing with e-mail messages stored in the
326 Maildir-format. Mu's purpose in life is to help you to quickly find the
327 messages you need; in addition, it allows you to view messages, extract
328 attachments, create new maildirs, and so on.")
331 (define-public notmuch
337 (uri (string-append "http://notmuchmail.org/releases/notmuch-"
341 "1ia65iazz2hlp3ja57yn0chs27rzsky9kayw74njwmgi9faw3vh9"))))
342 (build-system gnu-build-system)
344 '(#:tests? #f ;; FIXME: Test suite hangs and times out.
345 #:phases (alist-replace
347 (lambda* (#:key outputs #:allow-other-keys)
348 (setenv "CONFIG_SHELL" (which "sh"))
349 (let ((out (assoc-ref outputs "out")))
350 (zero? (system* "./configure"
351 (string-append "--prefix=" out)))))
354 `(("pkg-config" ,pkg-config)))
362 (home-page "http://notmuchmail.org/")
363 (synopsis "Thread-based email index, search, and tagging")
365 "Notmuch is a command-line based program for indexing, searching, read-
366 ing, and tagging large collections of email messages.")
369 ;;; mail.scm ends here