I'm trying to figure out how to get some of our servers to send email through our relay when I use the mail command. If I simply type
$ mail -s "Test" firstname.lastname@example.org
mail attempts to send directly to the recipient which is not allowed on our network. All email must go through the SMTP server.
I tried using the -- option to pass sendmail options, but I don't know what the option is that I need to pass. I found in another forum that the -S option followed by smtp=smtp://ip.address is the appropriate choice, but that throws an error stating that the -S option doesn't exist.
$ mail -s "Test" user@domain -- -S smtp=smtp://ip.address
Looking at the man page for either mail or sendmail has not clued me into which option I need to use. I did see in the sendmail manpage that there is the -O option which uses the option=value format. I tried that instead of the -S listed above. Still no dice. The manpage even says the -O option is ignored.
Can someone help me out with this?