mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
fixed #104
Consider an image is a remote one if it's not present locally.
This commit is contained in:
@@ -595,10 +595,11 @@ def find_images_in_body(body):
|
||||
o = urlparse(src)
|
||||
dirname = os.path.dirname(o.path).replace(settings.MEDIA_URL, "")
|
||||
fname = os.path.basename(o.path)
|
||||
path = os.path.join(settings.MEDIA_ROOT, dirname, fname)
|
||||
if not os.path.exists(path):
|
||||
continue
|
||||
cid = "%s@modoboa" % os.path.splitext(fname)[0]
|
||||
tag.set("src", "cid:%s" % cid)
|
||||
|
||||
path = os.path.join(settings.MEDIA_ROOT, dirname, fname)
|
||||
fp = open(path, "rb")
|
||||
p = MIMEImage(fp.read())
|
||||
fp.close()
|
||||
|
||||
Reference in New Issue
Block a user