Bug 207727 - mail/mutt: RUN_DEPENDS of some other port: mailcap(5)
Summary: mail/mutt: RUN_DEPENDS of some other port: mailcap(5)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Adam Weinberger
Depends on:
Reported: 2016-03-05 20:22 UTC by Matthias Apitz
Modified: 2016-03-18 16:23 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (Udo.Schweigert)

patch (550 bytes, patch)
2016-03-14 07:21 UTC, Udo.Schweigert
Udo.Schweigert: maintainer-approval+
Details | Diff
patch containing mailcap man page without dependency (8.99 KB, patch)
2016-03-16 08:58 UTC, Udo.Schweigert
Udo.Schweigert: maintainer-approval+
Details | Diff
patch containing mailcap man page without dependency (8.99 KB, patch)
2016-03-16 09:01 UTC, Udo.Schweigert
no flags Details | Diff
patch containing amended mailcap man page (9.39 KB, patch)
2016-03-18 07:01 UTC, Udo.Schweigert
Udo.Schweigert: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Apitz 2016-03-05 20:22:43 UTC
port mail/mutt has a RUN_DEPENDS to some other port: The man page
of muttrc mentions mailcap(5) which is not there:

# man mailcap
No manual entry for mailcap

Installation of the pkg metamail solves this:

# pkg install metamail
# man mailcap | wc -l
Comment 1 Udo.Schweigert 2016-03-14 07:21:31 UTC
Created attachment 168129 [details]

Attached patch solves the issue for the non-LITE port.
Comment 2 Mark Felder freebsd_committer 2016-03-15 12:56:53 UTC
Committed with PORTREVISION bump, thanks!
Comment 3 commit-hook freebsd_committer 2016-03-15 15:20:35 UTC
A commit references this bug:

Author: feld
Date: Tue Mar 15 12:56:33 UTC 2016
New revision: 411160
URL: https://svnweb.freebsd.org/changeset/ports/411160

  mail/mutt: Add missing RUN_DEPENDS

  Mutt requires mailcap to handle MIME attachments.


  PR:		207727
  Approved by:	maintainer

Comment 4 Adam Weinberger freebsd_committer 2016-03-15 17:57:15 UTC
Are you sure this is right? Does this need to be a mandatory dependency for every single person?

The man page says that metamail is *one way* to install a mailcap file. Mutt itself even ships with a sample mailcap file. The manpage listed in the commit contains a bunch of sample mailcap entries.

Metamailis just another sample mailcap file and a couple viewer scripts. I'm not seeing the reason for it to be a dependency for every single person who uses non-lite mutt.

