 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
DevShed: A Better Way to Determine MIME Types for MIME Email with PHP
by Chris Cornutt July 24, 2008 @ 07:53:18
Continuing on in their look at sending MIME emails with PHP, DevShed has posted a better way for you to determine the correct MIME type of the file you're wanting to send (third part of the series).
I demonstrated how to build a modular MIME mailer class in PHP 4; it was provided with the capacity to send messages in plain text, and to work with different types of file attachments. This class implements a private method, called "getMimeTypes()," which, as its name would suggest, comes in handy for determining the correct MIME type of a given file. [...] However, the logic implemented by this method is rather primitive and can definitely be improved.
They start with a review of the previous code (PHP4) and show how to get the correct mime type of the file based on the extension mapped to an array of types.
voice your opinion now!
mime tutorial type mail php4 class getmimetypes extension
Paul Jones' Blog: Sending Mail with Solar
by Chris Cornutt July 18, 2007 @ 13:48:00
Paul Jones has posted a new tutorial about using the mail functionality of the Solar framework - the Solar_Mail and Solar_Stmp packages.
While each of these [PEAR Mail, PhpMailer, SwiftMailer, Zend_Mail] will work with Solar, the new Solar_Mail and Solar_Smtp packages work "natively", in that they support automatic configuration, locale and exception inheritance, and so on. Read on for some examples on how to use them.
In his example he sets up and sends a simple message, setting the contents of the email (sent as an HTML message). Since there's been much talk about the safety of a lot of the mailing systems in frameworks, Paul talks about how it's been secured from header injections, through safe attachments, and from a transport dependency-injection for SMTP.
There's even a method included that lets you take the SMTP information out of the script and put it into the Solar configuration file to use in the entire application.
voice your opinion now!
mail solar framework tutorial attachment header injection transport dependency mail solar framework tutorial attachment header injection transport dependency
Zend Developer Zone: Security Tips #10, #11, and #12
by Chris Cornutt March 19, 2007 @ 11:24:00
The Zend Developer Zone has posted three new helpful security tips to add to their growing list - one on mailing, one about working with privileges, and the other on the dangers of eval:
- In tip #10, Cal looks briefly at some of the dangers of blindly using form input when sending a mail. One never knows what kind of nasty headers a user might enter.
- Tip #11 recommends the "path of least privileges" when it comes to allowing access to your application. Don't go global when simple will do just fine - even with the best of intentions, the wrong access can lead to big issues.
- Finally, in tip #12, one of the more discouraged functions in PHP is discussed - eval. This one little function, when fed the wrong kind of string, can unravel your application from the inside out and provide a would-be attacker just the opening they might need.
You can check out more great security tips like these on the Zend Developer Zone website.
voice your opinion now!
securitytip eval mail form filter input privilges securitytip eval mail form filter input privilges
Ilia Alshanetsky's Blog: mail() logging for PHP
by Chris Cornutt December 13, 2006 @ 16:56:00
In his latest blog entry, Ilia Alshanetsky has proposed (and provided) a patch that can help with one of the more abused of the popular PHP functions out there - mail().
One of the problems with solving the mail() abuse is figuring out who is doing it or perhaps what script was exploited to do it, since the mail() function does not offer any logging mechanism.
To address this problem, he's supplied this patch you can apply to your source to add two new options to the mail function:
- enable the addition of the X-PHP-Originating-Script header
- mail.log (takes a filename) allows you to enable logging of every single mail() call
Check out his entry for more details on configuration options and other functionality included with the patch.
voice your opinion now!
mail logging function patch add header configure mail logging function patch add header configure
|
Community Events
Don't see your event here? Let us know!
|