mailhog / MailHog

Web and API based SMTP testing
MIT License
13.89k stars 1.06k forks source link

Download mail UI link is not working #171

Open dr29bart opened 7 years ago

dr29bart commented 7 years ago

mailhog is running in docker

 docker run -d -e "MH_MAILDIR_PATH=/var/log/fakesmtp" -e "MH_STORAGE=maildir" \
-e "MH_HOSTNAME=$(hostname -f)" -v "/var/log/fakesmtp:/var/log/fakesmtp" --name=fakesmtp \
-p 2525:1025 -p 8025:8025 mailhog/mailhog

After pressing this button image

page appears image

docker logs fakesmtp

'
2017/09/06 15:21:50 Parsing Content from string: 'From: idsApiTestServer@mail.com
To: nakob@ittest.com
Message-ID: <1786613318.1.1504711307647@manitou-VirtualBox>
Subject: Credentials
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Dear John Doe
Your username is:
BZmDuBwVvIn

Please use the link below to reset/create your password and access the customer portal:
https://my.local.com/forgot-password.php 

Thank you
'
2017/09/06 15:21:50 Found 2 messages
2017/09/06 15:21:59 Parsing Content from string: 'From: idsApiTestServer@mail.com
To: qppiw@ittest.com
Message-ID: <1245227950.0.1504711306468@manitou-VirtualBox>
Subject: Credentials
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Dear John Doe
Your username is:
KThvIAYLWvt

Please use the link below to reset/create your password and access the customer portal:
https://my.local.com/forgot-password.php 

Thank you
'
[APIv1] GET /api/v1/messages/BpUpHyuVScJNKCILwlfAdtZklGQQPBrIrOeYn34iD98=@manitou-VirtualBox

[APIv1] KEEPALIVE /api/v1/events
[APIv1] GET /api/v1/messages/BpUpHyuVScJNKCILwlfAdtZklGQQPBrIrOeYn34iD98=@manitou-VirtualBox
vutkin commented 6 years ago

I confirm. This is reproducred when storage is directory.

devnix commented 5 years ago

I'm also affected by this bug, in Chrome it generates an ERR_INVALID_RESPONSE. image

jcuna commented 5 years ago

Also having this issue, any help would be greatly appreciated.

daviddickgrcc commented 4 years ago

This seems to be only an issue if the file is saved locally to the server, and not in memory.

C-Duv commented 4 years ago

I can confirm, switching from MH_STORAGE=maildir to MH_STORAGE=memory made the "Download" button (/api/v1/messages/xxxx/download) work.

C-Duv commented 4 years ago

It looks like the storage.Maildir is not supported by the download() function, the switch only test for storage.MongoDB and storage.InMemory:

https://github.com/mailhog/MailHog/blob/f5559ac00323e7f2ab5abcea3628e0c492bb3bf2/vendor/github.com/mailhog/MailHog-Server/api/v1.go#L177-L196