ollie_123's avatar

Queued Mail Sends But Not Always Recieved - Help Please

Hi All

I have a multitenant app that uses the Laravel Queue to send emails. All of our UK tenants seem to receive the emails (some end up in spam) but some EU customers using gmail or yahoo etc are not receiving the emails at all. The from address is

from('noreply@'. $this->request->tenants->slug . $this->request->tenants->tld)

I've checked failed_jobs and the table is empty so it definitely looks as though everything is being executed correctly.

Please can someone advise what i can do to verify they're sent and delivered on the other end and if they're not delivered determine why?

I'm using the sendmail driver for reference.

Please can someone advise ASAP. Thank you in advance.

0 likes
9 replies
s4muel's avatar

is the tenant->slug and tenant->tld a valid domain address?

if not, it is probably caught by some spam filter, i advise to use valid sender (from) email addresses.

if yes, you would probably need to set up/configure SPF and DKIM (consult your IT guys, but here is some intro: https://support.google.com/a/answer/33786?hl=en&fl=1&sjid=17573231637472951755-NA and here https://support.google.com/a/answer/174124?hl=en) or use a dedicated mailer service (mailgun/postmark), which usually has sufficient documentation how to set it up to allow then sending emails on behalf of you

ollie_123's avatar

Hi @s4muel thank you for your reply and advice. I may have to switch to the valid sender from email address.

I can confirm that the domains are valid from tenant->slug and tenant->tld. but some domains are hosted on other platforms such as hostsinger they've setup a subdomain such as portal.tenantdomain.com and have the IP for the subdomain pointed to the server where the app is hosted. Could this be causing an issue?

s4muel's avatar

@ollie_123 yes, that definitely could be a problem, if you are trying to send an email on behalf of someone. they might have SPF/DKIM set up already, that basically tells the email providers who is designated sender. and if your server (which sends emails) is not in the list, the email ends up blocked (usually not even in spam folder). for example laracasts is set up like this: https://mxtoolbox.com/SuperTool.aspx?action=spf%3alaracasts.com&run=toolpage which designates spf.messagingengine.com (mailspring service) to send emails., if you try to send email as [email protected], it violates this SPF rule and end up blocked and discarded (depending on the mail servers along the way, but very common)

1 like
Snapey's avatar

The problem is most likely that there are no spf records that say your service is allowed to send on behalf of tenant domain.

If you look at the setup for something like mailchimp, one of the steps is to tell the customer how to add spf and dkim settings into their dns. You would need to do this also, or stop pretending that you are the domain mailserver.

Mail sending is getting increasingly strict and just saying mail is from noreply@tenantdomain is almost certain to result in your email identified as spam

https://postmarkapp.com/guides/best-practices-for-sending-on-behalf-of-your-users

1 like
ollie_123's avatar

Thanks @s4muel & @snapey. Im speaking with Hostinger who host the customers domain & subdomain and asked them to setup SPF & DKIM records and they're saying its an issue with me using SendMail and not SMTP but every other customer using the application doesn't have an issue with emails.

The Customer Service @ Hostinger said:-

"I was able to check the records of emails sent, and I couldn't find any records of emails sent via your server >with us, either via Sendmail, which uses the hosting server itself for sending, or via SMTP. Even if there was some blocking going on, it would still be possible to check the internal logs, which are >currently empty for your server. Even if you set up SPF and DKIM for the main domain or subdomain, it won't affect the current submissions at all >since they aren't reaching the Hostinger server for sending That's why I'd recommend changing Sendmail to SMTP and following these steps to configure SMTP on your >Laravel." Only with SMTP are we able to guarantee that messages are sent securely.

What are your thoughts?

ollie_123's avatar

Hi @Snapey, i'm currently using SendMail as the driver via the Webmin server.

Snapey's avatar

@ollie_123 If your web server is at hostinger then use them to send the mail as per their advice

ollie_123's avatar

Hi @snapey the app is hosted on our webmin webserver and all the mail is sent from our server but the customers domain is hosted on hostinger with their MX records setup for gmail just to add more into the mix lol.

Please or to participate in this conversation.