[Patch] Background mail transmission

Hi all,

attached is a patch implementing the automatic sending in background feature.  This includes
- a new configuration option, pretty much like the periodic check for incoming messages
- parallel transmission to multiple SMTP servers in separate threads
- a new progress dialogue, showing the operation of one or more connections which are faded in or out
- some re-factoring of the send functions.

Basically, the function is:
- When the user sends a message (see libbalsa_message_send), the timer is stopped and it is transmitted 
immediately unless a send operation to the particular server is already active.  In the latter case, an 
atomic flag is set to immediately send the message when the previos operation has been finished.
- When the user queues a message (see libbalsa_message_queue), the send timer is re-started.
- Sending the queue (see libbalsa_process_queue) counts the ready-to-send message in the outbox, and launches the 
"real" send operation for all smtp servers which are not occupied.
- When the auto-send timer expires, basically libbalsa_process_queue() is called, but without showing the 
progress dialogue.  A notification is displayed instead.
- If the progress dialogue is hidden the final message is displayed as notification.

A possible extension which should be somewhat easy to implement could be an automatic trigger of the timer 
callback (in an idle or a timer callback) if the network comes up.

As always, additional testing and reviewing as well as any feedback will be highly appreciated!


Patch details:
- libbalsa/libbalsa-progress.[ch]: new files, implementing the progress dialogue.  Its update operation shall 
be called using idle callbacks.  For the time being, it is used for SMTP only, but it might also be useful 
for receiving messages.
- libbalsa/Makefile.am: add the aforementioned new files
- libbalsa/send.c: implement the core of the patch, and do some re-factoring to make the source better 
readable.  Add functions for the auto-send timer stuff.  Remove the old send message dialogue implementation.
- libbalsa/send.h: export functions for controlling the auto-send feature, and remove the old progress 
dialogue stuff
- libbalsa/smtp-server.[ch]: extend the smtp server class by a lock flag, implemented as atomic variable
- src/balsa-app.c: implement auto-send callback, and initialise the feature
- src/balsa-app.h: add auto-send application variables
- src/main-window.c: remove old progress dialogue callback
- src/main.c, src/threads.h: remove old progress dialogue globals and initialisation
- src/pref-manager.c: configuration of the auto-send feature
- src/save-restore.c: load and save the configuration of the auto-send feature

Attachment: smtp-background.diff.xz
Description: application/xz

Attachment: pgpyX_2MkqrQE.pgp
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]