From 82ffe9d10775e52852385d3454f3650bbebfcd46 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 30 Dec 2010 23:26:25 -0700 Subject: [PATCH] Add a tweak to control the delay when sending mails using gmail or hotmail. Fixes #8064 (Email 5 Min. Added to Options) --- resources/default_tweaks.py | 8 ++++++++ src/calibre/gui2/email.py | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index a2a9a0a043..7eafc5b357 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -315,3 +315,11 @@ locale_for_sorting = '' # metadata one book at a time. If True, then the fields are laid out using two # columns. If False, one column is used. metadata_single_use_2_cols_for_custom_fields = True + +# The number of seconds to wait before sending emails when using a +# public email server like gmail or hotmail. Default is: 5 minutes +# Setting it to lower may cause the server's SPAM controls to kick in, +# making email sending fail. Changes will take effect only after a restart of +# calibre. +public_smtp_relay_delay = 301 + diff --git a/src/calibre/gui2/email.py b/src/calibre/gui2/email.py index 2911222ba8..6b2ed81413 100644 --- a/src/calibre/gui2/email.py +++ b/src/calibre/gui2/email.py @@ -22,6 +22,7 @@ from calibre.customize.ui import available_input_formats, available_output_forma from calibre.ebooks.metadata import authors_to_string from calibre.constants import preferred_encoding from calibre.gui2 import config, Dispatcher, warning_dialog +from calibre.utils.config import tweaks class EmailJob(BaseJob): # {{{ @@ -83,7 +84,7 @@ class Emailer(Thread): # {{{ rh = opts.relay_host if rh and ( 'gmail.com' in rh or 'live.com' in rh): - self.rate_limit = 301 + self.rate_limit = tweaks['public_smtp_relay_delay'] def stop(self): self._run = False