curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Curl not sending last lines of SMTP connection to stderr file

From: Jon Harris <jharris_at_symetrix.co>
Date: Wed, 22 May 2019 02:07:32 +0000

I am sending an email using curl SMTP. I have set options for verbose output and redirecting stderr to a file. Here is my command line:

curl smtp://10.4.0.204:25 --mail-from test_at_example.com --mail-rcp test_at_message.com -s --upload-file msg_23.txt -v --stderr msg_23.log

Most of the verbose output gets captured to msg_23.log. However, the QUIT and 221 response are printed out on the console. So I see this:

# curl smtp://10.4.0.204:25 --mail-from test_at_example.com --mail-rcp test_at_message.com -s --upload-file msg_23.txt -v --stderr msg_23.log
> QUIT
< 221 See you later alligator
#

It's like it stops redirecting stderr before it prints the last 2 headers.

In contrast, a system-level redirection of stderr captures all output including the last 2 lines:
# curl smtp://10.4.0.204:25 --mail-from test_at_example.com --mail-rcp test_at_message.com -s --upload-file msg_23.txt -v 2>msg_23.log

Is this a bug? The system-level redirection provides a work-around, though the --stderr flag is preferable for my application.

----------
Jon Harris, Sr. Design Engineer, Symetrix, Inc.
jharris_at_symetrix.co

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-05-22