Hastymail2 is an Open Source IMAP webmail client written in PHP. Our focus is compliance, usability, security, and speed.
2015-04-16 Update:

Sadly Hastymail2 is no longer being maintained. Happily this is because we are working on a new web-based E-mail client, called Cypht. If you need support your best bet is the #hastymail IRC channel at freenode. Thanks to everyone who contributed to and supported this project!

Code Updates for February 11

    It's been another busy week for Hastymail development. Most of this weeks updates are display related, but there are some important updates to the AJAX system, the IMAP class, and sessions as well. My goal  is to push through a "first draft" of area with at least basic functionality first, then to go back and improve and expand it. Here are the highlights of whats new.

- CSS file changes. I decided to split a theme's CSS files into a main.css that gets included on every page, and a page specific css file that corresponds to the $pd->dsp_page value (new, login, mailbox, about, message, options, folders, contacts, search and compose to be exact). It adds the overhead of an additional HTTP request which I don't like, but it cuts down on overall page site by anywhere from 5 to 15K depending on the page.

- Added a search area to the mailbox view. You can search the current page, the entire folder, or all folders. Searching the current page reloads the mailbox view with any matches highlighted. Searching the entire folder or all folders takes you to the search results page. All search result UIDs are saved so whenever you browse a folder that contains a search result it is highlighted.  The detailed search form will be below the search results (if any) and has been started but is not functional yet.  The mailbox page search uses a new imap method called simple_search that has a limited amount of options to perform quick simple searches. The full search capability available on the search page will use a more thorough search method that allows more complex search parameters.

- Lots of improvements to the AJAX calls, specifically those made from the new mail page. Now we return an empty string to the first javascript update if the state of all the specified folders is unchanged (we were sending back the new page area regardless of whether or not it changed. This cuts down on bandwidth usage and improves the javascript run time by reducing the work that it needs to do on update. The new page update mechanism consists of 2 ajax calls chained together, one fires when the first is complete (If you have the folder list enabled then 3 calls are made).  After looking closely at the PHP these javascript calls trigger I was able to remove some duplicate IMAP related activity.

- A small but important fix to sessions when using the PHP5 only "regenerate session id" option. If we don't disable that during an AJAX request then if the user reloads a page after an AJAX request has been sent but before it returns, they would get logged out.  An interesting side note, the regenerate_session_id() function in PHP5 was not developed to do what we are using it for, at least initially. It was designed to simply seed a random session id for a new session, not to alter the session id during an existing session. However changing the id during the session is particularly useful so after PHP 5.1 an additional argument was added to the function to facilitate this type of use. It still works in older PHP 5 versions, however it does not clean up the old session file, obviously a problem if we are using it for every page load.

- More template and CSS tweaks all over the place. Templates are now html with <?php ?> tags inserted for dynamic bits. Also added some additional security to the templates by making it impossible for them to be loaded directly into the browser. There is still a lot of HTML being produced by the site_page class but piece by piece I am moving bits to the templates. The trick is to give the templates as much control over the layout as possible but at the same time not cluttering them up with too much confusing logic. Also added an "html_squish" option that removes spaces and newlines from the page just before it's sent to the browser. It cuts down on page size by a few Kb at the cost of some additional regex calls.


current mailbox page
Posted by Karen 1 year, 333 days ago
Instead of land into trust for a casino, a tbiral conservation land trust. It would be wonderful if the town, tribe, and kettle pond could work together to preserve natural resources here and expand the wildlife refuge.

Add a comment

Security Image:
security image
Enter the letters you see above.
Get Hastymail at SourceForge.net. Fast, secure and Free Open Source software downloads