olia-dev / kopano-webapp-fetchmail

The Plugin allows the user to configure one or more accounts to be polled via fetchmail inside of Kopano WebApp.
Other
7 stars 6 forks source link

Support IMAP IDLE #5

Open XtraLarge opened 6 years ago

XtraLarge commented 6 years ago

Hello,

First: Your Plugin is great! .... a really anhancment for me!

I've only I little request, which would give many users a solution for the ploblem of delayed mails because of using fetchmail.

Fetchmail supports the option "imap idle". Using this option results in holding a session to the IMAP Server and if a message arrives it will be transfered immediately and the user must not wait to the next schedule.

Many implementations of the fetchmail daemon uses only one fetchmail instance for all accounts, which will poll all accounts in sequence. So, if you use the "idle" option for an account. Fetchmail didn't continue to poll the accounts after the account using imap idle, because of holding the imap session. So they would be only polled if the session to the imap idle account collapses.

The solution for that is, that you must make a seperate config and fetchmail instance for every imap idle account.

I've take a look in your daemon script and saw that you have already create an instance for every user and that you have assigned an id for every poll-accout per user. So if change all accounts using idle to a seperate instance and config it will work perfectly.

best regards Willi

olia-dev commented 6 years ago

I generally like the idea, but the way I build the actual fetchmail polling process wouldnt work with IMAP IDLE. My polling daemon never actually starts fetchmail as a daemon, just triggers fetchmail via cli once. Then it waits until the defined polling time elapsed and calls fetchmail again.

To use IMAP IDLE I would have to directly start the fetchmail daemon (for every IMAP account that should use IDLE). That would probably mean rebuilding the whole process. And while I would like to do that, time is sadly limited :-)

So, if you (or anyone else) is interested to rebuild the process, please do! I'm always interested in contributions and will gladly merge pull requests (and release a new version).

XtraLarge commented 6 years ago

Hello, I've take a second look in the sorcecode. I saw that you write a seperate config for every account. Thats great. The next step is starting a fetchnmail process and pipe the output to the database.

If I see right, the problem is that after setting "idle" the fetchmail process never ends, but I saw you check on every loop if fetchmail is already running, so if it is running you do nothing. That's also great, because a running process will not interfered and if the idle process breaks it will be restarted.

So, what is the problem?