Paul J Stevens schrieb: > Daniel Urstöger wrote: >> Hello people, >> >> I am currently developing a web interface for accessing emails >> within dbmail directly through that web site, something like Horde or >> Roundcube but specifically for dbmail. >> Reading access is handled directly via SQL and changing stuff I mainly >> handle via IMAP. > > Mmm, please consider that storage models can and will change. The IMAP > protocol > and it's RFC extensions are cast in solid rock.
yes, I will have to update my script accordingly, it just gives me quite an advantage accessing the data directly via SQL and not havening IMAP as intermediate layer, performance wise. >> Two questions have came up though: >> >> 1). how can I see if a email has been forwarded? There is a flag >> for answered but forwarded doesn´t seem to be there. > > That's correct. Forwarded is not a supported flag (yet). Okay, so how does a mail client recognize this? via an IMAP command to? >> 2). is there an easy way to determine if an email has an attachment or >> not? I could use a simple check of size but this is not 100% accurate >> and parsing through all emails and check the mime structure becomes >> quite time consuming. > > For now: use IMAP's "FETCH n (BODYSTRUCTURE)" hmm, (without looking in the source code of dbmail) what does happen here? The whole message is opened by the IMAP daemon, the structure is extracted from the message and then returned? if so, I could do that in a PHP subroutine too and maybe cut the system resources a bit ... > 2.3.0 (coming to you later this month) will support arbitrary labels. Whether > a > message will then be flagged when forwarded depends on the client. 2.3 will > also > use a radically different storage model for messages that will make it > non-trivial (read near impossible) to reconstruct messages through simple sql > without doing mime-reconstruction. well Paul, here we are: basically my script does two things: first it generates a list of all messages in the inbox and shows one of them accordingly to users settings ( just like the overview in Outlook / Thunderbird). So, the overview list is basically the dbmail_messages table with a few joins ( like subject, etc.) so far and showing the selected messages it has to deal with mime already. BUT if for the overview I have to open EVERY email completly and look around for mime stuff that will significantly drop performance. Atm the script is able to handle 2000 emails in the inbox within 2 seconds of page load time and I like that to keep this that way. If not possible I would have to cache information but mainly I have performance in mind. and thanks for your swift reply! cheers, Daniel > >> Well, thanks for your help! >> >> Kind regards, >> Daniel >> _______________________________________________ >> DBmail mailing list >> [email protected] >> https://mailman.fastxs.nl/mailman/listinfo/dbmail >> > > _______________________________________________ DBmail mailing list [email protected] https://mailman.fastxs.nl/mailman/listinfo/dbmail
