Is it possible to ignore the alias expansion with mailx? I'm trying to get something sent with a null message body and don't want it to take the local username.
According to the man page it is not possible as it is not implemented.
But you could try sendmail -f "<>" to send mails with a null sender. Please note that with most mail servers the sendmail is an alias to their equivalent. It is not said to really use thesendmail of sendmail.
(I assume that your requirements are to send with a "null sender" and not with a "null message body")
According to the man page it is not possible as it is not implemented.
But you could try
sendmail -f "<>"
to send mails with a null sender. Please note that with most mail servers thesendmail
is an alias to their equivalent. It is not said to really use thesendmail
of sendmail.(I assume that your requirements are to send with a "null sender" and not with a "null message body")
You may want to "masquerade" the sender email and name... so:
Here's an answer from 2018, on Debian 9 stretch.
Note the
-e
for echo to allow newline characters, and-r
for mailx to show a name along with an outgoing email address:Hope this helps!