Invoices getting returned to sender

This morning I have been sending customer Invoices and many are failing to be delivered. See the return-to-sender errors. I don’t know whether this is a problem from Invoice Ninja or from AccuWeb email system. The email addresses are valid. Thanks for any guidance!

This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
Domain has exceeded the max defers and failures per hour (5/5 (25%)) allowed. Message discarded.


I suggest sending a test invoice to your own email address to check if it’s working.

It was working yesterday. Something stopped working and it caused 5 emails to fail. My budget AccuWeb email only allows 5 fails per hour. After those 5, it appears that all subsequent emails failed. I’m now looking at alternatives.

Alternative 1: upgrade AccuWeb Server to a higher plan that allows more than 5 fails per hour. I don’t know the cause of failure, as the email addresses are valid.
Alternative 2: subscribe to Postmark
Alternative 3: subscribe to Mailgun

It appears that for my (lowest) version of Invoice Ninja, these would be my only options. Any guidance would be appreciated. Thank-you for responding Hillel!

Which version of Invoice Ninja are you using? The post is tagged hosted v4 but from your description it sounds like selfhosted v5?

Ninja 5.7.26 on my AccuWebHosting server. I just began using this software yesterday, so beginner level. My research shows that other Ninja versions also support gmail/microsoft mail. I created a StartMail account but doesn’t appear to be supported on Ninja (with my version I cannot modify the .env parameters???).

You can use any SMTP email provider with the selfhosted app, why aren’t you able to modify the .env file?

My version of the app has the 3 email host selections: Default, Postmark, and Mailgun. I was previously using the Default with my new AccuWeb email that was having problems. I couldn’t find anywhere in Ninja to customize the Default, and my research led me to the video showing that on Ninja Enterprise I could use gmail/Microsoft, but that is not an option in my v5.

Hillel, are you telling me I should be able to modify my own .env file on my server, to configure my smtp/imap settings? I may have misinterpreted something, thinking this was not possible. Again, very new user here and not so techy. I have installed Filezilla and looking around but not finding the Ninja installation folder, nor the .env file supposedly located in that root folder. Any guidance on this? Maybe I can use my SmartMail afterall, fingers crossed. Thanks again for your super-fast responses.

That’s correct, all system settings are defined in the .env file. It’s possible the file is hidden from view since it begins with a dot, you may want to ask your webhost for advice.

Excellent, thanks Hillel. I’ll reachout to them and see what they recommend regarding hidden files. What folder is Ninja installed in?

Great, hope they can help. The folder will depend on the specific installation.

Mission successful. I am in the .env file and attempting to update my settings. Thank you again!

Glad to hear it, thanks for the update!

I am having issues with the email settings. I have tried several different email providers and populating their imap/smtp settings in .env. Whereas it worked previously with the default email provider on my server, I am unable to get it to work with the other email providers. It doesn’t error when generating an invoice. It says “successful addition to queue” or similar, but it never sends. Previously, I would immediately get an email to myself saying that the invoice generated, and the recipient would also immediately get the invoice. Although it says adding to the queue, that seems to be a black hole. My previous experience was that when successful it should send the mail and not go to any queue. Any guidance appreciated.

Also, is there a job that must run after updating .env? I have tried logout of Ninja and login again, restart browser. Do I need to restart the server? When is .env read–realtime or on startup? Thanks

Can you confirm the queue is set to sync in the .env file?

You shouldn’t need to run anything, you can try changing the email option to log and checking it’s updated using the health check in the app.

I thought I’d update this post with the outcome. I found some documentation explaining that the usage of GoDaddy email is not supported due to certain mail settings that they don’t allow being used in other apps. Also, although gmail is supported there are additional settings that must also be included in the .env file. I abandoned both of these email options and went with a different email provider that allows basic imap/smtp settings without blockages of any kind. This resolved the problem. Was not an Invoice Ninja problem. Thanks for your assistance.

Glad to hear it’s working, thanks for the update!