diff --git a/swaks-tests/nonmime-html-responsive.raw b/swaks-tests/nonmime-html-responsive.raw new file mode 100644 index 0000000..baa1c92 --- /dev/null +++ b/swaks-tests/nonmime-html-responsive.raw @@ -0,0 +1,394 @@ +Date: %DATE% +To: %TO_ADDRESS% +From: %FROM_ADDRESS% +Subject: tutsplus responsive (broken images) +MIME-Version: 1.0 +Content-Type: text/html; charset="UTF-8" + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+

Lorem ipsum dolor sit amet

+

+ Compare to: + + tutsplus sample +

+ +

Copyright (c) 2015, Envato Tuts+
+ All rights reserved.

+ +

Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met:

+ +
    +
  • Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer.
  • + +
  • Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution.
  • +
+ +

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+
+
+ +
+ + + + +
+ + + + + + + +
+ +
+ Maecenas sed ante pellentesque, posuere leo id, eleifend dolor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. +
+
+
+ +
+ + + + +
+ + + + + + + +
+ +
+ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Maecenas sed ante pellentesque, posuere leo id, eleifend dolor. +
+
+
+ +
+ +
+ + + + +
+ + + + + + + +
+ +
+ Scelerisque congue eros eu posuere. Praesent in felis ut velit pretium lobortis rhoncus ut erat. +
+
+
+ +
+ + + + +
+ + + + + + + +
+ +
+ Maecenas sed ante pellentesque, posuere leo id, eleifend dolor. +
+
+
+ +
+ + + + +
+ + + + + + + +
+ +
+ Praesent laoreet malesuada cursus. Maecenas scelerisque congue eros eu posuere. +
+
+
+ +
+ +
+ + + + +
+

Fashion

+

Class eleifend aptent taciti sociosqu ad litora torquent conubia

+

Read requirements

+
+
+ +
+ + + + +
+

Photography

+

Maecenas sed ante pellentesque, posuere leo id, eleifend dolor

+

See examples

+
+
+ +
+ + + + +
+

Design

+

Class aptent taciti sociosqu eleifend ad litora per conubia nostra

+

See the winners

+
+
+ +
+ + + + +
+

Cooking

+

Class aptent taciti eleifend sociosqu ad litora torquent conubia

+

Read recipes

+
+
+ +
+ + + + +
+

Woodworking

+

Maecenas sed ante pellentesque, posuere leo id, eleifend dolor

+

See examples

+
+
+ +
+ + + + +
+

Craft

+

Class aptent taciti sociosqu ad eleifend litora per conubia nostra

+

Vote now

+
+
+ +
+ +
+
+ + diff --git a/swaks-tests/run-tests.sh b/swaks-tests/run-tests.sh index 3574f92..62e6bd3 100755 --- a/swaks-tests/run-tests.sh +++ b/swaks-tests/run-tests.sh @@ -45,3 +45,6 @@ swaks $* --data gmail.raw # Outlook test swaks $* --data outlook.raw + +# Nonemime responsive HTML test +swaks $* --data nonmime-html-responsive.raw diff --git a/themes/bootstrap/public/inbucket.css b/themes/bootstrap/public/inbucket.css index d5487c8..0da5a2f 100644 --- a/themes/bootstrap/public/inbucket.css +++ b/themes/bootstrap/public/inbucket.css @@ -6,8 +6,8 @@ html { body { padding-top: 70px; - /* Margin bottom by footer height */ - margin-bottom: 60px; + /* Margin bottom by footer height + safety */ + margin-bottom: 100px; } .footer { diff --git a/themes/bootstrap/templates/mailbox/_show.html b/themes/bootstrap/templates/mailbox/_show.html index 08be4f8..3825e5c 100644 --- a/themes/bootstrap/templates/mailbox/_show.html +++ b/themes/bootstrap/templates/mailbox/_show.html @@ -60,6 +60,13 @@ +{{if .isTextFromHTML}} + +{{end}} +
{{.body}}
{{with .attachments}} diff --git a/webui/mailbox_controller.go b/webui/mailbox_controller.go index 717281e..523a5c6 100644 --- a/webui/mailbox_controller.go +++ b/webui/mailbox_controller.go @@ -180,12 +180,13 @@ func MailboxShow(w http.ResponseWriter, req *http.Request, ctx *httpd.Context) ( htmlAvailable := mime.HTML != "" return httpd.RenderPartial("mailbox/_show.html", w, map[string]interface{}{ - "ctx": ctx, - "name": name, - "message": msg, - "body": body, - "htmlAvailable": htmlAvailable, - "attachments": mime.Attachments, + "ctx": ctx, + "name": name, + "message": msg, + "body": body, + "htmlAvailable": htmlAvailable, + "isTextFromHTML": mime.IsTextFromHTML, + "attachments": mime.Attachments, }) }