> How? I know that imaplib allows selection of mailbox folders using
> *mail.select("mailbox")*
>
> But how does one do that directly in the model while using DAL?
>
>
imap = DAL(...)
# declares a mailbox table linked to the imap server INBOX folder.
# only declared folders will be available.
imap.define_tables({"inbox": "INBOX"})
 

> Does or does not every http request cost a lot more time and bandwidth in 
> and by itself?
>
>
http reqests cost time and bandwidth. The less the better. 

So, you strongly recommend using another DB? But would that not be 
> redundant as all the information will already be on the IMAP server, and 
> any deletion or copy-move on the server affect the integrity of the data 
> stored in the external DB?
>
If I'd need a fast way of retrieving imap info, I'd go with postgres or 
similar db and fetch mail periodically with a script. Nevermind the 
rendundancy and consistency as long as you use a single source and unique 
ids for handling the data.

But what might be causing that problem?

I have no idea. Maybe a gmail/imaplib issue?
 

Will it be faster to fetch a single Email's content with UID using DAL? Or 
rather which of the following is faster:
 — Query using imaplib = returns a list of UID + Fetch each email content 
using DAL
 — Query using DAL + Fetch email content using DAL


The fastest option is to use imaplib to query for uids and then get each 
message as needed. It would be possible to patch IMAPAdapter so DAL selects 
are faster when one only needs the id field.
 

Tried it briefly. Not tried it fully yet. If you do, can you add some of 
its features to the DAL adapter?


Currently I cannot, but I will when I can, specially if bulk messages work; 
but it would take to add the library to gluon and it might need approval 
from the devs.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to