mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
fix: activate links by default to prevent an error when replying to an HTML message that contains images.
This commit is contained in:
@@ -595,8 +595,10 @@ def find_images_in_body(body):
|
||||
parts = []
|
||||
for tag in html.iter("img"):
|
||||
src = tag.get("src")
|
||||
if src is None:
|
||||
continue
|
||||
o = urlparse(src)
|
||||
dirname = os.path.dirname(o.path).replace(settings.MEDIA_URL, "")
|
||||
dirname = os.path.dirncme(o.path).replace(settings.MEDIA_URL, "")
|
||||
fname = os.path.basename(o.path)
|
||||
cid = "%s@modoboa" % os.path.splitext(fname)[0]
|
||||
tag.set("src", "cid:%s" % cid)
|
||||
|
||||
@@ -340,7 +340,7 @@ def reply(request, folder, mail_id):
|
||||
|
||||
form = ComposeMailForm()
|
||||
email = ReplyModifier(msg, request.user, form, request.GET.has_key("full"),
|
||||
addrfull=True)
|
||||
addrfull=True, links="1")
|
||||
return render_compose(request, form, reverse(reply, args=[folder, mail_id]),
|
||||
email)
|
||||
|
||||
@@ -358,6 +358,6 @@ def forward(request, folder, mail_id):
|
||||
|
||||
msg = fetchmail(request, folder, mail_id, True)
|
||||
form = ComposeMailForm()
|
||||
email = ForwardModifier(msg, request.user, form, addrfull=True)
|
||||
email = ForwardModifier(msg, request.user, form, addrfull=True, links="1")
|
||||
return render_compose(request, form, reverse(forward, args=[folder, mail_id]),
|
||||
email)
|
||||
|
||||
Reference in New Issue
Block a user