On my opensuse 11.4 box (although I assume the version is irrelevant), I’m trying to figure out how to do something with the mail command. We have multiple smtp relay servers and sometimes I have to test to verify that mail is bouncing off of them successfully. On my laptop, in my main.cf file for postfix, I’ve got the relay server listed. But to test multiple servers, I have to change the main.cf, restart postfix, send message, and then repeat for each test.
I’m trying to figure out a way to specify the smtp relay on the command line. I’ve been playing with the -S option which is supposed to allow variables and one of the variables in the man page is ‘smtp’. I’ve tried several different syntaxes but nothing seems to work.
The closest I’ve come is:
mail -S smtp 10.1.0.63 -s “test” user@email.com < main.cf
That syntax doesn’t give me an error but it still routes the message off the smtp server listed in main.cf which is not 10.1.0.63.
It should be pointed out that if you’re having problems with this working on any distro, make sure you have the heirloom-mailx implementation installed, not the GNU or BSD mail.
On 2013-11-06 22:56, sean m wrote:
>
> It should be pointed out that if you’re having problems with this
> working on any distro, make sure you have the heirloom-mailx
> implementation installed, not the GNU or BSD mail.
No need. openSUSE replaced mail with mailx years ago.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)