<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <title>Aliases</title>
  </head>
  <body>
    <form action="{{ url_for('user.logout') }}" method="POST">
      <input type="submit" value="Log Out">
    </form>
    <p><a href="{{ url_for('user.change_password') }}">Change Password</a></p>
    {% with messages = get_flashed_messages(with_categories=True) %}
      {% if messages %}
        <ul>
          {% for category, message in messages %}
            <li>{{ category }}: {{ message }}</li>
          {% endfor %}
        </ul>
      {% endif %}
    {% endwith %}
    <h1>Aliases for {{ current_user.localpart }}@{{ current_user.domain.name }}</h1>
    <ul>
      {% for alias in current_user.aliases %}
        <li>{{ alias.localpart }}@{{ alias.domain.name }}</li>
      {% endfor %}
      <li>
        <form action="{{ url_for('.new_alias') }}" method="POST">
          {{ new_alias_form.hidden_tag() }}
          {{ new_alias_form.localpart() }}@{{ new_alias_form.domain() }}
          <input type="submit" value="Add">
        </form>
      </li>
    </ul>
  </body>
</html>

<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <title>Aliases</title>
  </head>
  <body>
    <form action="{{ url_for('user.logout') }}" method="POST">
      <input type="submit" value="Log Out">
    </form>
    <p><a href="{{ url_for('user.change_password') }}">Change Password</a></p>
    {% with messages = get_flashed_messages(with_categories=True) %}
      {% if messages %}
        <ul>
          {% for category, message in messages %}
            <li>{{ category }}: {{ message }}</li>
          {% endfor %}
        </ul>
      {% endif %}
    {% endwith %}
    <h1>Aliases for {{ current_user }}</h1>
    <ul>
      {% for alias in current_user.aliases %}
        <li>{{ alias }}</li>
      {% endfor %}
      <li>
        <form action="{{ url_for('.new_alias') }}" method="POST">
          {{ new_alias_form.hidden_tag() }}
          {{ new_alias_form.localpart() }}@{{ new_alias_form.domain() }}
          <input type="submit" value="Add">
        </form>
      </li>
    </ul>
  </body>
</html>

Use string representation of mailbox and alias
Use string representation of mailbox and alias
