Does anyone have any new ideas for fixing the issue described below and stopping the suitecrm.log file from filling up with FATAL errors?
This is a new post because I have followed the previous posts which suggest solutions, including some which are now included in the code, but I am still having the issue and cannot get the Inbound email account for bounced emails to work.
Every time the “Run Nightly Process Bounced Campaign Emails” schedule runs, I get three “Fatal” IMAP errors
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] An Imap error detected: "IMAP search error"
Apparently this has been an issue for quite a while and is still present in v8
When I do a “Test connection settings” from the settings page for the bounce account, it comes back “Connection completed successfully”.
When I manually send (from my personal email account) a test email to the bounced account, and read the bounced email with a separate email client, it is received at the bounced account, using the same settings I have in the SuiteCRM bounced email Inbound account.
I am on the latest v7 of SuiteCRM - 7.14.8
I am using PHP 8.2 on Linux (One on Debian and one on RedHat with same results)
Per the (wonderful) work done by @pstevens at Email Bounce Handling? - #11 by pstevens , since I have used AWS and Mailjet I edited the function campaign_process_bounced_emails in ProcessBouncedEmails.php to include the AWS “From” address no-reply@sns.amazonaws.com in the preg_match line so it now looks like if (preg_match('/MAILER-DAEMON|POSTMASTER|no-reply\@sns\.amazonaws\.com/i', (string) $emailFromAddress)) {
At Bounce Handling account is not correctly set in email campaigns · Issue #8852 · SuiteCRM/SuiteCRM · GitHub a bug was identified that prevented the Return Path from being properly set in emails sent via Campaigns, and even though the fix was agreed upon it was not implemented in code as of v7.14.8 so in EmailMan.php I edited the line $mail->Sender = $this->current_emailmarketing->from_addr ? $this->current_emailmarketing->from_addr : $this->mailbox_from_addr;
to $mail->Sender = $this->mailbox_from_addr ? $this->mailbox_from_addr : $this->current_emailmarketing->from_addr;
//MATIK FIX
//for mails with MIME type (multi-content emails) mail is parsed wrong, no text only attachment
$emailTextMessage = $this->mailParser->parse($emailBody)->getTextContent();
$emailHtmlMessage = $this->mailParser->parse($emailBody)->getHtmlContent();
if(!empty($emailHtmlMessage)){
$emailMessage = $emailHtmlMessage;
}else{
$emailMessage = $emailTextMessage;
}
//END MATIK FIX
I have made all these code edits and run a “Repair and Rebuild” but the log file keeps filling with the 3 Fatal error messages shown above
Does anyone have any new ideas for fixing the issue and stopping the suitecrm.log file from filling up with FATAL errors?
If it was just the error, then I could probably live with a log file filling up (and up and up and … )
But I also am not getting the bounced messages read by SuiteCRM even though, when I test the connection, it tests out.
I use a bulk mail provider (Mailjet) which has been good about getting the bounced emails back to me but something changed recently so I am not getting them now and I am working with them to fix that.
I have also TRIED to get Amazon AWS SES (Simple Email Service my ass) to work with SNS (Simple Notiofication Service = same comment) but my brain exploded after a few hours so I went back to Mailjet to see what we could work out.
On another topic…
Do you know if the edits to mail->Sender described above are still valid? I checked and my SuiteCRM - v 7.14.8 - still has the old code so I was not certain if someone came up with a different solution to properly putting the Return-Path into the header of Campaign emails.
@Ramblin I would think they are still valid. I haven’t used in a while, I’ve switched to Mautic for all outbound email campaigns. Mautic syncs with SuiteCRM and far superior for email campaigns on so many levels (bounce handling is one!).
I love SuiteCRM its a fantastic CRM, but years behind on the Marketing side of things. Mautic is state of the art and open source. As a bonus, I mentioned it syncs perfecly out of the box with SuiteCRM. Best of both worlds.
Thank you; that does help … A LOT. There were a few spots (like choosing the 6.x SugarCRM version) that would have messed me up.
Mautic does sound great.
I must say, due to my poor listening skills, I got a chuckle when I THOUGHT you said “You need to setup a con job” and then realized you had said “You need to setup a CRON job.”
We are in the middle of a campaign now so will not be trying anything new (again) until January - guess what just happened when I tried making changes in the middle of this campaign - but will look at Mautic as an alternative then.
Have you ever tried Amazon SES. They say SES stands for Simple Email Service, but I found setting it up and using Amazon SNS (Simple Notification Service) ANYTHING but simple. I was going in circles so gave up (for now).
Maybe in January, I’ll try Mautic and Amazon AWS again (if AWS is warranted)
Question for you:
I see in your video that Mautic is still using OATH 1.0 for secure connections. With Oauth 2 getting all the attention, is Oath1 phasing out and will Mautic’s setup be deprecated? This is a question from a guy who really knows nothing about Oauth (1 or 2) so don’t take it as a criticism, just an amateur question.
The mautic integration uses the API 4_1 which depends on Oauth1. I don’t know of any plans to depricate this. Many people use it. The 4_1 API still has many advantages over the V8 Api witch is Oauth2.
I’ve setup AWS without issue. It’s not very user friendly but can be done. Its one of the lowest cost per email out there.
I’ve never set it up specifically for Mautic. I have for SuiteCRM a few times. It works great BUT… you will get banned for too much spam. You have to be extremely careful about your bounce rates.
Here’s a bunch of my screen shots. I tried to help this person who was extremely rude LOL!, but theres a lot of good info there. I don’t have a specific video on setting up AWS. But like in the thread, the trick part is AWS not adding it to SuiteCRM.
I am surprised you bothered replying after some of his comments.
Even pgr tried getting him/Nick to improve his treatment of you.
Thanks for sharing.
Geeting AWS to send the emails was something I was able to do fairly easily so from that point of view, yes it was Simple Email Service.
I was not aware of their tight SPAM policies so I’ll have to figure out a way to handle that if I do go with them; thanks for the heads-up.
But Using SNS to get the feedback to SuiteCRM about Bounces and Opens/Clicks was the part I could not get working and gave up.
Mailjet keeps telling me to use webhooks to send that info back to SuiteCRM but I do not see how to do that since SuiteCRM wants to use a return email = bounced @domain.com
AWS said it could do it but that is where Simple did NOT apply (to me)
I’ll see about playing with it on a dev system but don’t want to repeat the damage done with my latest experiment on a live system. I tried a few things to get Mailjet working and instead broke the system so had to restore back to a week-old backup and lost some current data - not cool.
(Admitting stupidity is never a good thing I guess … )
The system I am managing is for a Rotary club that fund-raises to the tune of just under $1 million each year so we try to minimize the vectors for hackers and do not store passwords or involve 3rd Parties to hold data - unless we have to. We have our own domain and both Inbound and Outbound accounts work, but I use a bulk email provider ONLY as an SMTP relay for large Outbound campaigns (about 7,000 per email) and keep all user data, … on our system only.
I did setup the bounce handling for AWS for one client. That’s where my experience with it comes in and the edits to SuiteCRM bounce handling.
I can only find my notes about setting up SES, not about how to enable the Bounce reply via email. It is possible though, I know I did it. Thats why I needed to edit the SuiteCRM bounce handling to deal with how SES notifies the bounce.
Yes, AWS uses no-reply@sns.amazonaws.com as the From address for bounced emails and I did add that to the preg_match algorithm as your post instructed.
But I thinkI just needed to take a break and come back at it fresh - which I’ll do in January
I seem to remember there is an option to “return the original headers” or something very close to that. That’s super important in order to get the SuiteCRM campaign ID back from AWS in the bounce notification.