Na moim nowym serwerze zacząłem instalować usługi pocztowe i doszedłem do momentu, w którym chciałem wysłać testowe email-e. Standardowo robiłem to tak:
echo "Test" | mail -s "TestX" ktos@localhost
Pojawił się tylko jeden, mały problem:
[root@ziutusLinux1 pluginconf.d]# echo "test" | mail -s "test1" root@localhost -bash: mail: command not found
Więc jak znaleźć pakiet, który zawiera tak podstawową komendę jak „mail”? Całkiem prosto, otóż yum pozwala użyć opcji whatprovides, dzięki której można znaleźć interesujący nas pakiet:
[root@ziutusLinux1 pluginconf.d]# yum whatprovides /bin/mail Loaded plugins: fastestmirror, presto, priorities Loading mirror speeds from cached hostfile * base: mirrors.prometeus.net * epel: mirror.fraunhofer.de * extras: mirrors.prometeus.net * updates: mirrors.prometeus.net mailx-12.4-7.el6.x86_64 : Enhanced implementation of the mailx command Repo : base Matched from: Filename : /bin/mail bsd-mailx-8.1.2-4.el6.x86_64 : Simple mail user agent Repo : epel Matched from: Filename : /bin/mail
Jeżeli nie znamy dokładnej ścieżki, możemy użyć metaznaków, np.
[root@ziutusLinux1 pluginconf.d]# yum whatprovides *bin/mail Loaded plugins: fastestmirror, presto, priorities Loading mirror speeds from cached hostfile * base: mirrors.prometeus.net * epel: mirror.fraunhofer.de * extras: mirrors.prometeus.net * updates: mirrors.prometeus.net mailx-12.4-7.el6.x86_64 : Enhanced implementation of the mailx command Repo : base Matched from: Filename : /bin/mail bsd-mailx-8.1.2-4.el6.x86_64 : Simple mail user agent Repo : epel Matched from: Filename : /bin/mail
Tak więc mój problem rozwiązałem przez instalację brakującego pakietu:
[root@ziutusLinux1 pluginconf.d]# yum install mailx