Need your thougts on a strategy for IMAP and HTML Mail

IT_Architect

Verified User
Joined
Feb 27, 2006
Messages
1,080
Situation:
- I have a separate SquirrelMail configured to do HTML mail.
- Currently I have the images associated with composing an e-mail all stored in the same directory. While a user cannot list them, he could easily learn them because his will get renamed on upload and he will realize there is another one with the same name he uploaded, and could retrieve that.
- I do not have an area where a user can upload images he might want to commonly use for sending e-mails.

What I need:
1. I need to understand the logic of Maildir, POP3, and IMAP storage. It appears that there is a Maildir directory for the user, and another in the IMAP area for each virtual user. In the user one, only the new subdirectory has files in it. The ones in the IMAP area, appear to be the INBOX of the virtual users, and only has files in the new folder. In the hidden sub-folders, such as INBOX.Sent, I see files only iin the cur directory. I don't understand the logic here.

2. I need to understand how Maildir, POP3, and IMAP relate to each other. When I delete an E-Mail in SquirrelMail, it won't be downloaded by POP3, and if POP3 deletes it, it will no longer show in SquirrelMail. However, when I look in the IMAP folders, I see messages just like in the user Maildir folder. I assume that POP3 is working off the user Maildir folder, but it appears there are two copies of Inbox messages. I'm guessing that the IMAP Maildir hidden sub-folders have messages separate from what POP3 sees and aren't deleted when POP3 deletes messages.

3. SquirrelMail has a Data directory to store user preferences and address books that are separate from the DA user area. It also maintains and Attach directory for E-Mail attachments for E-Mails that have not been sent yet. However, here is where things get messy. When composing HTML messages, and uploading them to embed them into a document, the uploaded images are stored in an upload directory. These images must persist in this directory:
a. To be able to view them with the messages in the Sent directory.
b. For the user on the receiving end to get them.
c. For them to survive a trip to Drafts.
Having a common directory for all users is not a usable scenario. Even though you can prevent the users from listing them, they will discover others when their uploaded graphic gets renamed from the Invoice.jpg to Invoice(2).jpg. All they need to do is change the name to Invoice.jpg, and they have the other business's invoice in front of them. That means that I need to have a separate directory for each virtual user for their images. To upload images, that directory probably needs to allow substantial rights access. Because of the way SquirrelMail works, it needs to be able to resolve the path to that directory from both JavaScript and PHP. What I need here is a good strategy for implementing the storage and rights of these images.

4. For maintenance, I'm contemplating a cron that erases all files over 30 days old from the Data directory to clean out stranded attachments, and from the Uploads directory, of images that go with Sent items and drafts. That fits with the policy that messages over 30 days old will be deleted from the server. The User images area I will not clear. I don't have a clean strategy of how to delete old entries in the SquirrelMail data directories if the domain no longer exists on the server. I'm not sure if DirectAdmin has either. They also don't take much space.

A good strategy for number 3 would be huge. That's the real show-stopper!

Thanks TONS!!! :)
 
Last edited:
Back
Top