diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index cc73dcbd7f..dad8fea0c2 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -437,8 +437,11 @@ metadata_edit_custom_column_order = [] # public email server like gmx/hotmail/gmail. 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. +# calibre. You can also change the list of hosts that calibre considers +# to be public relays here. Any relay host ending with one of the suffixes +# in the list below will be considered a public email server. public_smtp_relay_delay = 301 +public_smtp_relay_host_suffixes = ['gmail.com', 'live.com', 'gmx.com'] #: The maximum width and height for covers saved in the calibre library # All covers in the calibre library will be resized, preserving aspect ratio, diff --git a/src/calibre/gui2/email.py b/src/calibre/gui2/email.py index d0ef891e9b..cc9e9fd91a 100644 --- a/src/calibre/gui2/email.py +++ b/src/calibre/gui2/email.py @@ -62,9 +62,11 @@ class Sendmail(object): self.rate_limit = 1 opts = email_config().parse() rh = opts.relay_host - if rh and ( - 'gmail.com' in rh or 'live.com' in rh or 'gmx.com' in rh): - self.rate_limit = tweaks['public_smtp_relay_delay'] + if rh: + for suffix in tweaks['public_smtp_relay_host_suffixes']: + if rh.lower().endswith(suffix): + self.rate_limit = tweaks['public_smtp_relay_delay'] + break def __call__(self, attachment, aname, to, subject, text, log=None, abort=None, notifications=None):