added sender to maillisting in imapy
This commit is contained in:
17
imapy.py
17
imapy.py
@@ -84,14 +84,21 @@ def decode(data):
|
|||||||
res+= part[0].decode(part[1])
|
res+= part[0].decode(part[1])
|
||||||
return "".join(res.split())
|
return "".join(res.split())
|
||||||
|
|
||||||
|
def retrieve(num,field):
|
||||||
|
global im
|
||||||
|
res, data = im.fetch(num,"BODY.PEEK[HEADER.FIELDS ({})]".format(field))
|
||||||
|
x,y = data[0]
|
||||||
|
y=force_decode(y)
|
||||||
|
y=y.split(":",1)
|
||||||
|
y=y[1]
|
||||||
|
return decode(y)
|
||||||
|
|
||||||
def get_subject(num):
|
def get_subject(num):
|
||||||
global im
|
global im
|
||||||
res, data = im.fetch(num,'BODY.PEEK[HEADER.FIELDS (SUBJECT)]')
|
# res, data2 = im.fetch(num,'BODY.PEEK[HEADER.FIELDS (FROM)]')
|
||||||
x,y = data[0]
|
y=retrieve(num,"SUBJECT")
|
||||||
y=force_decode(y)
|
z=retrieve(num,"FROM")
|
||||||
y=y[9:]
|
return "{} von <{}>".format(y,z)
|
||||||
return decode(y)
|
|
||||||
|
|
||||||
def get_mail(num):
|
def get_mail(num):
|
||||||
global im
|
global im
|
||||||
|
|||||||
Reference in New Issue
Block a user