gnu: Add libetpan.
[jackhill/guix/guix.git] / gnu / packages / mail.scm
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>
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 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages mail)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages autotools)
26 #:use-module (gnu packages base)
27 #:use-module (gnu packages curl)
28 #:use-module (gnu packages cyrus-sasl)
29 #:use-module (gnu packages dejagnu)
30 #:use-module (gnu packages emacs)
31 #:use-module (gnu packages gdbm)
32 #:use-module (gnu packages glib)
33 #:use-module (gnu packages gnupg)
34 #:use-module (gnu packages gnutls)
35 #:use-module (gnu packages guile)
36 #:use-module (gnu packages linux)
37 #:use-module (gnu packages m4)
38 #:use-module (gnu packages databases)
39 #:use-module (gnu packages ncurses)
40 #:use-module (gnu packages openssl)
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages readline)
44 #:use-module (gnu packages search)
45 #:use-module (gnu packages texinfo)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages flex)
50 #:use-module (gnu packages gdb)
51 #:use-module (gnu packages samba)
52 #:use-module (gnu packages xml)
53 #:use-module ((guix licenses)
54 #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ lgpl3+ bsd-style))
55 #:use-module (guix packages)
56 #:use-module (guix download)
57 #:use-module (guix utils)
58 #:use-module (guix build-system gnu)
59 #:use-module (guix build-system python))
60
61 (define-public mailutils
62 (package
63 (name "mailutils")
64 (version "2.2")
65 (source (origin
66 (method url-fetch)
67 (uri (string-append "mirror://gnu/mailutils/mailutils-"
68 version ".tar.bz2"))
69 (sha256
70 (base32
71 "0szbqa12zqzldqyw97lxqax3ja2adis83i7brdfsxmrfw68iaf65"))
72 (patches (list (search-patch "m4-gets-undeclared.patch")))))
73 (build-system gnu-build-system)
74 (arguments
75 '(;; TODO: Add `--with-sql'.
76 #:phases (alist-cons-before
77 'build 'pre-build
78 (lambda _
79 ;; Use Guile 2.0's public API.
80 (substitute* "libmu_scm/mu_message.c"
81 (("scm_i_string_length")
82 "scm_c_string_length"))
83
84 ;; This file should be generated to use the right
85 ;; value of $(libdir) et al.
86 (delete-file "libmu_scm/mailutils.scm")
87
88 ;; Use the right file name for `cat'.
89 (substitute* "testsuite/lib/mailutils.exp"
90 (("/bin/cat")
91 (which "cat"))))
92 %standard-phases)
93 #:parallel-tests? #f))
94 (inputs
95 `(("dejagnu" ,dejagnu)
96 ("m4" ,m4)
97 ("texinfo" ,texinfo)
98 ("guile" ,guile-2.0)
99 ("gnutls" ,gnutls)
100 ("ncurses" ,ncurses)
101
102 ;; With Readline 6.3, examples/pop3client.c fails to build because it
103 ;; uses the now undefined 'CPPFunction' type.
104 ("readline" ,readline-6.2)
105
106 ("linux-pam" ,linux-pam)
107 ("libtool" ,libtool)
108 ("gdbm" ,gdbm)))
109 (home-page "http://www.gnu.org/software/mailutils/")
110 (synopsis "Utilities and library for reading and serving mail")
111 (description
112 "GNU Mailutils is a collection of programs for managing, viewing and
113 processing electronic mail. It contains both utilities and server daemons
114 and all operate in a protocol-agnostic way. The underlying libraries are
115 also available, simplifying the addition of mail capabilities to new
116 software.")
117 (license
118 ;; Libraries are under LGPLv3+, and programs under GPLv3+.
119 (list gpl3+ lgpl3+))))
120
121 (define-public fetchmail
122 (package
123 (name "fetchmail")
124 (version "6.3.26")
125 (source (origin
126 (method url-fetch)
127 (uri (string-append "mirror://sourceforge/fetchmail/branch_6.3/fetchmail-"
128 version ".tar.xz"))
129 (sha256
130 (base32
131 "0l78ayvi9dm8hd190gl139cs2xqsrf7r9ncilslw20mgvd6cbd3r"))))
132 (build-system gnu-build-system)
133 (inputs
134 `(("openssl" ,openssl)))
135 (arguments
136 `(#:configure-flags (list (string-append "--with-ssl="
137 (assoc-ref %build-inputs "openssl")))))
138 (home-page "http://fetchmail.berlios.de/")
139 (synopsis "Remote-mail retrieval and forwarding utility")
140 (description
141 "Fetchmail is a full-featured, robust, well-documented remote-mail
142 retrieval and forwarding utility intended to be used over on-demand
143 TCP/IP links (such as SLIP or PPP connections). It supports every
144 remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP,
145 KPOP, all flavors of IMAP, ETRN, and ODMR. It can even support IPv6
146 and IPSEC.
147
148 Fetchmail retrieves mail from remote mail servers and forwards it via SMTP,
149 so it can then be read by normal mail user agents such as mutt, elm
150 or BSD Mail. It allows all your system MTA's filtering, forwarding, and
151 aliasing facilities to work just as they would on normal mail.")
152 (license gpl2+))) ; most files are actually public domain or x11
153
154 (define-public mutt
155 (package
156 (name "mutt")
157 (version "1.5.23")
158 (source (origin
159 (method url-fetch)
160 (uri (list ;; Temporarily put bitbucket first, because
161 ;; ftp.mutt.org has been down for a while.
162 (string-append "https://bitbucket.org/mutt/mutt/downloads/mutt-"
163 version ".tar.gz")
164 (string-append "ftp://ftp.mutt.org/mutt/devel/mutt-"
165 version ".tar.gz")))
166 (sha256
167 (base32
168 "0dzx4qk50pjfsb6cs5jahng96a52k12f7pm0sc78iqdrawg71w1s"))))
169 (build-system gnu-build-system)
170 (inputs
171 `(("cyrus-sasl" ,cyrus-sasl)
172 ("gpgme" ,gpgme)
173 ("ncurses" ,ncurses)
174 ("openssl" ,openssl)
175 ("perl" ,perl)))
176 (arguments
177 `(#:configure-flags '("--enable-smtp"
178 "--enable-imap"
179 "--enable-pop"
180 "--enable-gpgme"
181 "--with-ssl"
182 "--with-sasl"
183 ;; so that mutt does not check whether the path
184 ;; exists, which it does not in the chroot
185 "--with-mailpath=/var/mail")))
186 (home-page "http://www.mutt.org/")
187 (synopsis "Mail client")
188 (description
189 "Mutt is a small but very powerful text-based mail client for Unix
190 operating systems.")
191 (license gpl2+)))
192
193 (define-public gmime
194 (package
195 (name "gmime")
196 (version "2.6.19")
197 (source (origin
198 (method url-fetch)
199 (uri (string-append "mirror://gnome/sources/gmime/"
200 (version-major+minor version)
201 "/gmime-" version ".tar.xz"))
202 (sha256
203 (base32
204 "0jm1fgbjgh496rsc0il2y46qd4bqq2ln9168p4zzh68mk4ml1yxg"))))
205 (build-system gnu-build-system)
206 (native-inputs
207 `(("pkg-config" ,pkg-config)
208 ("gnupg" ,gnupg))) ; for tests only
209 (inputs `(("glib" ,glib)
210 ("gpgme" ,gpgme)
211 ("zlib" ,zlib)))
212 (arguments
213 `(#:phases
214 (alist-cons-after
215 'unpack 'patch-paths-in-tests
216 (lambda _
217 ;; The test programs run several programs using 'system'
218 ;; with hard-coded paths. Here we patch them all. We also
219 ;; change "gpg" to "gpg2".
220 (substitute* (find-files "tests" "\\.c$")
221 (("(system *\\(\")(/[^ ]*)" all pre prog-path)
222 (let* ((base (basename prog-path))
223 (prog (which (if (string=? base "gpg") "gpg2" base))))
224 (string-append pre (or prog (error "not found: " base)))))))
225 %standard-phases)))
226 (home-page "http://spruce.sourceforge.net/gmime/")
227 (synopsis "MIME message parser and creator library")
228 (description
229 "GMime provides a core library and set of utilities which may be used for
230 the creation and parsing of messages using the Multipurpose Internet Mail
231 Extension (MIME).")
232 (license (list lgpl2.1+ gpl2+ gpl3+))))
233
234 (define-public bogofilter
235 (package
236 (name "bogofilter")
237 (version "1.2.4")
238 (source (origin
239 (method url-fetch)
240 (uri (string-append "mirror://sourceforge/bogofilter/bogofilter-"
241 version "/bogofilter-"
242 version ".tar.bz2"))
243 (sha256
244 (base32
245 "1d56n2m9inm8gnzm88aa27xl2a7sp7aff3484vmflpqkinjqf0p1"))))
246 (build-system gnu-build-system)
247 (arguments
248 '(#:phases (alist-cons-before
249 'check 'pre-check
250 (lambda _
251 (substitute* "src/tests/t.frame"
252 (("GREP=/bin/grep")
253 (string-append "GREP=" (which "grep") "\n"))))
254 %standard-phases)))
255 (native-inputs `(("flex" ,flex)))
256 (inputs `(("bdb" ,bdb)))
257 (home-page "http://bogofilter.sourceforge.net/")
258 (synopsis "Mail classifier based on a Bayesian filter")
259 (description
260 "Bogofilter is a mail filter that classifies mail as spam or ham
261 (non-spam) by a statistical analysis of the message's header and
262 content (body). The program is able to learn from the user's classifications
263 and corrections. It is based on a Bayesian filter.")
264 (license gpl2)))
265
266 (define-public offlineimap
267 (package
268 (name "offlineimap")
269 (version "6.5.5")
270 (source (origin
271 (method url-fetch)
272 (uri (string-append "https://github.com/OfflineIMAP/offlineimap/"
273 "archive/v" version ".tar.gz"))
274 (sha256
275 (base32
276 "00k84qagph3xnxss6rkxm61x07ngz8fvffx4z9jyw5baf3cdd32p"))))
277 (build-system python-build-system)
278 (native-inputs `(("python" ,python-2)))
279 (arguments
280 ;; The setup.py script expects python-2.
281 `(#:python ,python-2
282 ;; Tests require a modifiable IMAP account.
283 #:tests? #f))
284 (home-page "http://www.offlineimap.org")
285 (synopsis "Synch emails between two repositories")
286 (description
287 "OfflineImap synchronizes emails between two repositories, so that you
288 can read the same mailbox from multiple computers. It supports IMAP as REMOTE
289 repository and Maildir/IMAP as LOCAL repository.")
290 (license gpl2+)))
291
292 (define-public mu
293 (package
294 (name "mu")
295 (version "0.9.9.5")
296 (source (origin
297 (method url-fetch)
298 (uri (string-append "https://mu0.googlecode.com/files/mu-"
299 version ".tar.gz"))
300 (sha256
301 (base32
302 "1hwkliyb8fjrz5sw9fcisssig0jkdxzhccw0ld0l9a10q1l9mqhp"))))
303 (build-system gnu-build-system)
304 (native-inputs
305 `(("pkg-config" ,pkg-config)
306 ("glib" ,glib "bin") ; for gtester
307 ("texinfo" ,texinfo)))
308 ;; TODO: Add webkit and gtk to build the mug GUI.
309 (inputs
310 `(("xapian" ,xapian)
311 ("emacs" ,emacs)
312 ("guile" ,guile-2.0)
313 ("glib" ,glib)
314 ("gmime" ,gmime)
315 ("tzdata" ,tzdata))) ;for mu/test/test-mu-query.c
316 (arguments
317 '(#:phases (alist-cons-before
318 'check 'check-tz-setup
319 (lambda* (#:key inputs #:allow-other-keys)
320 ;; For mu/test/test-mu-query.c
321 (setenv "TZDIR"
322 (string-append (assoc-ref inputs "tzdata")
323 "/share/zoneinfo")))
324 %standard-phases)))
325 (home-page "http://www.djcbsoftware.nl/code/mu/")
326 (synopsis "Quickly find emails")
327 (description
328 "Mu is a tool for dealing with e-mail messages stored in the
329 Maildir-format. Mu's purpose in life is to help you to quickly find the
330 messages you need; in addition, it allows you to view messages, extract
331 attachments, create new maildirs, and so on.")
332 (license gpl3+)))
333
334 (define-public notmuch
335 (package
336 (name "notmuch")
337 (version "0.18.1")
338 (source (origin
339 (method url-fetch)
340 (uri (string-append "http://notmuchmail.org/releases/notmuch-"
341 version ".tar.gz"))
342 (sha256
343 (base32
344 "1pdp9l7yv71d3fjb30qyccva8h03hvg88q4a00yi50v2j70kvmgj"))))
345 (build-system gnu-build-system)
346 (arguments
347 '(#:tests? #f ;; FIXME: Test suite hangs and times out.
348 #:phases (alist-replace
349 'configure
350 (lambda* (#:key outputs #:allow-other-keys)
351 (setenv "CONFIG_SHELL" (which "sh"))
352 (let ((out (assoc-ref outputs "out")))
353 (zero? (system* "./configure"
354 (string-append "--prefix=" out)))))
355 %standard-phases)))
356 (native-inputs
357 `(("pkg-config" ,pkg-config)))
358 (inputs
359 `(("emacs" ,emacs)
360 ("glib" ,glib)
361 ("gmime" ,gmime)
362 ("talloc" ,talloc)
363 ("xapian" ,xapian)
364 ("zlib" ,zlib)))
365 (home-page "http://notmuchmail.org/")
366 (synopsis "Thread-based email index, search, and tagging")
367 (description
368 "Notmuch is a command-line based program for indexing, searching, read-
369 ing, and tagging large collections of email messages.")
370 (license gpl3+)))
371
372 (define-public getmail
373 (package
374 (name "getmail")
375 (version "4.46.0")
376 (source
377 (origin
378 (method url-fetch)
379 (uri (string-append "http://pyropus.ca/software/getmail/old-versions/"
380 name "-" version ".tar.gz"))
381 (sha256
382 (base32
383 "15rqmm25pq6ll8aaqh8h6pfdkpqs7y6yismb3h3w1bz8j292c8zl"))))
384 (build-system python-build-system)
385 (arguments
386 `(#:tests? #f ; no tests
387 #:python ,python-2))
388 (home-page "http://pyropus.ca/software/getmail/")
389 (synopsis "Mail retriever")
390 (description
391 "A flexible, extensible mail retrieval system with support for
392 POP3, IMAP4, SSL variants of both, maildirs, mboxrd files, external MDAs,
393 arbitrary message filtering, single-user and domain-mailboxes, and many other
394 useful features.")
395
396 ;; License is specified in file '__init__.py'.
397 (license gpl2)))
398
399 (define-public libetpan
400 (package
401 (name "libetpan")
402 (version "1.6")
403 (source (origin
404 (method url-fetch)
405 (uri (string-append "https://github.com/dinhviethoa/" name
406 "/archive/" version ".tar.gz"))
407 (sha256
408 (base32 "05qyqx2c1ppb1jnrs3m52i60f9xlxfxdmb9dnwg4vqjv8kwv2qkr"))))
409 (build-system gnu-build-system)
410 (native-inputs `(("autoconf" ,(autoconf-wrapper))
411 ("automake" ,automake)
412 ("libtool" ,libtool "bin")
413 ("pkg-config" ,pkg-config)))
414 (propagated-inputs
415 ;; 'libetpan-config --libs' returns '-lssl -lcrypto -lsasl2', so these
416 ;; libraries need to be propagated.
417 `(("cyrus-sasl" ,cyrus-sasl)
418 ("openssl" ,openssl)))
419 (inputs
420 `(("curl" ,curl)
421 ("expat" ,expat)))
422 (arguments
423 '(#:phases (alist-cons-before
424 'configure 'autogen
425 (lambda _
426 (system* "./autogen.sh")) ;; Note: this fails because the
427 ;; generated configure script uses /bin/sh. It is
428 ;; replaced in the configure phase by the correct
429 ;; value. TODO: replace the configure phase by the
430 ;; autogen phase and have the SHELL variable be replaced
431 %standard-phases)
432 #:configure-flags
433 '("--disable-static" "--disable-db")))
434 (home-page "http://www.etpan.org/libetpan.html")
435 (synopsis "Portable middleware for email access")
436 (description
437 "The purpose of this mail library is to provide a portable, efficient
438 framework for different kinds of mail access: IMAP, SMTP, POP and NNTP. It
439 provides an API for C language. It's the low-level API used by MailCore and
440 MailCore 2.")
441 (license (bsd-style "file://COPYING"))))
442
443 ;;; mail.scm ends here