Hi,
I have now installed Gargoyle on a router with 16 MB of flash memory to be able to make use of some of the nice plugins that are available, including "Email notifications for Gargoyle (with SSL support) 2.0-3".
However, all emails that I received from Gargoyle showed no content, neither with Thunderbird, nor when viewed via my email provider's webmail portal. (basically like what other users mentioned before here in this thread)
I could see that the content was actually there by viewing the source code of the emails in Thunderbird.
These emails also show with a date of 1970/1/1 in Thunderbird.
After poking around in the code (I am not an expert) and comparing to other emails that display properly I found that adding an empty line before the actual html code fixed the whole problem.
I do not know why this empty line is apparently so important, but I found it in every email that I checked. (I mean every email other than the ones sent by Gargoyle)
So, in "email.sh" I changed the line
echo -e "Subject: Gargoyle Router report - $(date)\r\nFrom: $(cat /etc/msmtprc | grep from | sed "s/ from //")\r\nContent-Type: text/html; charset='UTF-8';\r\n<html><body>" > /tmp/email-log.txt;
to
echo -e "Subject: Gargoyle Router report - $(date)\r\nFrom: $(cat /etc/msmtprc | grep from | sed "s/ from //")\r\nContent-Type: text/html; charset='UTF-8';\r\n\r\n<html><body>" > /tmp/email-log.txt;
I think the same modification would need to be made in "email.js" ("function testMail()") in order to have emails sent by "Send test email" displayed properly, but that is really just a cosmetic issue.
Email notifications plugin revisited
Moderator: Moderators
Re: Email notifications plugin revisited
Thanks for reporting this and including a fix.toktok wrote: ↑Wed Mar 19, 2025 5:25 pmHi,
I have now installed Gargoyle on a router with 16 MB of flash memory to be able to make use of some of the nice plugins that are available, including "Email notifications for Gargoyle (with SSL support) 2.0-3".
However, all emails that I received from Gargoyle showed no content, neither with Thunderbird, nor when viewed via my email provider's webmail portal. (basically like what other users mentioned before here in this thread)
I could see that the content was actually there by viewing the source code of the emails in Thunderbird.
These emails also show with a date of 1970/1/1 in Thunderbird.
After poking around in the code (I am not an expert) and comparing to other emails that display properly I found that adding an empty line before the actual html code fixed the whole problem.
I do not know why this empty line is apparently so important, but I found it in every email that I checked. (I mean every email other than the ones sent by Gargoyle)
So, in "email.sh" I changed the line
echo -e "Subject: Gargoyle Router report - $(date)\r\nFrom: $(cat /etc/msmtprc | grep from | sed "s/ from //")\r\nContent-Type: text/html; charset='UTF-8';\r\n<html><body>" > /tmp/email-log.txt;
to
echo -e "Subject: Gargoyle Router report - $(date)\r\nFrom: $(cat /etc/msmtprc | grep from | sed "s/ from //")\r\nContent-Type: text/html; charset='UTF-8';\r\n\r\n<html><body>" > /tmp/email-log.txt;
I think the same modification would need to be made in "email.js" ("function testMail()") in order to have emails sent by "Send test email" displayed properly, but that is really just a cosmetic issue.
I will take this and fix it when I can.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.