Please, make this into an OPTION. This doesn't feel like the kind of thing that needs to be a hard dependency.
Comment 5 Matthias Apitz 2016-03-15 18:10:04 UTC
(In reply to Adam Weinberger from comment #4)
thd problem here is not having no example files, but not having its manpage;
Comment 6 Mark Felder freebsd_committer 2016-03-15 18:12:03 UTC
(In reply to Adam Weinberger from comment #4)

metamail seems like a sane way of providing a mailcap file by default. It has zero dependencies now that X11 option is off by default. The pkg is only 125K on my filesystem. Is this really such a big concern? 

If so, do you have an alternative suggestion for how to provide a mailcap file by default? I'm open to anything; just want the best out of the box experience for users.

Comment 7 Adam Weinberger freebsd_committer 2016-03-15 18:35:11 UTC
(In reply to Mark Felder from comment #6)

mutt comes with a sample mailcap (/usr/local/share/examples/mutt/sample.mailcap). The manual.html file installed with mutt included a sample mailcap.

What metamail installs by default is hooks to play audio files and show images. Nothing more. It includes some "sample" very rudimentary charset conversions that *mutt already does itself*.

The only thing that'd be useful these days is a handler for text/html MIME parts, but metamail doesn't even reference it (partly because the last release was TWENTY-TWO YEARS AGO :-P )

Mutt works fine without a mailcap, and contains instructions on how to create one. Metamail installs a mailcap, but it does NOTHING. It is not the right dependency.
Comment 8 Adam Weinberger freebsd_committer 2016-03-15 18:40:53 UTC
(In reply to Matthias Apitz from comment #5)

Other manpages referenced from mutt's manpages, from programs that are not included with mut:

Comment 9 Adam Weinberger freebsd_committer 2016-03-15 18:57:24 UTC
I do want to reiterate: I'm not objecting to metamail as a dependency, just as a mandatory one.
Comment 10 Mark Felder freebsd_committer 2016-03-15 20:23:42 UTC
(In reply to Adam Weinberger from comment #7)

Thank you for your thorough explanation, Adam. I am a mutt user but only occasionally, and rarely interact with MIME attachments with it.

The situation is much clearer now. Do you think it is worthwhile to provide mailcap by default at all? Should we just make this an option and install mutt's sample mailcap or not at all? Ignore metamail completely because of how old and potentially irrelevant its MIME handling configuration is?

I thought this was a very straightforward PR, but I guess I was wrong :-)
Comment 11 Matthias Apitz 2016-03-15 20:39:34 UTC
(In reply to Adam Weinberger from comment #8)

I'm not asking for including them into the mutt pkg, but if the man page of muttrc has them as reference, the user should not (as I was) in the situation looking around which other package/port could bring this man page on disk; it should just be there;
Comment 12 Adam Weinberger freebsd_committer 2016-03-15 20:42:16 UTC
(In reply to Mark Felder from comment #10)

The thing about mailcap is, it just defines when to use external programs to view something that isn't plain-text. So unless you have the external translator/viewer, mailcap doesn't serve any particular purpose.

Mutt's sample mailcap exists only to show syntax. Its examples require netscape (netscape!), xv, and pgp. The examples shown in the manual.html file require xanim, netscape, lynx, enscript, xv, ptmtoascii, and MS Excel. Mutt's mailcaps really are examples only.

Installing a mailcap file by default, without the viewers listed in it, open up users to potential confusion from error messages of missing binaries/scripts.

My recommendation is to remove the metamail dependency entirely---it brings in no benefit aside from installing a referenced manpage. If people want to use mutt to view images, HTML, etc., they can follow the examples in the included documentation.
Comment 13 Adam Weinberger freebsd_committer 2016-03-15 20:50:46 UTC
(In reply to Matthias Apitz from comment #11)

By that logic, procmail, gnupg, enscript, qmail, and exim should all be mandatory dependencies of mutt because their manpages are referenced too.

I don't agree with your conclusion, that a manpage reference is sufficient condition for producing a mandatory dependency.

For future reference, the FreeBSD website has a phenomenal service where you can search all the manpages in the ports tree.

http://www.freebsd.org/cgi/man.cgi (select "FreeBSD 10.2-RELEASE and Ports")

Comment 14 Udo.Schweigert 2016-03-16 07:11:45 UTC
Folks, sorry I should have checked that before proposing the patch: it turns out that the metamail manpage for mailcap does not really reflect the functionality of mutt's mailcap.

Therefore I propose to include the manpage for mailcap as part of the port and not as a dependency.  I will write a manpage on my own and will come up with a new patch.
Comment 15 Udo.Schweigert 2016-03-16 08:58:27 UTC
Created attachment 168289 [details]
patch containing mailcap man page without dependency

OK, here is a patch avoiding the new dependency and providing a more accurate manpage for mailcap.
Comment 16 Udo.Schweigert 2016-03-16 09:01:33 UTC
Created attachment 168290 [details]
patch containing mailcap man page without dependency

Fixed version (corrected a typo)
Comment 17 Adam Weinberger freebsd_committer 2016-03-16 16:02:44 UTC
Three things here.

One, given that this new manpage is very nearly a word-for-word copy of metamail's mailcap.5 manpage, I believe you'll need to specifically cite it or else it's plagiarism.

Second, if mutt installs a mailcap.5 file then it must register CONFLICTS with metamail.

Third, you should really be upstreaming this. If you believe that mutt needs a mailcap manpage then submit it to the mutt authors so that everybody can benefit from it.
Comment 18 Udo.Schweigert 2016-03-16 17:15:02 UTC
Of course it has a lot in common with metamail, as the only available source for this is RFC1524 and metamail's man page is almost verbatim copied from the RFC. I have adjusted to mutt's usage and deleted stuff not used by mutt and changed some wording.

I copied the original copyright in the manpage's source. If that is not enough of course this could be made more visible in the rendered man-page.

As metamail installs mailcap.4 and this here uses mailcap.5 in terms of the filesystem there is no conflict.
Comment 19 Adam Weinberger freebsd_committer 2016-03-16 17:20:29 UTC
(In reply to Udo.Schweigert from comment #18)

Oh! You're completely right about the CONFLICTS. My mistake!

I would recommend adding something to the manpage to cite the source. Maybe:

mailcap(5) is based off mailcap(4) from the metamail program (http://metamail's-website.com)

Mark, do you want me to take this PR? I fear that I'm kindof stepping on your toes here.
Comment 20 Mark Felder freebsd_committer 2016-03-16 18:46:33 UTC
(In reply to Adam Weinberger from comment #19)

Sure, feel free to take it from here. Thanks for your attentiveness to this issue.
Comment 21 Adam Weinberger freebsd_committer 2016-03-16 19:15:24 UTC
Mtinainer: add in a section that properly cites the metamail source (retaining copyright isn't sufficient) and I'm happy to commit this chanhge.

Please do consider upstreaming this as well.

WIth those changes I will commit these changes.

Thanks for everyone's help in making the plan happen here.
Comment 22 Udo.Schweigert 2016-03-18 07:01:16 UTC
Created attachment 168356 [details]
patch containing amended mailcap man page

Attached a patch with an amended man page containing the reference to the RFC 1524 and metamail.
Comment 23 commit-hook freebsd_committer 2016-03-18 16:22:24 UTC
A commit references this bug:

Author: adamw
Date: Fri Mar 18 16:21:29 UTC 2016
New revision: 411359
URL: https://svnweb.freebsd.org/changeset/ports/411359

  Remove metamail dependency, and add a mailcap.5 manpage.

  The intention of r411160 was to provide a mailcap manpage, as referenced
  in multiple places by the mutt(1) and muttrc(5) manpages.

  Although mail/metamail provides a mailcap.4 manpage, metamail is not
  particularly relevant as a mailcap provider. The main external filter
  that mutt needs is something to render text/html mime parts, but the
  last metamail release was in 1994, 22 years ago.

  This commit removes that metamail dependency, and adds a mailcap.5
  manpage written by Udo Schweigert (mail/mutt's maintainer), based off
  metamail's mailcap.4 manpage.

  PR:		207727
  Submitted by:	Udo Schweigert (maintainer)

Comment 24 Adam Weinberger freebsd_committer 2016-03-18 16:23:13 UTC
Udo, great work here! I made one tiny change: I added a period after your name in the final sentence of that manpage.

Thank you for taking the time to put this together!