Skip to content

Commit

Permalink
add error for CLI empty emails
Browse files Browse the repository at this point in the history
Issue #2243 wants to send empty emails, but that conflicts with issue 2138
where empty emails were being sent by mistake.

For now, disallow: `neomutt user@example.com < /dev/null`
in favour of:      `echo | neomutt user@example.com`

Add an error message to suggest this behaviour.

Closes: #2243
  • Loading branch information
flatcap committed Apr 7, 2020
1 parent a381a77 commit f9476b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions send.c
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,11 @@ int mutt_send_message(SendFlags flags, struct Email *e_templ, const char *tempfi
if (flags & SEND_BATCH)
{
if (mutt_file_copy_stream(stdin, fp_tmp) < 1)
{
mutt_error(_("Refusing to send an empty email"));
mutt_message(_("Try: echo | neomutt -s 'subject' user@example.com"));
goto cleanup;
}
}

if (C_SigOnTop && !(flags & (SEND_MAILX | SEND_KEY | SEND_BATCH)) &&
Expand Down

0 comments on commit f9476b4

Please sign in to comment.