[Patch] Background mail transmission

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Patch] Background mail transmission

Albrecht Dreß
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!

Cheers,
Albrecht.


---
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
_______________________________________________
balsa-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/balsa-list

smtp-background.diff.xz (19K) Download Attachment
attachment1 (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Patch] Background mail transmission

Peter Bloomfield
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Albrecht:

On 06/18/2017 08:25:10 AM Sun, Albrecht Dreß wrote:

> 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!

As always, thanks for all the effort that went into the patch! Builds and works for me, though I haven't yet had a chance to test delayed sending with multiple SMTP servers.

Pushed to master, to get wider testing…

Best,

Peter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAllHDOIACgkQH1/UtbkqdPV85QCfWddIzs13y88msvwxoJaUws4X
z74AoJdEjCFUB4CCVF6ZgKEp1KW2iK6m
=XGS2
-----END PGP SIGNATURE-----
_______________________________________________
balsa-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/balsa-list
Loading...