purelymail-issues icon indicating copy to clipboard operation
purelymail-issues copied to clipboard

Documentation Request: Best Client/Practices for Aggregating Email Accounts into a Single Inbox?

Open ScottPeterJohnson opened this issue 3 years ago • 7 comments

(This issue was imported from Gitea) byb on January 28, 2022: Hello,

Purelymail is awesome, but perhaps I've gotten a little carried away with creating email addresses. I could use some advice from experts about how to manage multiple email accounts into a single inbox. I could really use a guide on how to accomplish this with purelymail from the perspective of a somewhat new user who managed to set up their own domain.

After creating about 10 email accounts, it became cumbersome to log-in and log-out of the purelymail webgui to check for new mail. Now that I'm well past that number, it's completely unworkable. I need a single inbox to collect all emails from different accounts and the ability to reply to them using the intended account.

Desktop/Mobile Clients

Ultimately, I want the freedom to access my email from multiple PCs and not be tied to a single PC desktop instance. With that said, here's my experience

  • Thunderbird - As I recall, setup was a bit annoying as well since Thunderbird tries to automatically detect imap/smtp servers, which doesn't work with a custom domain in combination with purelymail.
  • Mobile - While mobile apps will aggregate accounts to a single inbox, setting up multiple accounts is cumbersome. I'd prefer to not have all my emails inside of my phone's OS. I think purelymail users have a similar ideological bent to stop using "free" email services from large corporations, which rules out Outlook desktop. I also don't want to use Outlook mobile since I already use it for my work email and frequently delete Teams & Outlook from my personal phone to escape work.
  • Emacs/Vim for email - I wish I had the patience to configure and learn these tools, but this doesn't solve the mobile device problem.

Server-based Tools

Since I'm not an expert of server administration, I use a lot of Docker images. Here's what I've found:

  • Mailpile - Initially Mailpile looked like it was going to be perfect, but as time went on I encountered several debilitating bugs related to setup (I hit a wall setting up new accounts, sometimes adding new accounts would cause the program to go unresponsive and it was a lottery if restarting the program would result in a successfully added account). Also there are javascript limitations which prevent the user from sending messages from more than a few accounts (no scroll bar). I tried setting up multiple MailPile instances to handle different categories of email accounts, this eventually stopped working. Also, there seem to be an excessive amount of DNS inquiries happening to purelymail. Is Mailpile hammering the server?
  • AfterLogic WebMail https://afterlogic.com. I tried out the lite version, but it only supports a single email account. I'm hesitant to pay for the Pro version due to the cost (299 USD server license) and since I cannot test mailbox aggregation before buying a license.
  • Poste - I tried out, but I ruled out for reasons I forgot; maybe it doesn't support mailbox.
  • NextCloud Mail - I have not tested yet since setting up NextCloud is a bit involved. I'm unsure if it supports email inbox aggregation.
  • RoundCube - This is what purelymail uses. I will try running my own instance with plugins... I wonder if purelymail could offer tools to aggregate accounts together.
  • rainloop - https://www.rainloop.net/ - seems to not aggregate email. (could not find a docker image)
  • cypht - https://cypht.org/ - I haven't tested it yet. (could not find a docker image)

Alternatives

  • Or am I supposed to use routing? https://purelymail.com/manage/routing How would this work if each email account has a different username/password?

I'm sure there are people out there who have solved this issue and can offer valuable insights on the direction I should go. Thank you!

ScottPeterJohnson avatar Mar 22 '22 12:03 ScottPeterJohnson

Comment by Scott on January 29, 2022: I think your use-case is pretty clearly a matter of routing. The important thing to realize is that a user is not an email address; a user can effectively have many email addresses. Every user is associated with an email address that they use to log in, but they don't necessarily need to even receive mail at that address.

For example, suppose I'm interested in the email addresses "[email protected]" and "[email protected]". If I create a user "[email protected]" and I use a routing rule to redirect mail from "[email protected]" to "[email protected]", then I can log in to one user account and receive emails for both addresses, and I can also "send as" both addresses (since the overall account owns both). You may need to create something called an "Identity" in a third party mail app to do this automatically.

If the addresses are on a shared domain (e.g. @purelymail.com), then you do have to create the user "[email protected]" to reserve the address for your account. But you don't have to use it; you can set up a webmail filter in "[email protected]" that redirects to "[email protected]".

I'm open to creating documentation on this (maybe some FAQ questions to catch people who are thinking about users/email addresses too restrictively) if I understood your problem correctly.

ScottPeterJohnson avatar Mar 22 '22 12:03 ScottPeterJohnson

Comment by byb on February 2, 2022: Yes, using routing will be helpful by adding an additional layer, however, it is useful to have different sets of inboxes to prevent files from being co-mingled. I don't want everything to go to one inbox, which re-introduces the log-in/log-out problem.

ScottPeterJohnson avatar Mar 22 '22 12:03 ScottPeterJohnson

Comment by Scott on February 2, 2022: In that case, after routing you just have a webmail filter (Sieve) script that redirects the mail to different folders. Clients should be better able to handle multiple folders than multiple accounts.

ScottPeterJohnson avatar Mar 22 '22 12:03 ScottPeterJohnson

Comment by byb on February 11, 2022: Hi, thank you so much for your help. I finally had some time to look at this today. Also, I apologize for the typos in my original message.

Today, I had a situation where I wanted to send a message using a "burner" email address and thought I would try to use sieve.

Attempted Steps

I wrote this as I went along, until I was successful. In the end, these steps are sort of backwards, and a couple of them can be eliminated.

  1. I went to http://sieve.info/ but found a couple broken links and found some somewhat high-level information. I followed the link to this wiki page https://en.wikipedia.org/wiki/Sieve_%28mail_filtering_language%29#Example which seems to have the example script I'm looking for to modify.
# Sieve filter

# Declare the extensions used by this script.
#
require ["fileinto", "reject"];

# Messages bigger than 100K will be rejected with an error message
#
if size :over 100K {
   reject "I'm sorry, I do not accept mail over 100kb in size. 
Please upload larger files to a server and send me a link.
Thanks.";
}

# Mails from a mailing list will be put into the folder "mailinglist" 
#
elsif address :is ["From", "To"] "[email protected]" {
   fileinto "INBOX.mailinglist";
}

# Spam Rule: Message does not contain my address in To, CC or BCC
# header, or subject is something with "money" or "Viagra".
#
elsif anyof (not address :all :contains ["To", "Cc", "Bcc"] "[email protected]", 
header :matches "Subject" ["*money*","*Viagra*"]) {
      fileinto "INBOX.spam";
}

# Keep the rest.
# This is not necessary because there is an "implicit keep" rule
#
else {
     keep;
}
  1. I logged into my purelymail admin account and navigated to https://purelymail.com/manage/accountSieve, I modified the script and pasted it into the box, but then reviewed the bullet points above and saw this:

This is an account-wide script. The "redirect", "keep", and "reject" actions all work, but "fileinto" will not work at this stage. Use "fileinto" in a user Sieve script (called a "filter" in the webmail) instead.

This left me scratching my head for a minute, so I left this page open in one tab and continued investigating. After Success Note: It later turned out that this step is not needed.

  1. I logged into one of the accounts I created and found this page: https://inbox.purelymail.com/?_task=settings&_action=plugin.managesieve#

At first, this page was a little baffling because it had a bunch of input boxes, but then I found what I needed...

  1. I clicked the "roundcube" dropdown button, and then selected the "roundcube" entry below.
  2. I then clicked "Actions" and chose "Edit filter set".
  3. The right pane opened with a text entry box which looked like the place to paste my script:
/* empty script */
  1. I pasted my modified script (changed the domain to my own) into the box and clicked save.
  2. Test Attempt no. 1 - I tried sending an email to the address I specified, but purelymail bounced it back saying it didn't exist.
  3. I created the account and tried sending an email.
  4. Test Attempt no. 2 - The email seems to have been sent successfully (no bounceback), but didn't appear in my account, probably because I didn't create the folder INBOX.mailinglist, so...
  5. I created the folder using the webmail.
  6. Test Attempt no. 3 - I tried sending a third test email, but it didn't appear in the inbox (or the subfolder)... so now I need ot set up routing?
  7. I navigated to https://purelymail.com/manage/routing and created the entry and clicked save.
  8. Test Attempt no. 4 - SUCCESS! https://inbox.purelymail.com/?_task=mail&_mbox=INBOX.mailinglist

Bonus. I opened my MailPile instance and found that MailPile created the folder and placed it inside.

This works, but I wanted to eliminate steps 8 and 9 (creating accounts and passwords isn't really necessary), so instead I created the "routing" address by changing the setting from "The exact address" to "Any address starting with" , created the folder, created the identity, and created a new sieve filter.

Minor Roundcube/Webmail Issue

I know you are not roundcube support, but is it possible to automatically set the "reply" from email to the "to" email address? I mean if an email was sent to "[email protected]" and that identity exists, is there an option in the settings? This is a minor issue... I see MailPile defaults to this. EDIT Okay, it seems settings the display name, email, and reply-to fields solved this problem.

Greedy Ask

I wonder if a macro could be created to combine all 4 of those steps:

  • Define the address to route
  • Insert these items into the roundcube mailbox:
    • Create the identity
    • Create the folder
    • Add the sieve filter

Undoing My Mess

Okay, so now how can I consolidate all the email I had sent off to various accounts back into a single email box? EDIT I will try the import/export tool. https://purelymail.com/manage/portMail

EDIT Mass Testing elsif or if

I wanted to make sure that all my rules were working correctly... so I tried to send an email from one of my accounts to 30+ emails on BCC. However, the email only appeared in one box. I'm wondering if my sieve script should use "if", instead of "elsif".

I wrote a small python script to help generate the sieve filter:

email_list = ["an_email_address@a_domain.com", "another_email_address@a_domain.com"]
for email in email_list:
	emailinbox = email.replace("@a_domain.com", "")
	basic_elsif = f"elsif address :is [\"From\", \"To\"] \"{email}\" {{\n  fileinto \"INBOX/{emailinbox}\";\n}}"
	print(basic_elsif)

The output looks like this (note: I don't know if underscore characters are valid in folders, I don't think . or @ are.)

elsif address :is ["From", "To"] "an_email_address@a_domain.com" {
  fileinto "INBOX/an_email_address";
}
elsif address :is ["From", "To"] "another_email_address@a_domain.com" {
  fileinto "INBOX/another_email_address";
}

Anyway awesome! Thanks for the hints.

ScottPeterJohnson avatar Mar 22 '22 12:03 ScottPeterJohnson

Comment by Scott on February 12, 2022:

I wonder if a macro could be created to combine all 4 of those steps:

Define the address to route Insert these items into the roundcube mailbox: > Create the identity > Create the folder > Add the sieve filter

This use case might be covered if/when I have a formal alias feature.

I wanted to make sure that all my rules were working correctly... so I tried to send an email from one of my accounts to 30+ emails on BCC. However, the email only appeared in one box. I'm wondering if my sieve script should use "if", instead of "elsif".

When multiple recipients on a single email all resolve to a single address, it collapses into one "instance" of email for that user. But even if it didn't, you'd still just get 30+ emails into one box: you're using the address test, which is based off the From/To header, which doesn't include BCC and is always the same for the same email. You may want the envelope test instead.

ScottPeterJohnson avatar Mar 22 '22 13:03 ScottPeterJohnson

Comment by byb on February 12, 2022:

I wonder if a macro could be created to combine all 4 of those steps:

Define the address to route Insert these items into the roundcube mailbox: > Create the identity > Create the folder > Add the sieve filter

This use case might be covered if/when I have a formal alias feature.

Great!

I wanted to make sure that all my rules were working correctly... so I tried to send an email from one of my accounts to 30+ emails on BCC. However, the email only appeared in one box. I'm wondering if my sieve script should use "if", instead of "elsif".

When multiple recipients on a single email all resolve to a single address, it collapses into one "instance" of email for that user. But even if it didn't, you'd still just get 30+ emails into one box: you're using the address test, which is based off the From/To header, which doesn't include BCC and is always the same for the same email. You may want the envelope test instead.

I'll have to look into that a bit more. Eventually all the emails did come through... maybe because on the first try I had incorrectly used the routing feature (I put all the addresses separated by commas, which was intended for multiple emails). Maybe the emails were 'on-hold' by the server and once the rule was fixed they were delivered?

Perhaps my documentation request can be turned into an article/document which can be used to market purelymail. Having a step-by-step guide showing off how this feature works might attract a lot of potential customers.

I'll leave this ticket for you to close (both for the document and the formal alias feature).

ScottPeterJohnson avatar Mar 22 '22 13:03 ScottPeterJohnson

Comment by byb on February 14, 2022:

When multiple recipients on a single email all resolve to a single address, it collapses into one "instance" of email for that user. But even if it didn't, you'd still just get 30+ emails into one box: you're using the address test, which is based off the From/To header, which doesn't include BCC and is always the same for the same email. You may want the envelope test instead.

Returning to say, yes, envelope is probably what I need. I found that emails which the target address is on "cc" do not get sent to the correct email box. I need to rewrite my rules. I also need to see if there is a sieve rule which matches the "startswith" feature. I found that some emails with periods in them were getting returned as undeliverable.

Now the "formal alias feature" seems very ambitious. Perhaps there are a few use cases which would suit most users.

ScottPeterJohnson avatar Mar 22 '22 13:03 ScottPeterJohnson