mailchain / mailchain-legacy

Using Mailchain, blockchain users can now send and receive rich-media HTML messages with attachments via a blockchain address.
https://mailchain.xyz
Apache License 2.0
144 stars 51 forks source link

Add message signature to messages #390

Open tboeckmann opened 4 years ago

tboeckmann commented 4 years ago

Simple Summary

A message signature is a block of text appended to the end of a message often containing the sender's name, address, phone number, disclaimer or other contact information. It is cumbersome to type this in each message, so providing an automatic signature appended to each message (customisable per sender address) will save time.

Specification

Users should have the ability to choose a signature that is automatically added when composing new or replying to messages. Each sender address/ account should be able to have its own signature. Once added to a message, a signature may be edited as normal text in the message before sending. A user should be able to manage signatures through the mailchain interface. A signature may be shared across many sender addresses/ accounts. A user should be able to edit the signature in the application. A user should be able to delete the signature from the application. If a signature is deleted, but the application requests it, the response should be a soft fail.

More information: https://tools.ietf.org/html/rfc3676 https://en.wikipedia.org/wiki/Signature_block#Email_signatures_in_business

Rationale

In order to gain further adoption for individual senders, it should be easy to compose messages. Signatures save time, and prevent inaccuracies and inconsistencies.

Backwards Compatibility

N/A

Test Cases

See specification section

Related MIP

ambareeshb commented 4 years ago

@tboeckmann, Few questions,

  1. Can an account/address can have multiple signatures ?
  2. How the signature gets created if the user is creating the signature manually, do we have any default signature creation mechanism ?
  3. Work flow / Understanding Expose 3 API's a. Create signature b. List/Get all signatures c. Choose signature
tboeckmann commented 4 years ago

@ambareeshb Thanks for raising the clarification questions. It's all open to discussion and there may be a better data/ endpoint structure.

Can an account/address can have multiple signatures ?

I think an address would have a single signature by default, but there are occasions where you might want more than one (especially on a different network). So, for simplicity, the first version should be 1 signature per address by default. If it needs to be extended, this is possible.

How the signature gets created if the user is creating the signature manually, do we have any default signature creation mechanism ?

There is currently no default signature block creation mechanism. This should be stored locally in the mailchain client db.

Work flow / Understanding

Expose ~3~ 4 API endpoints a. Create signature e.g. POST /signatures

b. List/Get all signatures e.g. GET /signatures

[
  {
    "id": 0,
    "name": "My personal signature",
    "body": "All the best,\r\nTim",
    "addresses": [
      "0x123...789",
      "0x111...999"
    ]
  },
  {
    "id": 1,
    "name": "My business signature",
    "body": "Yours sincerely,\r\nTim B",
    "addresses": [
      "0x999...999"
    ]
  }
]

Should accept address query params, e.g. GET /signatures?address=0x123...789

c. Choose default signature to use with address e.g. PUT /signatures/signature_id/address

d. Delete signature e.g. DELETE /signatures/signature_id