Merge branch 'master' into core-updates
[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 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
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.
11 ;;;
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.
16 ;;;
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/>.
19
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 ((guix licenses)
48 #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ lgpl3+))
49 #:use-module (guix packages)
50 #:use-module (guix download)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system python)
53 #:use-module (srfi srfi-1))
54
55 (define-public mailutils
56 (package
57 (name "mailutils")
58 (version "2.2")
59 (source (origin
60 (method url-fetch)
61 (uri (string-append "mirror://gnu/mailutils/mailutils-"
62 version ".tar.bz2"))
63 (sha256
64 (base32
65 "0szbqa12zqzldqyw97lxqax3ja2adis83i7brdfsxmrfw68iaf65"))
66 (patches (list (search-patch "m4-gets-undeclared.patch")))))
67 (build-system gnu-build-system)
68 (arguments
69 '(;; TODO: Add `--with-sql'.
70 #:phases (alist-cons-before
71 'build 'pre-build
72 (lambda _
73 ;; Use Guile 2.0's public API.
74 (substitute* "libmu_scm/mu_message.c"
75 (("scm_i_string_length")
76 "scm_c_string_length"))
77
78 ;; This file should be generated to use the right
79 ;; value of $(libdir) et al.
80 (delete-file "libmu_scm/mailutils.scm")
81
82 ;; Use the right file name for `cat'.
83 (substitute* "testsuite/lib/mailutils.exp"
84 (("/bin/cat")
85 (which "cat"))))
86 %standard-phases)
87 #:parallel-tests? #f))
88 (inputs
89 `(("dejagnu" ,dejagnu)
90 ("m4" ,m4)
91 ("texinfo" ,texinfo)
92 ("guile" ,guile-2.0)
93 ("gnutls" ,gnutls)
94 ("ncurses" ,ncurses)
95
96 ;; With Readline 6.3, examples/pop3client.c fails to build because it
97 ;; uses the now undefined 'CPPFunction' type.
98 ("readline" ,readline-6.2)
99
100 ("linux-pam" ,linux-pam)
101 ("libtool" ,libtool)
102 ("gdbm" ,gdbm)))
103 (home-page "http://www.gnu.org/software/mailutils/")
104 (synopsis "Utilities and library for reading and serving mail")
105 (description
106 "GNU Mailutils is a collection of programs for managing, viewing and
107 processing electronic mail. It contains both utilities and server daemons
108 and all operate in a protocol-agnostic way. The underlying libraries are
109 also available, simplifying the addition of mail capabilities to new
110 software.")
111 (license
112 ;; Libraries are under LGPLv3+, and programs under GPLv3+.
113 (list gpl3+ lgpl3+))))
114
115 (define-public fetchmail
116 (package
117 (name "fetchmail")
118 (version "6.3.26")
119 (source (origin
120 (method url-fetch)
121 (uri (string-append "mirror://sourceforge/fetchmail/branch_6.3/fetchmail-"
122 version ".tar.xz"))
123 (sha256
124 (base32
125 "0l78ayvi9dm8hd190gl139cs2xqsrf7r9ncilslw20mgvd6cbd3r"))))
126 (build-system gnu-build-system)
127 (inputs
128 `(("openssl" ,openssl)))
129 (arguments
130 `(#:configure-flags (list (string-append "--with-ssl="
131 (assoc-ref %build-inputs "openssl")))))
132 (home-page "http://fetchmail.berlios.de/")
133 (synopsis "Remote-mailr etrieval and forwarding utility")
134 (description
135 "Fetchmail is a full-featured, robust, well-documented remote-mail
136 retrieval and forwarding utility intended to be used over on-demand
137 TCP/IP links (such as SLIP or PPP connections). It supports every
138 remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP,
139 KPOP, all flavors of IMAP, ETRN, and ODMR. It can even support IPv6
140 and IPSEC.
141
142 Fetchmail retrieves mail from remote mail servers and forwards it via SMTP,
143 so it can then be read by normal mail user agents such as mutt, elm
144 or BSD Mail. It allows all your system MTA's filtering, forwarding, and
145 aliasing facilities to work just as they would on normal mail.")
146 (license gpl2+))) ; most files are actually public domain or x11
147
148 (define-public mutt
149 (package
150 (name "mutt")
151 (version "1.5.23")
152 (source (origin
153 (method url-fetch)
154 (uri (list ;; Temporarily put bitbucket first, because
155 ;; ftp.mutt.org has been down for a while.
156 (string-append "https://bitbucket.org/mutt/mutt/downloads/mutt-"
157 version ".tar.gz")
158 (string-append "ftp://ftp.mutt.org/mutt/devel/mutt-"
159 version ".tar.gz")))
160 (sha256
161 (base32
162 "0dzx4qk50pjfsb6cs5jahng96a52k12f7pm0sc78iqdrawg71w1s"))))
163 (build-system gnu-build-system)
164 (inputs
165 `(("cyrus-sasl" ,cyrus-sasl)
166 ("gpgme" ,gpgme)
167 ("ncurses" ,ncurses)
168 ("openssl" ,openssl)
169 ("perl" ,perl)))
170 (arguments
171 `(#:configure-flags '("--enable-smtp"
172 "--enable-imap"
173 "--enable-pop"
174 "--enable-gpgme"
175 "--with-ssl"
176 "--with-sasl"
177 ;; so that mutt does not check whether the path
178 ;; exists, which it does not in the chroot
179 "--with-mailpath=/var/mail")))
180 (home-page "http://www.mutt.org/")
181 (synopsis "Mail client")
182 (description
183 "Mutt is a small but very powerful text-based mail client for Unix
184 operating systems.")
185 (license gpl2+)))
186
187 (define-public gmime
188 (package
189 (name "gmime")
190 (version "2.6.19")
191 (source (origin
192 (method url-fetch)
193 (uri (string-append "mirror://gnome/sources/gmime/"
194 (string-join (take (string-split version #\.)
195 2)
196 ".")
197 "/gmime-" version ".tar.xz"))
198 (sha256
199 (base32
200 "0jm1fgbjgh496rsc0il2y46qd4bqq2ln9168p4zzh68mk4ml1yxg"))))
201 (build-system gnu-build-system)
202 (native-inputs
203 `(("pkg-config" ,pkg-config)
204 ("gnupg" ,gnupg))) ; for tests only
205 (inputs `(("glib" ,glib)
206 ("gpgme" ,gpgme)
207 ("zlib" ,zlib)))
208 (arguments
209 `(#:phases
210 (alist-cons-after
211 'unpack 'patch-paths-in-tests
212 (lambda _
213 ;; The test programs run several programs using 'system'
214 ;; with hard-coded paths. Here we patch them all. We also
215 ;; change "gpg" to "gpg2".
216 (substitute* (find-files "tests" "\\.c$")
217 (("(system *\\(\")(/[^ ]*)" all pre prog-path)
218 (let* ((base (basename prog-path))
219 (prog (which (if (string=? base "gpg") "gpg2" base))))
220 (string-append pre (or prog (error "not found: " base)))))))
221 %standard-phases)))
222 (home-page "http://spruce.sourceforge.net/gmime/")
223 (synopsis "MIME message parser and creator library")
224 (description
225 "GMime provides a core library and set of utilities which may be used for
226 the creation and parsing of messages using the Multipurpose Internet Mail
227 Extension (MIME).")
228 (license (list lgpl2.1+ gpl2+ gpl3+))))
229
230 (define-public bogofilter
231 (package
232 (name "bogofilter")
233 (version "1.2.4")
234 (source (origin
235 (method url-fetch)
236 (uri (string-append "mirror://sourceforge/bogofilter/bogofilter-"
237 version "/bogofilter-"
238 version ".tar.bz2"))
239 (sha256
240 (base32
241 "1d56n2m9inm8gnzm88aa27xl2a7sp7aff3484vmflpqkinjqf0p1"))))
242 (build-system gnu-build-system)
243 (arguments
244 '(#:phases (alist-cons-before
245 'check 'pre-check
246 (lambda _
247 (substitute* "src/tests/t.frame"
248 (("GREP=/bin/grep")
249 (string-append "GREP=" (which "grep") "\n"))))
250 %standard-phases)))
251 (native-inputs `(("flex" ,flex)))
252 (inputs `(("bdb" ,bdb)))
253 (home-page "http://bogofilter.sourceforge.net/")
254 (synopsis "Mail classifier based on a Bayesian filter")
255 (description
256 "Bogofilter is a mail filter that classifies mail as spam or ham
257 (non-spam) by a statistical analysis of the message's header and
258 content (body). The program is able to learn from the user's classifications
259 and corrections. It is based on a Bayesian filter.")
260 (license gpl2)))
261
262 (define-public offlineimap
263 (package
264 (name "offlineimap")
265 (version "6.5.5")
266 (source (origin
267 (method url-fetch)
268 (uri (string-append "https://github.com/OfflineIMAP/offlineimap/"
269 "archive/v" version ".tar.gz"))
270 (sha256
271 (base32
272 "00k84qagph3xnxss6rkxm61x07ngz8fvffx4z9jyw5baf3cdd32p"))))
273 (build-system python-build-system)
274 (native-inputs `(("python" ,python-2)))
275 (arguments
276 ;; The setup.py script expects python-2.
277 `(#:python ,python-2
278 ;; Tests require a modifiable IMAP account.
279 #:tests? #f))
280 (home-page "http://www.offlineimap.org")
281 (synopsis "Synch emails between two repositories")
282 (description
283 "OfflineImap synchronizes emails between two repositories, so that you
284 can read the same mailbox from multiple computers. It supports IMAP as REMOTE
285 repository and Maildir/IMAP as LOCAL repository.")
286 (license gpl2+)))
287
288 (define-public mu
289 (package
290 (name "mu")
291 (version "0.9.9.5")
292 (source (origin
293 (method url-fetch)
294 (uri (string-append "https://mu0.googlecode.com/files/mu-"
295 version ".tar.gz"))
296 (sha256
297 (base32
298 "1hwkliyb8fjrz5sw9fcisssig0jkdxzhccw0ld0l9a10q1l9mqhp"))))
299 (build-system gnu-build-system)
300 (native-inputs
301 `(("pkg-config" ,pkg-config)
302 ("texinfo" ,texinfo)))
303 ;; TODO: Add webkit and gtk to build the mug GUI.
304 (inputs
305 `(("xapian" ,xapian)
306 ("emacs" ,emacs)
307 ("guile" ,guile-2.0)
308 ("glib" ,glib)
309 ("gmime" ,gmime)
310 ("tzdata" ,tzdata))) ;for mu/test/test-mu-query.c
311 (arguments
312 '(#:phases (alist-cons-before
313 'check 'check-tz-setup
314 (lambda* (#:key inputs #:allow-other-keys)
315 ;; For mu/test/test-mu-query.c
316 (setenv "TZDIR"
317 (string-append (assoc-ref inputs "tzdata")
318 "/share/zoneinfo")))
319 %standard-phases)))
320 (home-page "http://www.djcbsoftware.nl/code/mu/")
321 (synopsis "Quickly find emails")
322 (description
323 "Mu is a tool for dealing with e-mail messages stored in the
324 Maildir-format. Mu's purpose in life is to help you to quickly find the
325 messages you need; in addition, it allows you to view messages, extract
326 attachments, create new maildirs, and so on.")
327 (license gpl3+)))
328
329 ;;; mail.scm ends here