mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix extraction of recipient email address when piping a message to calibre-smtp
This commit is contained in:
parent
f03320ac76
commit
38e2a5bdc1
@ -264,10 +264,7 @@ def main(args=sys.argv):
|
|||||||
eml = message_from_string(msg)
|
eml = message_from_string(msg)
|
||||||
tos = eml.get_all('to', [])
|
tos = eml.get_all('to', [])
|
||||||
ccs = eml.get_all('cc', []) + eml.get_all('bcc', [])
|
ccs = eml.get_all('cc', []) + eml.get_all('bcc', [])
|
||||||
all_tos = []
|
eto = [x[1] for x in getaddresses(tos + ccs) if x[1]]
|
||||||
for x in tos + ccs:
|
|
||||||
all_tos.extend(y.strip() for y in x.split(','))
|
|
||||||
eto = list(map(extract_email_address, all_tos))
|
|
||||||
if not eto:
|
if not eto:
|
||||||
raise ValueError('Email from STDIN does not specify any recipients')
|
raise ValueError('Email from STDIN does not specify any recipients')
|
||||||
efrom = getaddresses(eml.get_all('from', []))
|
efrom = getaddresses(eml.get_all('from', []))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user