I am having a problem in my VMs.
I used the same template (Debian 7min) in OpenVZ, but for whatever reason those two are using a different mailx. I have a small script which I use to send statusmails:
mailx -v -s "$subject" -S smtp=$smtphost -S from="$mailfrom" -S smtp-auth-user=$smtpuser \
-S smtp-auth-password=$smtppwd $emailto </dev/null
It works find on one server, the other one give me an error message 'unknown command -S'.
Ok, I know mailx is just a virtual package, and I usually install bsd-mailx, but both server show they are setup identical
ls -al /etc/alternatives/ma*
lrwxrwxrwx 1 root root 18 Feb 9 20:07 /etc/alternatives/mailx -> /usr/bin/bsd-mailx
dpkg –get-selections | grep mail
bsd-mailx install
fetchmail install
procmail install
rmail install
sendmail install
sendmail-base install
sendmail-bin install
sendmail-cf install
sendmail-doc install
Problem is, mailx like never supports any kind of version info, so mailx –help or –version just says 'unknown option' – so I cant even figure out what 'version' of mailx it is
This is output from server 1
mailx: illegal option -- -
Usage: mailx -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users
this is output from server 2
mailx: invalid option -- '-'
usage: mailx [-dEIinv] [-a header] [-b bcc-addr] [-c cc-addr] [-s subject] to-addr ...
[-- sendmail-options ...]
mailx [-dEIiNnv] -f [name]
mailx [-dEIiNnv] [-u user]
Clearly not idential. Any helps how I can 'get' the mailx from server 1 to server 2? I am out of ideas.
Best Answer
So in the server1 you have heilroom-mailx i.e.
/etc/alternatives/mailx -> /usr/bin/heirloom-mailx
, the second server usesbsd-mailx
.Do
apt-get install heirloom-mailx
on both servers if you want to have mailx from server1.After installing, server should automatically use heirloom as mailx, if not do: