Only OSSN emails from server go to people's spam

Rich Evans Posted in Technical Support 2 years ago

My Environment:

  • Host: DigitalOcean
  • Centos7
  • Apache 2.4.6
  • Haproxy 1.5.18
  • Firewalld 0.6.3
  • PHP 7.4.26
  • MariaDB 10.6.5
  • OSSN 6.1
  • OSSN Theme: Fake-book 6.2
  • NOTIFICATIONS VIA EMAIL (Premium from Open Teknik)

My Question

Why do OSSN emails to users (password reset, notifications, etc.. ) go to people's spam folder whereas all my other server applications (mainly, mediawiki, piwigo) do not get flagged as spam.. This can't be a server configuration issue or my other LAMP applications would all have the same issue.. nor can it be a NOTIFICATIONS VIA EMAIL (Premium from Open Teknik) component issue because the problem exists on new user email validations prior to the premium component install (and after) .. Please advise. Thank you!

/Rich

Replies
us Rich Evans Replied 2 years ago

[update] my score is 10/10 now after enabling TLS on postfix with Let's Encrypt .. w00t!

enter image description here

enter image description here

enter image description here

us Rich Evans Replied 2 years ago

[update] my score is 10/10 now after enabling TLS on postfix with Let's Encrypt .. w00t!

Ref: https://www.svennd.be/setting-up-postfix-tsl-with-lets-encrypt/

us Rich Evans Replied 2 years ago

Ah, yes, to close the loop.. I (re)discovered that the other apps (mediawik, moodle, and piwigo) are all configured to send mail using smtp and I configured smtp to use smtp.gmail.com as their mail relay and I had a dummy service gmail account I created a long time ago to make it work (which I never look at and completely forgot about)..

OSSN (as you initially stated) uses the php mail() function which uses system default mailer (postfix) which "worked", but needed "a lot" of work to be able to generate emails that would ever see the light of someone's inbox.

I'm sure that I could have configured OSSN to use SMTP, but it feels really good to have the server all fine-tuned to be trusted now and able to send email directly from the server without relying on a 3rd party mail relay (like google).

Does that make sense?

German Michael Zülsdorff Replied 2 years ago

Sorry Rich,
but I have my problems to understand all that.
In the beginning you said: All your apps except of Ossn were able to send their mails without being marked as spam.
Ok, so it appeared to be an Ossn issue.
Now you're telling us: Ossn wasn't involved at all - it was a server issue?

us Rich Evans Replied 2 years ago

The solution to this issue is unrelated to OSSN, but I'm happy to report that my server is finally sending emails that are not flagged as spam. All the work was on the server host domain configuration and the domain registrar. It was a pain to figure it all out, but I consider it time well spent.

Success!

us Rich Evans Replied 2 years ago

Still have a DMARC issue and a reverse DNS issue and I managed to get myself added to one of the many blacklist sites.. but.. my emails are up to 4.5 now (in a 0 to 10 rating system where anything under 5 is considered spam) .. yippie!

us Rich Evans Replied 2 years ago

Thanks Arsalan, but I think I'm making good progress in getting my server properly configured for mail. I always thought it was just super cryptic stuff you have to do on the server (and some of it is), but I'm learning a lot about domain name configuration records and how spam is fought and so I'm earning my stripes as they say. I've successfully aligned my server name and domain, added the mail forwarding alias rules and set and verified my SPF and DKIM records and now I'm waiting for my DMARC record to publish. My domain is provided by Namecheap.com and they have been very helpful. DigitalOcean (my server host) also lots of great tutorials on this. This is all stuff that I should have rolled up my sleeves a long time ago and figured out and never did. I was originally irked, but in hind-sight (assuming I'm successful in the end) I'm glad that my OSSN project has forced me to do this. Like most things, I just needed a clear goal to focus on. I'll post a final update with some notes when I'm done.

Cheers!
/Rich

Indonesian Arsalan Shah Replied 2 years ago

Hi Rich, getting 0 means your mailer server is totally out of order. You can use SMTP component and use email account to send emails https://github.com/opensource-socialnetwork/SMTP this way OSSN only sends emails normal email and all headers set by your SMTP relay.

us Rich Evans Replied 2 years ago

Hi Arsalan, thanks.

I just used https://www.mail-tester.com/ to get a test email address and registered with it. The good news is that they did receive a registration email. The bad news is it received a 0 out of 10 rating, haha.

I can see that there are a bunch of configuration issues on my server that would make using it as the default mail handler problematic. I realize I can work through all that and I'll be all the better for doing so. I guess I'm just left wondering why other applications on my server (like mediawiki and piwigo) have not had this issue.

And so now I'm torn between whether or not to put the effort into getting my server's default mail issues sorted or just try to implement whatever methods Mediawiki and Piwigo are doing in OSSN.

Could it be as simple as adding some code somewhere in OSSN that sets some mail headers tailored for my site?

Continued Thanks!

Indonesian Arsalan Shah Replied 2 years ago

OSSN emails goes through php mail() function which uses system default mailer. You should check your mail server configuration and analyze your emails by some tool. OSSN doesn't use special headers to send emails so its likely the emails are being taken to spam by provider filter. You should also check if you are server IP is not blacklisted.