Bug 214335 - devel/git depends on deprecated mail/p5-Net-SMTP-SSL
Summary: devel/git depends on deprecated mail/p5-Net-SMTP-SSL
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: Renato Botelho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-08 20:24 UTC by Zilon
Modified: 2017-03-22 11:13 UTC (History)
9 users (show)

See Also:
garga: merge-quarterly?


Attachments
Patch (3.70 KB, patch)
2017-01-03 21:32 UTC, Renato Botelho
no flags Details | Diff
New patch to use instead of the current "patch-git-send-email.perl" (1.93 KB, patch)
2017-02-14 19:21 UTC, OlivierW
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zilon 2016-11-08 20:24:14 UTC
The Send_Email option of the devel/git port depends on the deprecated mail/p5-Net-SMTP-SSL port. The latter will be removed at the end of march from the port system.


Installing p5-Net-SMTP-SSL-1.04...
===>   NOTICE:

This port is deprecated; you may wish to reconsider installing it:

Deprecated by upstream, use Net::SMTP instead.

It is scheduled to be removed on or after 2017-03-31.
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2016-11-15 03:14:07 UTC
Sunpoet, I'm going to assign this PR to you. git (with the SEND_EMAIL option enabled) still depends on Net::SMTP::SSL. What about keeping the DEPRECATED notice but removing the EXPIRATION_DATE?
Comment 2 cris 2016-11-23 10:32:43 UTC
(In reply to Adam Weinberger from comment #1)

I think it's only needed security/p5-IO-Socket-SSL to remove p5-Net-SMTP-SSL and using Net::SMTP (with ssl/tls support).
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2016-11-23 16:56:54 UTC
(In reply to cris from comment #2)

git-send-email.pl still uses Net::SMTP::SSL a number of times starting here:

    https://github.com/git/git/blob/master/git-send-email.perl#L1340

I agree that git should switch to Net::SMTP but it should be done upstream.

Please let me know if I'm missing something here, cris.
Comment 4 Po-Chuan Hsieh freebsd_committer freebsd_triage 2016-11-23 18:53:08 UTC
I was told by antoine@ to set an EXPIRATION_DATE when I deprecate a port. I set a longer period (about 5 months) for upstream or someone else to fix the script. We could extend EXPIRATION_DATE if necessary.
Comment 5 Po-Chuan Hsieh freebsd_committer freebsd_triage 2016-12-14 12:01:06 UTC
FYI, Mike Fisher <mfisher@csh.rit.edu> provides a patch [1] for git-send-email.perl.

[1] https://public-inbox.org/git/451E4A46-BA43-41A5-9E68-DE0D89BE676A@csh.rit.edu/
Comment 6 Renato Botelho freebsd_committer freebsd_triage 2017-01-03 21:32:34 UTC
Created attachment 178490 [details]
Patch

Please try attached patch and let me know the results
Comment 7 Renato Botelho freebsd_committer freebsd_triage 2017-01-03 21:34:10 UTC
I've got this patch from comment #5 and adjusted it to apply on current git from ports. Since I don't use git-send-mail myself it's hard to be sure it's fully working, so I would like to give a chance to users to try it out before go ahead and commit.

FYI it passed on all tests (make test)
Comment 8 commit-hook freebsd_committer freebsd_triage 2017-01-18 12:41:03 UTC
A commit references this bug:

Author: garga
Date: Wed Jan 18 12:40:54 UTC 2017
New revision: 431794
URL: https://svnweb.freebsd.org/changeset/ports/431794

Log:
  Remove dependency of DEPRECATED mail/p5-Net-SMTP-SSL from devel/git

  PR:		214335
  Obtained from:	git development mailing list
  Sponsored by:	Rubicon Communications (Netgate)

Changes:
  head/devel/git/Makefile
  head/devel/git/files/patch-git-send-email.perl
Comment 9 everytrash 2017-01-27 08:04:04 UTC
Please merge it to branch 2017Q1 too. 

Thanks!
Comment 10 OlivierW 2017-02-14 17:54:07 UTC
Hello,

The patch for TLS seems wrong: "git-send-email" through a GMail's SMTP server doesn't work.

My .gitconfig is setup like in the documentation: https://git-scm.com/docs/git-send-email#_example and using: "git send-email --to=address@domain.tld HEAD~1 --smtp-debug=1", I'm getting:

"Net::SMTP>>> Net::SMTP(3.08_01)
Net::SMTP>>>   Net::Cmd(3.08_01)
Net::SMTP>>>     Exporter(5.72)
Net::SMTP>>>   IO::Socket::IP(0.38)
Net::SMTP>>>     IO::Socket(1.38)
Net::SMTP>>>       IO::Handle(1.36)
Net::SMTP=GLOB(0x80351ae70)<<< 220 smtp.gmail.com ESMTP 198sm2123211wmn.11 - gsmtp
Net::SMTP=GLOB(0x80351ae70)>>> EHLO serveur.localnet
Net::SMTP=GLOB(0x80351ae70)<<< 250-smtp.gmail.com at your service, [2001:470::...]
Net::SMTP=GLOB(0x80351ae70)<<< 250-SIZE 35882577
Net::SMTP=GLOB(0x80351ae70)<<< 250-8BITMIME
Net::SMTP=GLOB(0x80351ae70)<<< 250-STARTTLS
Net::SMTP=GLOB(0x80351ae70)<<< 250-ENHANCEDSTATUSCODES
Net::SMTP=GLOB(0x80351ae70)<<< 250-PIPELINING
Net::SMTP=GLOB(0x80351ae70)<<< 250-CHUNKING
Net::SMTP=GLOB(0x80351ae70)<<< 250 SMTPUTF8
Net::SMTP=GLOB(0x80351ae70)>>> STARTTLS
Net::SMTP=GLOB(0x80351ae70)<<< 220 2.0.0 Ready to start TLS
Net::SMTP=GLOB(0x80351ae70)>>> STARTTLS
Net::SMTP: Net::Cmd::getline(): unexpected EOF on command channel: Connection reset by peer at /usr/local/libexec/git-core/git-send-email line 1371.
STARTTLS failed!  at /usr/local/libexec/git-core/git-send-email line 1371."


If I'm using ssl/465 instead of tls/587, the mail is sent, so only the part of the patch about TLS has a problem.


I've found this pull request with a different patch here: https://github.com/git/git/pull/251/commits/7a555963d0f6384cbf59f5f0cfffe6052c6ce136
I haven't fully tested yet, but it I got the TLS part working by commenting line 1368 to 1377 then adding this two lines:
"$smtp->starttls(ssl_verify_params());
if ($smtp->code != 250) {"

I'll properly try the patch for both SSL and TLS and will report back.

Best Regards.
Comment 11 OlivierW 2017-02-14 19:20:15 UTC
I couldn't apply the patch mentionned in comment #10 to git 2.11.1, so I've made a new patch which is a combination of this two commits:
https://github.com/pprindeville/git/commit/7a555963d0f6384cbf59f5f0cfffe6052c6ce136
https://github.com/pprindeville/git/commit/2ff14bd5d96af4df96caca19dec017549c5208e2

And now I've been able to successfully send mails with ssl/465 and tls/587 :-)
Comment 12 OlivierW 2017-02-14 19:21:39 UTC
Created attachment 179994 [details]
New patch to use instead of the current "patch-git-send-email.perl"
Comment 13 OlivierW 2017-02-14 22:44:42 UTC
(In reply to Renato Botelho from comment #7)
For your information, you can manually test "git-send-email" with:
"git send-email --to=your-email-address@gmail.com HEAD~1 --smtp-debug=1 --smtp-server=smtp.gmail.com --smtp-user=your-email-address@gmail.com --smtp-encryption=tls --smtp-server-port=587"
and
"git send-email --to=your-email-address@gmail.com HEAD~1 --smtp-debug=1 --smtp-server=smtp.gmail.com --smtp-user=your-email-address@gmail.com --smtp-encryption=ssl --smtp-server-port=465"
in a Git repository.

With the patched script, you'll get a prompt like:
"Password for 'smtp://your-email-address@gmail.com@smtp.gmail.com:465':"

With the previous patch, the script would stop before asking for your password.
Comment 14 commit-hook freebsd_committer freebsd_triage 2017-03-21 12:29:16 UTC
A commit references this bug:

Author: garga
Date: Tue Mar 21 12:28:14 UTC 2017
New revision: 436592
URL: https://svnweb.freebsd.org/changeset/ports/436592

Log:
  - Update devel/git to 2.12.1
  - Replace git-send-email patch by a version that works [1]

  PR:		214335 [1]
  Submitted by:	OlivierW <olivierw1+bugzilla-freebsd@hotmail.com> [1]
  MFH:		2017Q1
  Sponsored by:	Rubicon Communications (Netgate)

Changes:
  head/devel/git/Makefile
  head/devel/git/distinfo
  head/devel/git/files/patch-git-send-email.perl
  head/devel/git/pkg-plist
Comment 15 Renato Botelho freebsd_committer freebsd_triage 2017-03-21 12:41:41 UTC
(In reply to OlivierW from comment #12)

Can you please check if 2.12.1 is OK?
Comment 16 OlivierW 2017-03-21 19:34:28 UTC
(In reply to Renato Botelho from comment #15)
I've just tested git 2.12.1 and I can confirm "git send-email" does work. Thanks!
Comment 17 commit-hook freebsd_committer freebsd_triage 2017-03-22 11:13:28 UTC
A commit references this bug:

Author: garga
Date: Wed Mar 22 11:12:46 UTC 2017
New revision: 436687
URL: https://svnweb.freebsd.org/changeset/ports/436687

Log:
  MFH: r431794 r433740 r433768 r436592

  Remove dependency of DEPRECATED mail/p5-Net-SMTP-SSL from devel/git

  PR:		214335
  Obtained from:	git development mailing list
  Sponsored by:	Rubicon Communications (Netgate)

  Update devel/git to 2.11.1

  Sponsored by:	Rubicon Communications (Netgate)

  Fix devel/git PLIST when HTMLDOCS is on

  Reported by:	dankm on IRC

  - Update devel/git to 2.12.1
  - Replace git-send-email patch by a version that works [1]

  PR:		214335 [1]
  Submitted by:	OlivierW <olivierw1+bugzilla-freebsd@hotmail.com> [1]
  Sponsored by:	Rubicon Communications (Netgate)

  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2017Q1/
  branches/2017Q1/devel/git/Makefile
  branches/2017Q1/devel/git/distinfo
  branches/2017Q1/devel/git/files/patch-git-send-email.perl
  branches/2017Q1/devel/git/pkg-plist
Comment 18 commit-hook freebsd_committer freebsd_triage 2017-03-22 11:13:32 UTC
A commit references this bug:

Author: garga
Date: Wed Mar 22 11:12:47 UTC 2017
New revision: 436687
URL: https://svnweb.freebsd.org/changeset/ports/436687

Log:
  MFH: r431794 r433740 r433768 r436592

  Remove dependency of DEPRECATED mail/p5-Net-SMTP-SSL from devel/git

  PR:		214335
  Obtained from:	git development mailing list
  Sponsored by:	Rubicon Communications (Netgate)

  Update devel/git to 2.11.1

  Sponsored by:	Rubicon Communications (Netgate)

  Fix devel/git PLIST when HTMLDOCS is on

  Reported by:	dankm on IRC

  - Update devel/git to 2.12.1
  - Replace git-send-email patch by a version that works [1]

  PR:		214335 [1]
  Submitted by:	OlivierW <olivierw1+bugzilla-freebsd@hotmail.com> [1]
  Sponsored by:	Rubicon Communications (Netgate)

  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2017Q1/
  branches/2017Q1/devel/git/Makefile
  branches/2017Q1/devel/git/distinfo
  branches/2017Q1/devel/git/files/patch-git-send-email.perl
  branches/2017Q1/devel/git/pkg-plist