-
-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot pipe </dev/null for message body #2243
Comments
The regression was introduced by b113e9e#diff-c24730921dd546803ed551b31edd2cb0R2170 - if we can't read at least one byte from stdin, we fail. @flatcap why? :) |
I've been carefully re-reading the code and trying some experiments.
The first case, caused by a mis-configuration, sends out an empty email. Using echo | neomutt -s "subject" user@example.com I'll add an error message to make this clearer. |
Piping /dev/null to neomutt(1) can be useful; especially for debugging purposes. The original behavior, which comes from mutt(1), was to accept that. Later, we disallowed an empty stdin, to workaround a bug in xdg-open(1) (see issue #2138). This commit reverts to the original behavior. The xdg-open(1) bug should be fixed in xdg-open(1) (and it probably has been fixed already, because I haven't been able to reproduce it, although I haven't tested it thoroughly). Fixes: 331702b ("abort if run without a terminal") Fixes: b113e9e ("fix command line sending") Link: <#2138> Link: <#2143> Link: <#2176> Link: <#2177> Closes: <#2243> Link: <#2244> Link: <#4113> Link: <#4116> Cc: <https://github.com/The-Compiler> Cc: Austin Ray <austin@austinray.io> Cc: Pietro Cerutti <gahr@gahr.ch> Reported-by: <https://github.com/noahrama> Reported-by: Alejandro Colomar <alx@kernel.org> Co-developed-by: Alejandro Colomar <alx@kernel.org> Signed-off-by: Alejandro Colomar <alx@kernel.org> Co-developed-by: Richard Russon (@flatcap) <rich@flatcap.org>
Expected Behaviour
i should be able to:
mutt -s 'test' email@email.com </dev/null
Actual Behaviour
when i pipe </dev/null, it fails
Steps to Reproduce
mutt -s 'test' email@email.com </dev/null
with version > NeoMutt 20191207
How often does this happen?
When did it start to happen?
NeoMutt Version
latest
NeoMutt 20200320
Copyright (C) 1996-2016 Michael R. Elkins and others.
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.
System: Linux 5.6.2-arch1-2 (x86_64)
ncurses: ncurses 6.2.20200212 (compiled with 6.2.20200212)
libidn2: 2.3.0 (compiled with 2.3.0)
GPGME: 1.13.1
GnuTLS: 3.6.12
libnotmuch: 5.2.0
hcache backends: kyotocabinet, gdbm, lmdb
hcache compression: lz4, zlib, zstd
Configure options: --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --gpgme --sqlite --autocrypt --lua --notmuch --gss --gnutls --sasl --with-ui=ncurses --with-idn2=/usr --disable-idn --idn2 --lmdb --kyotocabinet --gdbm --lz4 --zlib --zstd
Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -std=c99 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/include -DNCURSES_WIDECHAR
Default options:
+attach_headers_color +compose_to_sender +compress +cond_date +debug
+encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color
+initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop
+progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar
+skip_quoted +smtp +status_color +timeout +tls_sni +trash
Compile options:
+autocrypt +bkgdset +color +curs_set +fcntl -flock -fmemopen +futimens
+getaddrinfo +gnutls +gpgme +gss +hcache -homespool +idn +inotify
-locales_hack +lua +lz4 +meta -mixmaster +nls +notmuch -openssl +pgp +sasl
+smime +sqlite +start_color +sun_attachment +typeahead +zlib +zstd
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"
To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
https://github.com/neomutt/neomutt/issues
or send an email to: neomutt-devel@neomutt.org
Extra Info
Linux Archlinux 5.6.2-arch1-2 #1 SMP PREEMPT Sun, 05 Apr 2020 05:13:14 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: