"Reply From Alias" Plugin

I’m a very experienced programmer, but I have attempted to use Mailspring’s API and sample plugin and haven’t even gotten anything at all to work.

Before I delve deeper into this madness, I’d like to ask: Is it even possible to create a plugin that does the following:

  • When opening the “Reply” window.
  • Automatically takes the email’s “X-Original-To:” (if exists) or “To:” (fallback) header field.
  • Uses that as the “From:” of your new email.

The purpose is to add Email Alias support to Mailspring, so that people can click “Reply” and be sure that it will be sent as your alias, rather than exposing your true, internal mailbox.

People have asked for this feature in the past:

If plugins can achieve this, technically, then I’d like to code it.

Hey @Bananaman,

I am not sure, of this is possible with a plugin. But maybe you want to implement it directly in the mailspring source code. The project is always open for pull requests.

Cheers Phylu

1 Like

Thanks, I forgot to update this thread with my research results.

What I found is that the “sender/from” is a dropdown which is populated directly at Compose window creation, by a query to the backend database that grabs all registered email accounts and aliases. It then selects the closest alias/account matching the original receiver address.

So I would not know how to add another alias and update that dropdown in realtime. It’s complex. It’s populated once on window creation and not afterwards.

One idea I had was that hitting Reply might be able to detect a new email address and auto-add the alias to the backend before the Compose form appears, so that the alias is found and mapped automatically.

Another idea was to add a button to the email viewer itself which appears when the alias doesn’t exist, and clicking on it would add that receiver to the aliases for that account. Then the user can add aliases before hitting Reply. That might be the best easiest idea, since directly modifying the Compose window seems very complicated.

But the codebase was so alien to me that I gave up. It wasn’t the quick fix that I’d hoped to see. There might be ways to solve the original idea of adding a button to the compose-form, or better yet an editable “from” field to create aliases on the fly (like Thunderbird can do with plugins like this), but it would require more time than I had available. Perhaps these ideas and observations helps someone else who is more motivated someday.

1 Like

Great to see this post, because this is exactly the kind of feature I’m looking for from an email client. It would be extremely convenient. Because one mailbox can have for example 5 aliases, and it is important to reply from the one where the mail was received.
The list of possible aliases could be customised in the mail account.

It doesn’t look complicated, although my programming experience is limited to bash.

1 Like

Thunderbird has finally gained a modern “Cards”-based interface with airy spacing in the user interface, so I am switching back to it today after almost 15 years without Thunderbird.

The screenshots on Flathub are outdated. I highly recommend anyone to try it out to see the latest design (with Dark theme and modern cards). Their official, recommended install method is Flathub:

Beware if you had Thunderbird previously installed. If so, it will be in “migrate mode” where parts or all of the UI is still using the old styles and old layout. You can manually switch over to Cards view and new layouts and compactness settings, but it takes a lot of effort to find all the settings that you’d need to switch (some of the settings are even hidden in the advanced Config Editor). So I recommend that you just wipe your old Thunderbird config and let it create a fresh one with the latest, modern layout.

It’s stunning nowadays. And the plugin ecosystem is fantastic. I can finally begin using mail aliases again, with the “automatically reply as alias” plugin:

With that plugin, I can receive emails at “anything-i-want @ mydomain”, which is configured to be forwarded to my true mailbox. So someone may email me at “someproject @ mydomain”. Then, when I reply to that email, that plugin makes my outgoing email send from the “someproject @ mydomain”, thus protecting my real inbox from spam. If I get spam, I simply disable a project alias and switch that site to another. It’s a system I used back in 2010 and I am so excited to finally have an enjoyable version of Thunderbird so I can get back to that safety.

I will miss the Mailspring interface for sure. It was a joy to use and still looks more beautiful than Thunderbird. But the gap is much smaller now, and I really can’t resist the huge plugin repository at Thunderbird anymore.

The only thing that bothered me about Thunderbird was the default zoom level, since I use a very large screen that needs 125% zoom in most apps. But luckily that can be set via Config Editor with the hidden setting “layout.css.devPixelsPerPx”, which scales both the text and all images (so it’s superior compared to just changing font size). I set it to 1.25 (which means 125%) and now the UI is perfectly enjoyable!

I hope this information helps someone else here!