Featurerequest: Include sender name
Thx for email2matrix. Jumped on as soon as I saw it.
It‘s working fine for me, but it would be really useful if there would be an option to include the From header in the matrix message.
We can create a new IgnoreSender field for the ConfigurationMatrixMapping (https://github.com/devture/email2matrix/blob/782bcfdd67983ff27f0b9cec5c81cf1a20796ab0/email2matrix/configuration/configuration.go#L31).
It would default to false, which means that all existing mappings which don't include it will start generating messages that include the sender address. It's a bit of a backward compatibility break.
To fix message generation to take it into account, we would need to redo GenerateMessage() and its tests.
I think the way GenerateMessage() is written makes it a bit hard to introduce new stuff like this (IncludeSender), so it should probably be refactored first.
I wonder if there would be additional things (like IgnoreSender) we might wish to add in the future. It's not necessarily for controlling what data to include in the message. It could also be related to formatting somehow.. We should probably think some more about this, before jumping in and solving the sender-address thing.
Or.. we should just have some kind of template ("template": "# __SUBJECT__\n\n__BODY__") instead of all these variables. We can have a sane default that includes a lot of information. And then people can just override the template for each ConfigurationMatrixMapping to customize it. Us changing the default would no longer cause backward-compatibility changes for people who've explicitly set a value.
Perhaps that's a better way to solve it. It's not as smart as the current GenerateMessage() code though, which acts a bit like the above template, but would smartly skip a # __SUBJECT__ if the subject is empty. However, it's likely unnecessary to have such a feature.. After all, you usually create a mailbox for a specific purpose and that mailbox always receives uniform messages. It's not like one email would contain a subject and then the next one would be subject-only.