View | Details | Raw Unified | Return to bug 207727 | Differences between
and this patch

Collapse All | Expand All

(-)./Makefile (-3 / +5 lines)
Lines 1-9 Link Here
1
# Created by: Udo Schweigert
1
# Created by: Udo Schweigert
2
# $FreeBSD: head/mail/mutt/Makefile 411321 2016-03-17 23:04:25Z mat $
2
# $FreeBSD: head/mail/mutt/Makefile 411160 2016-03-15 12:56:32Z feld $
3
3
4
PORTNAME=	mutt
4
PORTNAME=	mutt
5
PORTVERSION=	1.5.24
5
PORTVERSION=	1.5.24
6
PORTREVISION?=	5
6
PORTREVISION?=	6
7
CATEGORIES+=	mail ipv6
7
CATEGORIES+=	mail ipv6
8
MASTER_SITES=	ftp://ftp.mutt.org/mutt/ \
8
MASTER_SITES=	ftp://ftp.mutt.org/mutt/ \
9
		ftp://ftp.fu-berlin.de/pub/unix/mail/mutt/ \
9
		ftp://ftp.fu-berlin.de/pub/unix/mail/mutt/ \
Lines 111-117 Link Here
111
RUN_DEPENDS+=	${LOCALBASE}/etc/mime.types:${PORTSDIR}/misc/mime-support
111
RUN_DEPENDS+=	${LOCALBASE}/etc/mime.types:${PORTSDIR}/misc/mime-support
112
112
113
.if !defined (LITE)
113
.if !defined (LITE)
114
RUN_DEPENDS+=	${LOCALBASE}/etc/mailcap.sample:${PORTSDIR}/mail/metamail
115
ASPELL_BUILD_DEPENDS=	aspell:${PORTSDIR}/textproc/aspell
114
ASPELL_BUILD_DEPENDS=	aspell:${PORTSDIR}/textproc/aspell
116
ASPELL_RUN_DEPENDS=		aspell:${PORTSDIR}/textproc/aspell
115
ASPELL_RUN_DEPENDS=		aspell:${PORTSDIR}/textproc/aspell
117
ISPELL_BUILD_DEPENDS=	ispell:${PORTSDIR}/textproc/aspell-ispell
116
ISPELL_BUILD_DEPENDS=	ispell:${PORTSDIR}/textproc/aspell-ispell
Lines 279-284 Link Here
279
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-mtime
278
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-mtime
280
.endif
279
.endif
281
280
281
post-install:
282
	${INSTALL_MAN} ${FILESDIR}/mailcap.5 ${STAGEDIR}${MANPREFIX}/man/man5
283
282
post-install-NNTP-on:
284
post-install-NNTP-on:
283
	${INSTALL_DATA} ${WRKSRC}/ChangeLog.nntp ${STAGEDIR}${DOCSDIR}
285
	${INSTALL_DATA} ${WRKSRC}/ChangeLog.nntp ${STAGEDIR}${DOCSDIR}
284
286
(-)./files/mailcap.5 (+143 lines)
Line 0 Link Here
1
.\"/* Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
2
.\" * 
3
.\" * Permission to use, copy, modify, and distribute this material 
4
.\" * for any purpose and without fee is hereby granted, provided 
5
.\" * that the above copyright notice and this permission notice 
6
.\" * appear in all copies, and that the name of Bellcore not be 
7
.\" * used in advertising or publicity pertaining to this 
8
.\" * material without the specific, prior written permission 
9
.\" * of an authorized representative of Bellcore.  BELLCORE 
10
.\" * MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
11
.\" * OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
12
.\" * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
13
.\" * 
14
.\" * Copyright (c) 2016 Udo Schweigert
15
.\" */
16
.Dd March 16, 2016
17
.Dt MAILCAP 5
18
.Sh NAME
19
.Nm mailcap
20
.Nd mail capabilities file
21
.Sh DESCRIPTION
22
The
23
.Nm
24
file is read by the 
25
.Xr mutt 1
26
program to determine how to display non-text content.
27
.Pp
28
The syntax of a 
29
.Nm 
30
file is quite simple.  Any line that starts with "#" is a comment.  Blank lines are ignored.  Otherwise, each line defines a single mailcap entry for a single content type.  Long lines may be continued by ending them with a backslash character, \\.
31
.Pp
32
Each individual mailcap entry consists of a content-type specification, a command to execute, and (possibly) a set of optional "flag" values.  For example, a very simple mailcap entry would look like this:
33
.Bd -literal
34
    text/plain; cat %s
35
.Ed
36
.Pp
37
The optional flags can be used to specify additional information about the mail-handling command.  For example:
38
.Bd -literal
39
    text/plain; cat %s; copiousoutput
