mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #23] Raw message tab is broken because of cross-origin access #20
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @antonkomarev on GitHub (Nov 22, 2022).
Original GitHub issue: https://github.com/axllent/mailpit/issues/23
Loading «https://mailpit.example.com/api/v1/message/89db0f92-a94b-4e43-80f1-d25866d7e1e5/raw» in frame prohibited by directive «X-Frame-Options», setted as «DENY».
DOMException: Permission denied to access property "document" on cross-origin object
Firefox:

Chrome:

@antonkomarev commented on GitHub (Nov 22, 2022):
In Firefox there is a button to open link in new tab (and it works), but in Chrome you are stuck on error message without any way to see raw content.
@antonkomarev commented on GitHub (Nov 22, 2022):
It looks like raw messages should be opened on a new tab all the time.
@axllent commented on GitHub (Nov 22, 2022):
The raw messages comes from the same origin so is allowed by the permissions. It works fine in both Firefox and Chrome here. Are you sure it isn't the same issue you're having with your extensions you mentioned in #24 ?
@antonkomarev commented on GitHub (Nov 22, 2022):
Yes, I'm sure, we tested it on different browsers and machines. These screenshots are from different people
@axllent commented on GitHub (Nov 23, 2022):
The HTTP server only sends the following header:
This says
frame-src 'self';meaning iframes can be loaded from the same domain as you are accessing Mailpit from, eg:https://mailpit.example.com/api/v1/message/89db0f92-a94b-4e43-80f1-d25866d7e1e5/rawshould be allowed to load fromhttps://mailpit.example.com/#89db0f92-a94b-4e43-80f1-d25866d7e1e5.Your error message:
seems to imply that
X-Frame-Optionsis being set somewhere, but it's not, or rather not from Mailpit. Are you using some HTTP proxy to access Mailpit? I need more information from you:a) the Mailpit version you are running?
b) how is it currently set up in your network?
c) I would like to see the browser's response headers from the Mialpit server (from the landing page, eg :
https://mailpit.example.com/).@antonkomarev commented on GitHub (Nov 29, 2022):
Mailpit 1.2.9
Response headers:
@antonkomarev commented on GitHub (Nov 29, 2022):
Mailpit is hidden behind nginx proxy
And we have global security policy:
@axllent commented on GitHub (Nov 29, 2022):
I believe you have answered your own question. Your global policy (
X-Frame-Options "DENY";) is what is blocking any iframe from loading anywhere. Mailpit requires an iframe to render the email HTML and raw email, and does it not require (or use) cross-origin to do so (it loads from the same host/domain). This isn't a limitation or anything broken in Mailpit, but an enforced limitation in your global policy, so there isn't anything i can do about it unfortunately. You will need to relax your policy to at least be able to load iframes from the same host.@antonkomarev commented on GitHub (Nov 30, 2022):
Sent this thread to our devops team, will return with feedback.
@antonkomarev commented on GitHub (Nov 30, 2022):
Fixed by changing
to