Bug 1502108

Summary: Curl uses VRFY even when he server does not support it.
Product: [Fedora] Fedora Reporter: Todd <ToddAndMargo>
Component: curlAssignee: Kamil Dudka <kdudka>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 26CC: john.j5live, kdudka, paul
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-16 08:06:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Todd 2017-10-14 09:52:06 UTC
Dear Fedora Developers,

doesn't work: Fedora 26: curl-7.53.1-7.fc26.x8664
works: Scientific Linux 7.4: curl-7.29.0-42.el7.x8664

I am trying to send eMail through curl on fc26. I am getting:

< 502 mx.zohomail.com VRFY not implemented
* Command failed: 502
> QUIT

curl is issuing the VRFY command even when the server does not support it.

My command line does work on old-out-of-date (Scientific Linux 7.4) where curl is so out-of-date that it has not yet implemented VRFY (Added in 7.34.0).

My full command line(s):
$ cat mail.txt | curl smtp://smtp.zoho.com:587 -vvv --mail-from "xxxxx" --mail-rcpt  "yyyy" --ssl -u xxxxx:redacted -k --anyauth

$ cat mail.txt | curl smtps://smtp.zoho.com:465 -vvv --mail-from "xxxxx" --mail-rcpt  "yyyy" --ssl -u xxxxx:redacted -k --anyauth


$cat mail.txt
From: "xxxxx>
To: "yyyyy>
Subject: This is a test

Hi yyyyy,
I'm sending this mail with curl thru my zoho account.
xxxxx

Comment 1 Todd 2017-10-14 11:19:05 UTC
Work around:

"-T -" picked up the pipe perfectly.

This may just be a revision change issue and not an actual bug.

Comment 2 Kamil Dudka 2017-10-16 08:06:05 UTC
(In reply to Todd from comment #0)
> curl is issuing the VRFY command even when the server does not support it.

You can use the -X option of curl to specify a custom SMTP command to be used instead of VRFY.  See the curl(1) man page.

Comment 3 Todd 2017-10-16 10:02:33 UTC
(In reply to Kamil Dudka from comment #2)
> (In reply to Todd from comment #0)
> > curl is issuing the VRFY command even when the server does not support it.
> 
> You can use the -X option of curl to specify a custom SMTP command to be
> used instead of VRFY.  See the curl(1) man page.


Indeed the man page does.  I did find that, but it did not give directions on how to use it.  Google did not produce anything either.


The "-T -" fixed the problem.  Maybe that should have been mentioned in the -X section of the man page?  Something like, 

      "When invoked with `-T -`, curl will not use VRFY.  See -T for details."

Just thinking.

Comment 4 Kamil Dudka 2017-10-16 10:22:35 UTC
You can find a pretty good tutorial in the Everything curl book:

https://ec.haxx.se/usingcurl-smtp.html

On the other hand, the man page is meant to be concise, so it cannot cover all combination of all options.  In general, curl never (if I remember correctly, TELNET is the only exception) uploads data unless you ask for that by some option.  This behavior is not really specific to SMTP.

Anyway, feel free to continue the discussion on the upstream mailing list where you already started a thread:

https://curl.haxx.se/mail/archive-2017-10/0009.html