Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Fighting Recruiter Spam with PHP – Proof of Concept
Oct 03, 2016 @ 11:56:29

On the SitePoint PHP blog editor Bruno Skvorc has a new tutorial posted showing a possible way to "fight recruiting spam" in your inbox with the help of a little bit of PHP.

The biggest concern I have with modern email providers, is the fact that they are all quite bad at spam control. [...] I don’t mean the “Nigerian prince” type of spam, which is mostly blocked successfully (unless you’re using FastMail – they can’t even recognize those) but stuff that I’m really, really not interested in getting. Case in point, recruiter spam.

In this tutorial, we’ll get started with building a custom email processor which can read individual emails, run them through some predefined rules, and act on them. The end result will be very similar to what many providers offer out of the box, but it’ll lay the groundwork for more advanced aspects in future posts.

His example application will do things like: do keyword matching for recruiter-ish things and auto-reply (then delete the original) and purge emails sent after unsubscribing from the service. He builds out the example application on a Homestead Improved VM, coming pre-installed with the IMAP extension for PHP (used to access the user's inbox). He then installs the tedivm/fetch package for the PHP code and shows how to read the emails from your inbox. He uses the FastMail service so he walks through how to hook the script into that service using an "application password".

From there he develops the functionality of the application including:

  • pattern matching on the body contents for "recruiter-ish" terms
  • setting a "points" threshold for the number of matches
  • sending replies with Swiftmailer
  • whitelisting certain terms
  • moving the messages into an "auto-replied" folder so we know who the script talked to

All of the code you'll need is included in the post along with several screenshots that help to ensure you're on the right path.

tagged: recruiter spam inbox script autoreply tutorial imap

Link: https://www.sitepoint.com/fighting-recruiter-spam-with-php-proof-of-concept/

DevShed:
Coding Folders for a PHP Email Application
Nov 15, 2006 @ 09:07:36

In their continuing series on creating an email application in PHP, DevShed has posted this new article showing how to create folders for the application, letting you sort and store the messages easily.

In this article, the fourth and final one of our series covering the creation of a PHP email application, we are going to look at the code for some of the remaining pages of the mail application. Chief among these is the NewMsg.php page, which is where items, to be more precise, new messages, are either saved as drafts or saved as sent messages.

They give the code to display the message, including its location, before getting on to the form handling script for the results. There's some extra code included in this handling functionality, so they finish up by explaining what those sections do and how to add on one more folder - the Trash.

tagged: email application folders inbox sent trash unfiled tutorial email application folders inbox sent trash unfiled tutorial

Link:

DevShed:
Coding Folders for a PHP Email Application
Nov 15, 2006 @ 09:07:36

In their continuing series on creating an email application in PHP, DevShed has posted this new article showing how to create folders for the application, letting you sort and store the messages easily.

In this article, the fourth and final one of our series covering the creation of a PHP email application, we are going to look at the code for some of the remaining pages of the mail application. Chief among these is the NewMsg.php page, which is where items, to be more precise, new messages, are either saved as drafts or saved as sent messages.

They give the code to display the message, including its location, before getting on to the form handling script for the results. There's some extra code included in this handling functionality, so they finish up by explaining what those sections do and how to add on one more folder - the Trash.

tagged: email application folders inbox sent trash unfiled tutorial email application folders inbox sent trash unfiled tutorial

Link: