lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Reduce e-mails that Lemmy sends in order to bring down costs

Open sunaurus opened this issue 1 year ago • 11 comments

  • [X] Did you check to see if this issue already exists?
  • [X] Is this only a single feature request? Do not put multiple feature requests in one issue.
  • [X] Is this a question or discussion? Don't use this, use https://lemmy.ml/c/lemmy_support.
  • [X] Is this a UI / front end issue? Use the lemmy-ui repo.

Many e-mail service providers charge users by how many e-mails were sent in a month (especially if you cross over any threshold which you are currently paying for). For example, when paying for 10k e-mails a month at Postmark, every further 1k e-mails will cost $1.80.

With interest in Lemmy growing quickly, it might be a good idea to take a look at what e-mails Lemmy currently sends and if there are any ways to reduce that count. I would propose the following:

  • Allow instance admins to completely disable the option for users to receive e-mail notifications.
    • If even a few users with e-mail notifications enabled post popular threads with lots of comments, then the ammount of reply notifications sent to their e-mails can quickly exceed any free tiers or even cheap tiers of most e-mail service providers.
  • Group several notifications into a single e-mail
    • Many online services employ this approach. For example, Lemmy could wait ~30 minutes between sending e-mails to the same user, and group together all notifications from that 30 minute period into the next e-mail that is sent.
  • Do not send e-mails at all for notifications that have been already seen by the user
    • Especially if waiting between sending e-mails, there will be a chance that a user has already marked a notification as seen on the Lemmy website before the e-mail is ever sent. In this case, the e-mail could be skipped entirely.

I would treat this all as one enhancement, but if you feel like this should be split into several issues then I would be happy to do so.

sunaurus avatar Jun 10 '23 23:06 sunaurus

The e-mail debouncing feature would obviously need to be a setting in instance configuration, but I believe the default value should be much lower than 30 minutes. Though, primarily as a user, I can't really feel the expenses of e-mails.

krestenlaust avatar Jun 15 '23 07:06 krestenlaust

What is the point of using an external service for sending the email. Why not just send them locally from the domain using a simple mail server?

krestenlaust avatar Jun 16 '23 19:06 krestenlaust

@krestenlaust they will most likely get blackholed due to dkim and spf. or they will show up as spam.

snowe2010 avatar Jun 16 '23 19:06 snowe2010

Alright, it can't be a "simple" mail server. But what prevents the use of a local email client that signs using dkim and/or spf? (only read up on it shortly)

I don't see it ending up in spam as that bad, either. But blackholing could be an issue

krestenlaust avatar Jun 16 '23 19:06 krestenlaust

I don't think anything prevents it. it's just hard to get right from what I've read. I'm no email expert though.

snowe2010 avatar Jun 16 '23 19:06 snowe2010

This is a bit of a derail, feel free to ignore unless you're interested in why managed e-mail providers are useful:

@krestenlaust maintaining an e-mail server in good standing is at least a full time job (if not several) 😃 it sucks but that's where we are in 2023. My assumption is that most instance admins don't really want to deal with all that in addition to managing the instance itself - I for one certainly don't.

By the way, DKIM and SPF are trivial (relatively speaking) - the hard part is building and maintaining a reputation so that the major e-mail providers don't just blanket block you. Depending on where you're hosting your e-mail server, ending up in spam might be a best case scenario, because it could be much more likely that you'll never even reach spam, and instead just get your e-mails bounced with amazing errors like "None/bad reputation."

sunaurus avatar Jun 16 '23 22:06 sunaurus

Alright, that makes more sense, thanks for the explanation

krestenlaust avatar Jun 17 '23 06:06 krestenlaust

This is a bit of a derail, feel free to ignore unless you're interested in why managed e-mail providers are useful:

@krestenlaust maintaining an e-mail server in good standing is at least a full time job (if not several) smiley it sucks but that's where we are in 2023. My assumption is that most instance admins don't really want to deal with all that in addition to managing the instance itself - I for one certainly don't.

By the way, DKIM and SPF are trivial (relatively speaking) - the hard part is building and maintaining a reputation so that the major e-mail providers don't just blanket block you. Depending on where you're hosting your e-mail server, ending up in spam might be a best case scenario, because it could be much more likely that you'll never even reach spam, and instead just get your e-mails bounced with amazing errors like "None/bad reputation."

yep, ran into this exact problem with Outlook users. Switched to Postmark, but now users are getting post reply emails and the like which directly costs money

CorvetteCole avatar Jul 14 '23 05:07 CorvetteCole

For those finding this thread in the future, we've switched to purelymail.com which has been juuuusssttt right. $10/yr

CorvetteCole avatar Jul 29 '23 08:07 CorvetteCole

Allow instance admins to completely disable the option for users to receive e-mail notifications.

This setting kind of already exists, in that the Settings.Email section of the config, is an optional block. The issue is that maybe UI's should gray out / disable notifications if emails aren't set up / working on the server, to show that email notifications won't currently work.

dessalines avatar Oct 18 '23 20:10 dessalines

One option might be to have different sending configurations for email verification and comment notifications. That way you can pay someone to maintain a reputable IP for "important" stuff but comment notifications go via the server's IP. If users want comment notifications they can figure out how to mark them as not spam.

This may also have the advantage of raising your reputation.

kevincox avatar Apr 30 '24 01:04 kevincox