40
.Ed
41
.Pp
42
can be used to indicate that the output of the 
43
.Xr cat 1 
44
command may be voluminous, requiring either a scrolling window, a pager, or some other appropriate coping mechanism.
45
.Pp
46
The 
47
.Em type
48
field ("text/plain", in the above example) is simply any legal content type name, as defined by RFC 822.
49
In practice, this is almost any string.
50
It is the string that will be matched against the 
51
.Em Content-type 
52
header to decide if this is the mailcap entry that matches the current message.
53
Additionally, the type field may specify a subtype (e.g. "text/ISO-8859-1") or a wildcard to match all subtypes (e.g. "image/*").
54
.Pp
55
The 
56
.Em command 
57
field is any UNIX command ("cat %s" in the above example), and is used to specify the interpreter for the given type of message. 
58
Semicolons and backslashes within the command must be quoted with backslashes.
59
If the command contains "%s", those two characters will be replaced by the name of a file that contains the body of the message.
60
If it contains "%t', those two characters will be replaced by the content-type field, including the subtype, if any.
61
(That is, if the content-type was "image/pbm; opt1=something-else", then "%t" would be replaced by "image/pbm".)
62
If the command field contains "%{" followed by a parameter name and a closing "}", then all those characters will be replaced by the value of the named parameter, if any, from the Content-type header.
63
Thus, in the previous example, "%{opt1}" will be replaced by "something-else".
64
Finally, if the command contains "\%", those two characters will be replaced by a single % character.
65
(In fact, the backslash can be used to quote any character, including itself.)
66
.Pp
67
If no "%s" appears in the command field, then instead of placing the message body in a temporary file, mutt will pass the body to the command on the standard input.
68
.Pp
69
The
70
.Em test=xxx 
71
field is a command that is executed to determine whether or not the mailcap line actually applies.
72
That is, if the content-type field matches the content-type on the message, but a 
73
.Em test= 
74
field is present, then the test must succeed before the mailcap line is considered to "match" the message being viewed.
75
The command may be any UNIX command, using the same syntax and the same %-escapes as for the viewing command, as described above.
76
A command is considered to succeed if it exits with a zero exit status, and to fail otherwise.
77
.Pp
78
The 
79
.Em print=xxx
80
field is a command that is executed to print the data instead of display it interactively.
81
.Pp
82
The 
83
.Em compose 
84
field may be used to specify a program that can be used to compose a new body or body part in the given format.
85
Its intended use is to support mail composing agents that support the composition of multiple types of mail using external composing agents.
86
As with the view-command, the compose command will be executed after replacing certain escape sequences starting with "%".
87
In particular, %s should be replaced by the name of a file to which the composed data is to be written by the specified composing program, thus allowing the calling program (mutt) to tell the called program where to store the composed data.
88
If %s does not appear, then the composed data will be assumed to be written by the composing programs to standard output.
89
The result of the composing program may be data that is NOT yet suitable for mail transport -- that is, a Content-Transfer-Encoding may still need to be applied to the data.
90
.Pp
91
The 
92
.Em composetyped 
93
field is similar to the 
94
.Em compose
95
field, but is to be used when the composing program needs to specify the Content-type header field to be applied to the composed data.
96
The
97
.Em compose
98
field is simpler, and is preferred for use with existing (non-mail-oriented) programs for composing data in a given format.
99
The 
100
.Em composetyped
101
field is necessary when the Content-type information must include auxilliary parameters, and the composition program must then know enough about mail formats to produce output that includes the mail type information, and to apply any necessary Content-Transfer-Encoding.
102
Conceptually, 
103
.Em compose
104
specifies a program that simply outputs the specified type of data in its raw form, while
105
.Em composetyped
106
specifies a program that outputs the data as a MIME object, with all necessary Content-* headers already in place.
107
.Pp
108
The 
109
.Em edit 
110
field may be used to specify a program that can be used to edit a body or body part in the given format.
111
In many cases, it may be identical in content to the
112
.Em compose 
113
field, and shares the operating-system dependent semantics for program execution.
114
.Pp
115
The 
116
.Em nametemplate
117
field gives a file name format, in which %s will be replaced by a short unique string to give the name of the temporary file to be passed to the viewing command.
118
This is only expected to be relevant in environments where filename extensions are meaningful, e.g., one coulld specify that a GIF file being passed to a gif viewer should have a name eding in ".gif" by using "nametemplate=%s.gif".
119
.Pp
120
.Em needsterminal
121
If this flag is given, the named interpreter needs to interact with the user on a terminal.
122
In some environments this will require the creation of a new terminal emulation window, while in most environments it will not.
123
.Pp
124
.Em copiousoutput
125
This flag should be given whenever the interpreter is capable of producing more than a few lines of output on stdout, and does no interaction with the user.
126
If the mailcap entry specifies copiousoutput then the output of the command being executed will be piped through the pagination program as specified in the .muttrc file by the 
127
.Ev pager 
128
variable.
129
.Pp
130
.Sh SEE ALSO
131
.Xr mutt 1 ,
132
.Xr muttrc 5
133
.Sh AUTHORS
134
This 
135
.Xr mailcap 5 
136
manpage is based on the manpage provided by
137
.Xr metamail 1
138
and the corresponding RFC 1524. Both were written by
139
Nathaniel S. Borenstein
140
at Bell Communications Research, Inc. (Bellcore).
141
.Pp
142
mutt specific changes have been applied by 
143
Udo Schweigert
(-)./pkg-plist (+1 lines)
Lines 13-18 Link Here
13
man/man1/pgpewrap.1.gz
13
man/man1/pgpewrap.1.gz
14
man/man1/pgpring.1.gz
14
man/man1/pgpring.1.gz
15
man/man1/smime_keys.1.gz
15
man/man1/smime_keys.1.gz
16
man/man5/mailcap.5.gz
16
%%MAILBOX_MANPAGES%%man/man5/mbox.5.gz
17
%%MAILBOX_MANPAGES%%man/man5/mbox.5.gz
17
%%MAILBOX_MANPAGES%%man/man5/mmdf.5.gz
18
%%MAILBOX_MANPAGES%%man/man5/mmdf.5.gz
18
man/man5/muttrc.5.gz
19
man/man5/muttrc.5.gz

Return to bug 207727