gnu: Add gmime.
[jackhill/guix/guix.git] / gnu / packages / mail.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 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 cyrus-sasl)
24 #:use-module (gnu packages dejagnu)
25 #:use-module (gnu packages gdbm)
26 #:use-module (gnu packages gnupg)
27 #:use-module (gnu packages gnutls)
28 #:use-module (gnu packages guile)
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages m4)
31 #:use-module (gnu packages mysql)
32 #:use-module (gnu packages ncurses)
33 #:use-module (gnu packages openssl)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages readline)
36 #:use-module (gnu packages texinfo)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages glib)
39 #:use-module (gnu packages pkg-config)
40 #:use-module ((guix licenses)
41 #:select (gpl2+ gpl3+ lgpl2.1+ lgpl3+))
42 #:use-module (guix packages)
43 #:use-module (guix download)
44 #:use-module (guix build-system gnu)
45 #:use-module (srfi srfi-1))
46
47 (define-public mailutils
48 (package
49 (name "mailutils")
50 (version "2.2")
51 (source (origin
52 (method url-fetch)
53 (uri (string-append "mirror://gnu/mailutils/mailutils-"
54 version ".tar.bz2"))
55 (sha256
56 (base32
57 "0szbqa12zqzldqyw97lxqax3ja2adis83i7brdfsxmrfw68iaf65"))
58 (patches (list (search-patch "m4-gets-undeclared.patch")))))
59 (build-system gnu-build-system)
60 (arguments
61 '(;; TODO: Add `--with-sql'.
62 #:phases (alist-cons-before
63 'build 'pre-build
64 (lambda _
65 ;; Use Guile 2.0's public API.
66 (substitute* "libmu_scm/mu_message.c"
67 (("scm_i_string_length")
68 "scm_c_string_length"))
69
70 ;; This file should be generated to use the right
71 ;; value of $(libdir) et al.
72 (delete-file "libmu_scm/mailutils.scm")
73
74 ;; Use the right file name for `cat'.
75 (substitute* "testsuite/lib/mailutils.exp"
76 (("/bin/cat")
77 (which "cat"))))
78 %standard-phases)
79 #:parallel-tests? #f))
80 (inputs
81 `(("dejagnu" ,dejagnu)
82 ("m4" ,m4)
83 ("texinfo" ,texinfo)
84 ("guile" ,guile-2.0)
85 ("gnutls" ,gnutls)
86 ("ncurses" ,ncurses)
87 ("readline" ,readline)
88 ("linux-pam" ,linux-pam)
89 ("libtool" ,libtool)
90 ("gdbm" ,gdbm)))
91 (home-page "http://www.gnu.org/software/mailutils/")
92 (synopsis "Utilities and library for reading and serving mail")
93 (description
94 "GNU Mailutils is a collection of programs for managing, viewing and
95 processing electronic mail. It contains both utilities and server daemons
96 and all operate in a protocol-agnostic way. The underlying libraries are
97 also available, simplifying the addition of mail capabilities to new
98 software.")
99 (license
100 ;; Libraries are under LGPLv3+, and programs under GPLv3+.
101 (list gpl3+ lgpl3+))))
102
103 (define-public fetchmail
104 (package
105 (name "fetchmail")
106 (version "6.3.26")
107 (source (origin
108 (method url-fetch)
109 (uri (string-append "mirror://sourceforge/fetchmail/branch_6.3/fetchmail-"
110 version ".tar.xz"))
111 (sha256
112 (base32
113 "0l78ayvi9dm8hd190gl139cs2xqsrf7r9ncilslw20mgvd6cbd3r"))))
114 (build-system gnu-build-system)
115 (inputs
116 `(("openssl" ,openssl)))
117 (arguments
118 `(#:configure-flags (list (string-append "--with-ssl="
119 (assoc-ref %build-inputs "openssl")))))
120 (home-page "http://fetchmail.berlios.de/")
121 (synopsis "Remote-mailr etrieval and forwarding utility")
122 (description
123 "Fetchmail is a full-featured, robust, well-documented remote-mail
124 retrieval and forwarding utility intended to be used over on-demand
125 TCP/IP links (such as SLIP or PPP connections). It supports every
126 remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP,
127 KPOP, all flavors of IMAP, ETRN, and ODMR. It can even support IPv6
128 and IPSEC.
129
130 Fetchmail retrieves mail from remote mail servers and forwards it via SMTP,
131 so it can then be read by normal mail user agents such as mutt, elm
132 or BSD Mail. It allows all your system MTA's filtering, forwarding, and
133 aliasing facilities to work just as they would on normal mail.")
134 (license gpl2+))) ; most files are actually public domain or x11
135
136 (define-public mutt
137 (package
138 (name "mutt")
139 (version "1.5.21")
140 (source (origin
141 (method url-fetch)
142 (uri (string-append "ftp://ftp.mutt.org/mutt/devel/mutt-"
143 version ".tar.gz"))
144 (sha256
145 (base32
146 "1864cwz240gh0zy56fb47qqzwyf6ghg01037rb4p2kqgimpg6h91"))))
147 (build-system gnu-build-system)
148 (inputs
149 `(("cyrus-sasl" ,cyrus-sasl)
150 ("gpgme" ,gpgme)
151 ("ncurses" ,ncurses)
152 ("openssl" ,openssl)
153 ("perl" ,perl)))
154 (arguments
155 `(#:configure-flags '("--enable-smtp"
156 "--enable-imap"
157 "--enable-pop"
158 "--enable-gpgme"
159 "--with-ssl"
160 "--with-sasl"
161 ;; so that mutt does not check whether the path
162 ;; exists, which it does not in the chroot
163 "--with-mailpath=/var/mail")))
164 (home-page "http://www.mutt.org/")
165 (synopsis "Mail client")
166 (description
167 "Mutt is a small but very powerful text-based mail client for Unix
168 operating systems.")
169 (license gpl2+)))
170
171 (define-public gmime
172 (package
173 (name "gmime")
174 (version "2.6.19")
175 (source (origin
176 (method url-fetch)
177 (uri (string-append "http://download.gnome.org/sources/gmime/"
178 (string-join (take (string-split version #\.)
179 2)
180 ".")
181 "/gmime-" version ".tar.xz"))
182 (sha256
183 (base32
184 "0jm1fgbjgh496rsc0il2y46qd4bqq2ln9168p4zzh68mk4ml1yxg"))))
185 (build-system gnu-build-system)
186 (native-inputs
187 `(("pkg-config" ,pkg-config)
188 ("gnupg" ,gnupg))) ; for tests only
189 (inputs `(("glib" ,glib)
190 ("gpgme" ,gpgme)
191 ("zlib" ,zlib)))
192 (arguments
193 `(#:phases
194 (alist-cons-after
195 'unpack 'patch-paths-in-tests
196 (lambda _
197 ;; The test programs run several programs using 'system'
198 ;; with hard-coded paths. Here we patch them all. We also
199 ;; change "gpg" to "gpg2".
200 (substitute* (find-files "tests" "\\.c$")
201 (("(system *\\(\")(/[^ ]*)" all pre prog-path)
202 (let* ((base (basename prog-path))
203 (prog (which (if (string=? base "gpg") "gpg2" base))))
204 (string-append pre (or prog (error "not found: " base)))))))
205 %standard-phases)))
206 (home-page "http://spruce.sourceforge.net/gmime/")
207 (synopsis "MIME message parser and creator library")
208 (description
209 "GMime provides a core library and set of utilities which may be used for
210 the creation and parsing of messages using the Multipurpose Internet Mail
211 Extension (MIME).")
212 (license (list lgpl2.1+ gpl2+ gpl3+))))
213
214 ;;; mail.scm ends here