Sending email from a web site using PHP’s mail() function is a pretty routine task. Contact forms, friend requests, alerts, errors… Servers hosting one or two sites the time to send an email is not even noticeable, but on a server that hosts 200+ sites the time creeps up the two to three second range.
In a shared server environment like we have at Wayne State University, we have found there is no easy way to keep track of the emails being sent through php’s mail() function. It would take an analysis of the mail server logs or a friendly sysadmin of another server to alert you if there is a bot taking advantage of a mail() script on your site.
To combat this we are developing an extension for PHPSimpl’s Mail class to instead of send out an email directly to inserts the message into a database and every five minutes a cron runs to send out all emails in the table and records them in a sent table.
This accomplishes:
Making pages load faster, a DB insert is faster than a mail() function.
Frees up server resources to host pages instead of doing sendmail’s.
Determines really how many emails are being sent from the web server.
Keeping track of what sites are sending mail from what pages and by who.
The ability to flag emails before they are sent with keywords like “Viagra” and “Enlargement”.
We are currently just testing the system and hope to include it right into PHPSimpl as a main class but it still needs some stress testing. So far the tests have all came back positive, we have discovered a few of our own forms that have been taken advantage of and we resolved some potential issues.
We also over estimated the amount of emails being sent out, we thought with 200 or so sites it would be ~500-700 emails a day, well it turns out once we fixed a few of the forms we are only sending out ~100 emails a day, not bad.
The graph at the top of the post is the last 5 days and how many emails have been sent out. Today the 6th there has only been 4 emails so far at the time i took the screenshot, 8am.
On the 4th we saw a spike in bot related emails, after some investigation and a few recaptcha additions we just about halved the number of emails the next day.
Next week we hope to have the system fully functional and have a better analysis and report of our findings.
So it has been a full day in my own office and unfortunately I didn’t get much time to myself. The Publications team was gone to a conference so we moved all of their desks and computers to their new working space. I was only in my office for increments of 5 minutes to check mail and phone.
The photo attached is the office how I got it. Nothing of mine in there and nothing cleaned. Not at least my computer is in there, things are cleaned up and I have a whiteboard. I will post another picture when it is all done.
Having your own space is like being inside a bubble, I am use to working in a large room with eight or so people. If I had a question about something I could just ask it while still staring at my computer and working. Who ever knew the answer would shout it out and work would continue. Although my office is right next to the pit I cannot hear whats going on out there, I have to rely on alternative methods to communicate. IM mainly but typing is though on the wrists sometimes. I kinda wish everyone had an iSight and we would all just talk and see each other.. nevermind, creepy.
Anyone have any good suggestions on how to deal with communicating when isolated in your own office?
The web is filled with forms and the more social sites get the more forms required. At Wayne State we end up creating a lot of forms for a lot of purposes. I am going to take for for example and show how we have come up with a fully flexible html form and how you can adopt it too.
So I thought moving was easy… I thought wrong. Yesterday I decided although my new site was not fully complete in development that I would sign up for Joyent hosting and get everything setup so in the next week I would be all ready to launch the new site. I picked my plan, put in my CC info and then waited… three minutes to be exact, and I was not surprised to see a large “Opps something went wrong” page. After checking my email I noticed that I did get an email saying my CC was charged but what was odd was their was no invoice number. Fearing I would be double charged I didn’t resubmit my CC info and clicked their friendly Help link. I submitted a ticket outlining all my steps and intentions and waited…
My current host (not blogger) but for my client work always respond within 30 minutes with at least a We see the issue and we will get someone working on it. But every hosting company is different so I thought I would just wait it out. Well it is 24 hours later and still no response. All that has changed was it was assigned to a “Chris Morris”. So I put in a response confirming that 24 hours have gone by and asking if they had an estimated time frame for responding to issues. That was three hours ago and still no response.
So I am trying my best to keep it positive but if this is the way a hosting company treats its potential customers they better have some damn good servers and uptime.