Skip to content
Permalink
Browse files

Multiple 'RCPT TO': Add help text for CLI argument into one more place.

  • Loading branch information
volpav committed Jan 14, 2020
1 parent c344932 commit 9b7d78f4df1efe809629d7a0a012e2766babf57e
Showing with 13 additions and 10 deletions.
  1. +1 −1 docs/cmdline-opts/mail-rcpt-ignore-invalid.d
  2. +8 −7 lib/smtp.c
  3. +2 −2 lib/smtp.h
  4. +2 −0 src/tool_help.c
@@ -1,5 +1,5 @@
Long: mail-rcpt-ignore-invalid
Help: Ignore invalid "RCPT TO" addresses during SMTP conversation
Help: Ignore invalid recipient addresses during SMTP conversation
Protocols: SMTP
Added: 7.70.0
---
@@ -925,32 +925,33 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode,
bool is_smtp_blocking_err =
is_smtp_err && !data->set.mail_rcpt_ignore_invalid;

if (is_smtp_err) {
if(is_smtp_err) {
/* Remembering the last failure which we can report if all "RCPT TO" have
failed and we cannot proceed. */
smtp->rcpt_last_error = smtpcode;

if (is_smtp_blocking_err) {
if(is_smtp_blocking_err) {
failf(data, "RCPT failed: %d", smtpcode);
result = CURLE_SEND_ERROR;
}
} else {
}
else {
/* Some "RCPT TO" have succeeded. */
smtp->rcpt_had_ok = TRUE;
}

if (!is_smtp_blocking_err) {
if(!is_smtp_blocking_err) {
smtp->rcpt = smtp->rcpt->next;

if(smtp->rcpt)
/* Send the next RCPT TO command */
result = smtp_perform_rcpt_to(conn);
else {
/* We weren't able to issue a successful "RCPT TO" command while going
over recipients (potentially multiple). Sending back the last error. */
if (!smtp->rcpt_had_ok) {
over recipients (potentially multiple). Sending back last error. */
if(!smtp->rcpt_had_ok) {
failf(data, "RCPT failed: %d (last error)", smtp->rcpt_last_error);
result = CURLE_SEND_ERROR;
result = CURLE_SEND_ERROR;
}
else {
/* Send the DATA command */
@@ -55,8 +55,8 @@ struct SMTP {
curl_pp_transfer transfer;
char *custom; /* Custom Request */
struct curl_slist *rcpt; /* Recipient list */
bool rcpt_had_ok; /* Whether any of the "RCPT TO" commands (depends on
a total number of recipients) succeeded so far */
bool rcpt_had_ok; /* Whether any of "RCPT TO" commands (depends on
total number of recipients) succeeded so far */
int rcpt_last_error; /* The last error received for "RCPT TO" command */
size_t eob; /* Number of bytes of the EOB (End Of Body) that
have been received so far */
@@ -239,6 +239,8 @@ static const struct helptxt helptext[] = {
"Mail from this address"},
{" --mail-rcpt <address>",
"Mail to this address"},
{" --mail-rcpt-ignore-invalid",
"Ignore invalid recipient addresses during SMTP conversation"},
{"-M, --manual",
"Display the full manual"},
{" --max-filesize <bytes>",

0 comments on commit 9b7d78f

Please sign in to comment.
You can’t perform that action at this time.