Skip to content

Commit

Permalink
PoC: frame webmail when impersonating
Browse files Browse the repository at this point in the history
  • Loading branch information
acran committed May 8, 2024
1 parent 0c8ac8a commit a8dbc5c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/admin/mailu/ui/templates/user/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<a href="{{ url_for('.fetch_list', user_email=user.email) }}" title="{% trans %}Fetched accounts{% endtrans %}"><i class="fa fa-download"></i></a>&nbsp;
{%- endif -%}
{%- if config["WEBMAIL"] != "none" -%}
<a href="{{ url_for('.user_webmail', user_email=user.email) }}" title="{% trans %}Webmail{% endtrans %}" target="_blank"><i class="fa fa-envelope"></i></a>&nbsp;
<a href="{{ url_for('.user_webmail', user_email=user.email) }}" title="{% trans %}Webmail{% endtrans %}"><i class="fa fa-envelope"></i></a>&nbsp;
{%- endif -%}
</td>
<td>{{ user }}</td>
Expand Down
15 changes: 15 additions & 0 deletions core/admin/mailu/ui/templates/webmail_impersonation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{%- extends "base.html" %}

{%- block title %}
{% trans %}Webmail{% endtrans %}
{%- endblock %}

{%- block subtitle %}
{% trans %}Access to Webmail mailbox of{% endtrans %} {{ user_email }}.
{%- endblock %}

{%- block content %}
<div class="embed-responsive embed-responsive-1by1">
<iframe class="embed-responsive-item" src="{{ config["WEB_WEBMAIL"] }}/sso.php"></iframe>
</div>
{%- endblock %}
3 changes: 3 additions & 0 deletions core/admin/mailu/ui/views/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ def user_webmail(user_email):

flask.session['webmail_user_email'] = user.get_id()

if (user_email):
return flask.render_template('webmail_impersonation.html', user_email=user_email)

return flask.redirect(f'{app.config["WEB_WEBMAIL"]}/sso.php')


Expand Down

0 comments on commit a8dbc5c

Please sign in to comment.