1

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.

2 Answers 2

1

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 the sendmail of sendmail.

(I assume that your requirements are to send with a "null sender" and not with a "null message body")

0

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:

$ echo -e "testing email via yourisp.com from command line\n\nsent on: $(date)" | mailx -r "Foghorn Leghorn <[email protected]>" -s "test cli email $(date)" -- [email protected]

Hope this helps!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .