New official Advertisement Management extension announced

I have installed the Advertising Management modification for phpBB 3.0 countless times. It’s very popular to serve ads, obviously and to have easy ways to place them within phpBB. There was a development extension for phpBB 3.1 that I was able to get working for some clients.

Now an extension for phpBB 3.2 is available but even better it’s being supported as an official extension of the phpBB group. So from now on it should always be available. It has a slightly different name but was obviously built on top of the old modification. It’s now called the Advertisement Management extension.

See the announcement and video here.

Fixing phpBB emailing problems

Having trouble sending out emails such as mass emails or email notifications using phpBB? If so, you are not alone. Sending mass emails is a feature of phpBB (ACP > System > General tasks > Mass email). Users can also sign up for various email notifications in the User Control Panel. For some boards though these email notifications just doesn’t seem to work reliably, and sometimes don’t work at all. Perhaps some but not all of these emails go out.

Even if you don’t send out mass email regularly, phpBB has a number of features that depend on outgoing email servers to send out emails in a timely manner to all intended recipients. It’s been my experience that solving these issues is hard. This is particularly hard on shared hosting where there are quotas on the limits of outgoing emails. It’s made more confusing by phpBB’s inelegant interface for dealing with emails.

Thus these problems are very hard to troubleshoot. phpBB hands off email, generally to your host’s email server. Generally you have no idea where this email server is, what its policies are and how to determine if the email server is actually sending the emails. It often requires a support ticket to your web host, who may or may not provide accurate information.

Sorting this out can be very confusing which is why you might want to hire me. In most cases though I will have to work with your web host to fix these problems. Here are some useful techniques that can often solve these issues.

Setting phpBB’s email settings correctly

You can find your forum’s email settings in the Administration Control Panel: ACP > General > Client communications > Email settings. Things to check:

  • Enable board-wide emails. This should be Yes. Obviously if set to No, no emails will go out.
  • SMTP settings > Use SMTP server for email.
    • This is normally set to No. PHP is configured to send emails through your web host’s email server. This makes emailing simple in that you don’t need to know anything about the configuration of the email server.
    • If you have Windows hosting, you usually have to set this to Yes. In addition you will have to configure the SMTP server information fields appropriately using information provided by your web host. Getting SMTP email configured correctly is often challenging so SMTP should be avoided if possible. In addition, some web hosts don’t allow their servers to connect with external SMTP email servers. If you see in phpBB’s error log (ACP > Maintenance > Forum logs > Error log) messages like “Could not connect to smtp host : 110 : Connection timed out” this is probably because your host won’t allow external SMTP connections. If they provide an internal SMTP server, that is usually allowed.
  • Email package size. This is the maximum number of emails that will go out in one batch. So if you have 40 emails to send out and this is set to 20, the first 20 go out as a group. What happens to the other 20? They go into a queue. The next time there is traffic on your forum, phpBB will attempt to send out the next 20 emails in the queue. Set this to 0 and the queue goes away. There are some problems with this approach:
    • It’s slower because it takes time to send out an email to one user, wait for an acknowledgement from the mail server, then send the next
    • It’s possible that this will take so long that the process will time out, something more likely on shared hosting
    • If you hit some sort of outgoing email quota, not all emails will go out and you may not be aware there is a problem
  • Contact email address and return email address. These email addresses should exist as real mailboxes. Your web host control panel should have a feature allowing you to create email accounts. (You can also set up forwarders to send any email these accounts receive to one you will read.) In addition, it is highly advisable that these email addresses use your domain. Why? It lessens the likelihood that the email will be considered spam because:
    • It’s coming from an email address associated with the IP address of your domain
    • Because these email addresses actually exist it suggests the email is legitimate
  • Hide email addresses. If the same email is going to multiple recipients, the email addresses will be BCCed (Blind Carbon Copied) instead of placed on the TO field. Unless your host has a policy of not allowing BCCed emails to be sent, you should leave this set to Yes.

Verify your site name

ACP > General > Board configuration > Board settings. Verify that the Site name field is filled in. Some administrators will blank this out because they don’t want it to appear on their style, as they have substituted a logo for their site name. This is a mistake because outgoing emails, such as email notifications are not distinct. They look like spam because your site name is not in the subject. These emails will often be blocked from being sent at all, or placed in a spam folder if they are received by the recipient. If necessary, you can edit the overall_header.html file in your style’s template folder to hide or remove the site name. (Purge the cache afterward for the change to take effect.)

Verify your web host’s email policies

Since most phpBB forums are on shared servers, it’s important to know what limits there are if any for sending out emails. This can often be found buried in the host’s knowledge base but sometimes it takes a support ticket to know exactly what policies apply. Based on this information you can tune phpBB’s emailing algorithm to match your web host’s policies. Policies often have constraints like:

  • Only X emails can be sent over Y minutes or hours and/or
  • A maximum of Z distinct email addresses can be sent over Y minutes or hours and/or
  • Email FROM addresses must be real email addresses associated with your domain and/or
  • Sending emails using BCC is/is not allowed

With virtual private servers or dedicated servers these rules may be relaxed or not exist. In any event, email spam is obviously a huge issue. It’s reasonable to assume that your web host will be examining outgoing email and blocking any email it thinks is spam.

Setting the correct email package size

Based on knowing your host’s email policies you can figure out a correct email package size. For example, if a maximum of 25 emails can be sent every 5 minutes, a good email package size would be 25, although it might be better to set it a bit lower, perhaps to 20. If 25 are allowed and you set it to 40, then it’s possible 25 will go out and 15 will not.

Using a system cron

If your email package size is greater than 0, then phpBB will create a queue of emails if necessary. So if you have 25 to go out but specify 20 in a package, 20 will go out and 5 will go into a queue. When do the next five go out? Here’s the rub: by default they will go out the next time there is web traffic to your forum. (ACP traffic doesn’t count.) So if your board doesn’t get much traffic, it could be hours or days later before the next 5 emails go out. This is not good if your users expect timely notifications.

A better way is to use a system cron. This helps send emails out on a timely basis plus it allows you to be congruent with your web host’s email policies. Creating a system cron is a bit tricky and may require someone with these skills to set it up. Of course you can hire me to do this for you. Procedures are outlined on phpBB’s Wiki.

To enable a system cron, go to ACP > General > Server configuration > Server settings. Set Run periodic tasks from system cron to Yes, then program the necessary cron job on your web server. This will disable phpBB’s default cron that depends on board traffic. Instead, depending on the interval you set with the cron job, a system cron built into your web server’s operating system will trigger periodic events that will process the email queue and other phpBB work.

In the above example, if we know the policy is not to permit more than 25 emails per five minutes, a cron job like this could be programmed to run every five minutes:

*/5 * * * * cd "/path/to/board"; ./bin/phpbbcli.php cron:run

On shared hosting this often won’t work. See the Wiki for details, but something like this might work instead. (Note in this case you would not want to set Run periodic tasks from system cron to Yes.)

*/5 * * * * curl -A=Mozilla/4.0 http://www.yourforum.com/forum/cron.php?cron_type=cron.task.cron_task

Troubleshooting outgoing email issues

If there are errors sending out emails, phpBB may trap these in its Error log: ACP > Maintenance > Forum logs > Error log

Sometimes though phpBB cannot detect problems. You may find clues in your web server error log, if one exists and you can read it. Sometimes you will see an error_log file in your phpBB root folder, or in the website’s root folder, or in a /log directory that can be found with the web host’s File Manager. Looking at it or downloading it for examination may show error messages that will point to the root of the problem.

In many cases though you can’t solve them. You will have to get your web host involved. They will have to look at email server logs to see if anything shows there and provide guidance.

Troubleshooting recipient email issues

If you are confident that emails are being sent to users, then most likely they are being received but not seen because they are ending up in a spam folder. In most cases there is not much you can do about this problem.

Most email programs allow users to create rules to automatically move certain emails in the spam folder into their inbox instead.

It’s possible that your domain has been blacklisted for sending spam, or what others think is spam. You can check to see if this is a problem. In many cases you can appeal to the blacklist site and get the block removed. blacklistalert.org is one such site.

August 2017 work summary

Not too much work in August. However, what work I got involved some pretty challenging stuff! In addition clients that owed me some serious money finally paid up, making it the most profitable month of my year so far. One client liked my work so much he paid me double my regular rate! Here’s a summary of the work performed:

  • Updated the Cleantalk extension to version 5.2 for a client on whose forum I had recently installed Cleantalk 4.6. I assumed version 4.6 on phpbb.com was the latest but it was somewhat dated. It looks like Cleantalk has to wait months for extensions to get checked and approved like the rest of us. To get rid of the update message for the client, I found the latest version on GitHub and installed that. It has since been updated by Cleantalk and is now version 5.4.
  • Updated forum from phpBB 3.2.0 to 3.2.1 using the careful (all files refreshed) method. Experience has shown that using other methods introduces problems. I also updated the client’s Eles style to version 2.2.2. As requested I tried to paste a Facebook video into a post topic using ABBC3 extension and it worked.
  • Another moving a client from phpBB 2.0 using the dreadful Aabaco hosting to GoDaddy running phpBB 3.2.1. I blogged about it if you want all the details. What a mess!
  • Client wanted a way to see any posts that were posted without having to visit his forum. I suggested using my digests extension. He agreed so I installed version 3.2.4 of digests and programmed a cron to make it work automatically.
  • Moved forum to new host. The client did much of the legwork including DNS changes. I just moved files, created and populated a new database, set some permissions and changed config.php. No big deal.
  • Changed links to some videos that were embedded in the header of the forum to different URLs.
  • Updated a forum from phpBB 3.2.0 to 3.2.1 on Bluehost. Since prosilver_se is now available (client reverted to prosilver when I earlier upgrade him to phpBB 3.2) I reinstalled that style and applied a small version of the site logo.
  • Finished WordPress work started in January. Yes, I do some WordPress work in addition to phpBB. Back in January I installed WordPress for the client and he was going to have someone do the styling. All these months later that was finally finished and he wanted to make it live. So I moved WordPress which was in a /wordpress folder to the web root and put old Joomla CMS in a joomla folder. This was more complicated than it seems because WordPress database had to be searched to change path to take out /wordpress. This took a while to puzzle through. To do it I used two WordPress search and replace extensions. I then converted the phpBB 2 forum to phpBB 3.1.11. 3.1 was used because Slovenian language pack not available for 3.2. This type of conversion is always problematic, but it went smoothly. I used SQL to change all user’s default language to Slovenian. I installed the Elegance style then did a lot of customizing of Elegance style to make it match header on the old phpBB 2 forum. I added old logo and site menu below it which meant changing the style so that things matched the width of the logo at 1050 pixels. I also added a sidebar on right. I rebuilt search index. Later I was provided with a new new logo 1200 pixels wide. I installed it and adjusted styles to make it match the original 1200 pixel layout for the Elegance style again. Installed Google Analytics and open external links in new windows extensions. I fixed a letter in menu that wasn’t rendering correctly in Slovenian/ I made tweaks to sidebar. I explained how and where to make additional style changes. I provided guidance on spambot countermeasures.
  • I finished a long job started in May for an existing client. This was not glamorous work because she has a mixture of domains and web hosts and was trying to centralize all the hosting and domains. Trying to move all the domains into GoDaddy and all the hosting into a new host. It was very confusing work because she does not understand much about these topics and the information I needed to make these things happen were scattered among many vendors. In addition she has one consultant who did not want her to reclaim her domain and for a while would not change the domain to point to the new hosting. Quite a mess. There are still a few details left for the future but most of it was finished.