On Tue, Nov 22, 2022 at 07:36:59PM +0000, Chris Green wrote: > I have postfix installed on all of my systems and mostly they have at > least mailx as well which is handy for sending tests. However one > system doesn't even have mailx, do Ihave to install it to be able to > send tests or is there some way to send test messages from the command > line with just the basic postfix installation?
If you don't need any friendly helpful program to prepare an RFC5322 message header + body, then you can send messages with the sendmail(1) program that comes with Postfix. /usr/sbin/sendmail -f "$sender" -it < /some/msg The message can have the recipients listed in either: To: Cc: Bcc: Or else (if any of the Resent-* headers, including Resent-From are present): Resent-To: Resent-Cc: Resent-Bcc: You can also or instead list the recipients on the command-line: set -- "$rcpt1" "$rcpt2" ... /usr/sbin/sendmail -f "$sender" -i [-t] -- "$@" < /some/msg or with Bash and the like use an array variable: rcpts=( "$rcpt1" "$rcpt2" ... ) /usr/sbin/sendmail -f "$sender" -i [-t] -- "${rcpts[@]}" < /some/msg The purpose of mail(1), mailx(1), ..., mutt, pine, elm, ... is to provide a user-friendly front-end, that possibly also supports filing copies into an IMAP "Sent" folder, prompts for the subjects, supports MIME attachments, ... -- Viktor.