In the past, whenever a reader commented on a blog entry, I would receive an email notification. Ever since I moved this site to a Linode VM, I noticed the comment email notification stopped working. Alas, blogs are not like what they used to be back in the day, now that so many people have mobile devices and there are so many ways to waste our time. As a result, not too many people bother to comment on blogs these days. So I postponed fixing this until today.
It turns out that WordPress uses PHPMailer for email notification. Skimming through the source code of wp-includes/class-phpmailer.php, I determined that installing sendmail on my Debian VM would fix the problem.
But sudo apt-get install sendmail gave me this first:
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
sendmail : Depends: sendmail-bin but it is not going to be installed
Depends: sensible-mda but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Ok, let’s fix the broken packages then:
sudo apt-get -f install
That didn’t find any broken package to fix.
So I decided to install the dependencies separately. First:
sudo apt-get install sendmail-bin
That command generated some error output but the last message was ok:
Errors in generating sendmail.cf
*** ERROR: FEATURE() should be before MAILER()
*** MAILER(`local’) must appear after FEATURE(`always_add_domain’)*** ERROR: FEATURE() should be before MAILER()
*** MAILER(`local’) must appear after FEATURE(`allmasquerade’)*** ERROR: FEATURE() should be before MAILER()
[ ok ] Starting Mail Transport Agent (MTA): sendmail.
So I proceeded with:
sudo apt-get install sensible-mda
sudo apt-get install sendmail
Both commands were successful. I then tested sending email to myself on the command with mail, which worked fine. A test comment on my blog also resulted an email notification. So all is well.
Hope this helps you also!