From c593253c7d4d0c48ec960c923842c41718edc4aa Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Sun, 7 Jun 2020 00:04:59 +0200 Subject: [PATCH 01/10] Add pgp_public_key,pgp_finger_print columns to Contact model --- app/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/models.py b/app/models.py index 0bc40075..8172e71c 100644 --- a/app/models.py +++ b/app/models.py @@ -933,9 +933,16 @@ class Contact(db.Model, ModelMixin): # whether a contact is created via CC is_cc = db.Column(db.Boolean, nullable=False, default=False, server_default="0") + pgp_public_key = db.Column(db.Text, nullable=True) + pgp_finger_print = db.Column(db.String(512), nullable=True) + alias = db.relationship(Alias) user = db.relationship(User) + @property + def email(self): + return self.website_email + def website_send_to(self): """return the email address with name. to use when user wants to send an email from the alias From afe975b8c3ebfb7efc13ee96c8f2edf2a1602dfb Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Sun, 7 Jun 2020 00:07:46 +0200 Subject: [PATCH 02/10] User can add PGP key to for a contact --- app/dashboard/__init__.py | 1 + .../templates/dashboard/contact_detail.html | 65 +++++++++++++++++++ app/dashboard/views/contact_detail.py | 55 ++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 app/dashboard/templates/dashboard/contact_detail.html create mode 100644 app/dashboard/views/contact_detail.py diff --git a/app/dashboard/__init__.py b/app/dashboard/__init__.py index fc216406..41ff2bc0 100644 --- a/app/dashboard/__init__.py +++ b/app/dashboard/__init__.py @@ -22,4 +22,5 @@ from .views import ( refused_email, referral, recovery_code, + contact_detail, ) diff --git a/app/dashboard/templates/dashboard/contact_detail.html b/app/dashboard/templates/dashboard/contact_detail.html new file mode 100644 index 00000000..af0b1fd8 --- /dev/null +++ b/app/dashboard/templates/dashboard/contact_detail.html @@ -0,0 +1,65 @@ +{% extends 'default.html' %} + +{% set active_page = "dashboard" %} + +{% block title %} + Contact {{ contact.email }} - Alias {{ alias.email }} +{% endblock %} + +{% block default_content %} + +
- To send an email from your alias to someone, says friend@example.com, you need to:
+ To send an email from your alias to a contact, says friend@example.com, you need to:
1. Create a special email address called reverse-alias for friend@example.com using the form below
2. Send the email to the reverse-alias instead of friend@example.com
- 3. SimpleLogin will send this email from the alias to friend@example.com for you
+ 3. SimpleLogin will send this email from the alias to friend@example.com for you
This might sound complicated but trust us, only the first time is a bit awkward.
{% if alias.mailbox_id %} - {% if alias.mailboxes | length == 1 %} Make sure you send the email from the mailbox {{ alias.mailbox.email }}. {% else %} @@ -81,7 +80,10 @@