mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Fix #6723 (problem sending email)
This commit is contained in:
parent
4849c4269b
commit
547a063f68
@ -50,8 +50,9 @@ def get_mx(host, verbose=0):
|
||||
if verbose:
|
||||
print 'Find mail exchanger for', host
|
||||
answers = list(dns.resolver.query(host, 'MX'))
|
||||
answers.sort(cmp=lambda x, y: cmp(int(x.preference), int(y.preference)))
|
||||
return [str(x.exchange) for x in answers]
|
||||
answers.sort(cmp=lambda x, y: cmp(int(getattr(x, 'preference', sys.maxint)),
|
||||
int(getattr(y, 'preference', sys.maxint))))
|
||||
return [str(x.exchange) for x in answers if hasattr(x, 'exchange')]
|
||||
|
||||
def sendmail_direct(from_, to, msg, timeout, localhost, verbose):
|
||||
import smtplib
|
||||
|
Loading…
x
Reference in New Issue
Block a user