If you just hired a cheap VPS with some kind of Linux OS installed or just installed a home Linux test system environment inside a Virtual Machine (such as VirtualBox) on your notebook and you want to read system email reports delivered by services (e.g. track possible errors with the OS) or simply test whether Email relaying is configured properly
and you end up with shell error:
bash: mail: command not found
because mail command is missing and you wonder what Linux package you have to install in order to have the lovely mail / mailx command back on the OS … this article will help you how you can easily solve it by installing the mailx binary file (e.g. install the package providing it depending on the Linux Distribution Operating System you face the problem on.
1. Install mailx command on Debian / Ubuntu / Mint and other .deb based Linux
root@linux:~# apt-get install –yes bsd-mailx
…
An alternative way to install the mailx system binary is to install mailutils package
which will set up the system with essential mail related programs and set up a light Exim MTA and common server Email surrounding so you can easily configure default installed Exim Mail Server to serve as an SMTP relay (through dpkg-reconfigure exim4-config) command
root@linux~:# apt-get install mailutils
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
exim4-base exim4-config exim4-daemon-light guile-2.0-libs libgsasl7
libkyotocabinet16v5 libmailutils5 libmariadbclient18 libntlm0
mailutils-common mysql-common
Suggested packages:
eximon4 exim4-doc-html | exim4-doc-info spf-tools-perl swaks mailutils-mh
mailutils-doc
The following NEW packages will be installed:
exim4-base exim4-config exim4-daemon-light guile-2.0-libs libgsasl7
libkyotocabinet16v5 libmailutils5 libmariadbclient18 libntlm0 mailutils
root@linux:~# dpkg-reconfigure exim4-config
2. Install mailx Linux command on Fedora / CentOS / RHEL e.g. Redhat based distros
On RPM based distrubutions the package name is different from debians to install it there you have to fetch and install current distro mailx .rpm
To install mail command on older CentOS / Redhat 7/6/5 distributions
[root@centos:~]# yum install -y mailx
…
On Fedora 22+ version yum auto-dependency tool was substituted with dnf:
[root@fedora:~]# dnf install -y mailx
…
3. Send Test Email with mail command
root@linux:~# echo "Sample Message Body" | mail -s "Whatever … Message Subject" remote_receiver@remote-server-email-address.com
…
Check the mailbox, you just sent the sample email, hopefully if MTA is relaying correctly and the SMTP relay is properly delivering the email should be at the recipient address.
Solving “Cannot redeclare show_subscription_checkbox() (previously declared in .. wp-content/plugins/subscribe-to-comments/subscribe-to-comments.php”
Monday, March 21st, 2011I’m trying to install subscribe-to-comments wordpress plugin in order to make my users to easily set a tick and receive new emails if somebody replies to their comments in my blog. Pitily downloading and trying to install the subscribe-to-comments wordpress plugin was failing after it’s activation with an error message:
PHP Fatal error: Cannot redeclare show_subscription_checkbox() (previously declared in /var/www/blog/wp-content/plugins/subscribe-to-comments/subscribe-to-comments.php:12) in /var/www/blog/wp-content/plugins/subscribe-to-comments.php on line 58"
I did my best to edit the subscribe-to-comments.php to fix up the fatal error but it was no go, so after a bunch of research I’ve found out somebody created a new version of the plugin under the name subscribe-to-comments-reloaded .
I’ve proceeded and gave a try to subscribe-to-comments-reloaded as a substitute to the old broken subscribe-to-comments .
Enabling the subscribe-to-commets-reloaded worked out of the box and the plugin now works perfectly fine and even better is enabling all the functionaity of the subscribe-to-comments
Cheers 🙂
Tags: activation, blog, bunch, Cheers, ERROR, error message, fatal error, fine, functionaity, line, name, order, php, plugin, quot, redeclare, show, Solving "Cannot redeclare show_subscription_checkbox() (previously declared in .. wp-content/plugins/subscribe-to-comments/subscribe-to-comments.php", Subscription, substitute, tick, var, version, www
Posted in Various, Web and CMS, Wordpress | 3 Comments »