Bounce handling account - what does it do?

I am a first time CRM user.

I have added a bounce handler account in Admin > Inbound Mail and I have added a mail account for the user so that bounced emails receipts can be viewed in All > Emails. However, I am wondering what the bounce handler account is actually for? There is a scheduler called Run Process Bounced Campaign Emails that looks like it should do something with the receipt, but I am not seeing any effect from it. My campaign has two sections:

  1. Bounced messages, invalid emails
  2. Bounced messages other

I can manually add a bounced address, but I get the feeling that the scheduler is meant to do something, but it doesn’t. Can anyone enlighten me as to what the bounce handler is meant to do please?

The first thing to check is if your scheduler job is running?

Did you set up the cron jobs?

Is it showing a “last run time” and “succesful run” status?

Hi pgr, thanks for your help on the other thread where I also had trouble with the cron jobs and was needing to send emails using the Admin > Email Queue feature.

Yes, the scheduler job said it last ran at 2017-06-21 12:30. Can you tell me what is meant to happen when that cron job runs please?

I don’t know what it does, other than what you mentioned - look at the bounced emails and update the campaign with that information, and add those emails to the “bounced” target list.

Are you sure you’re testing correctly, with emails really sent from your campaign, and really bounced from a real email system?

OK, I wasn’t sure if it was a manual job to update the campaign or if the cron job was meant to do it somehow. Now I think about it and If I had to guess, I would say that if the bounce handler is an unmonitored mailbox then the cron job scans that box, finds bounce messages and auto-creates a case based on the bounce handler options so that action can be taken.

Yes, the emails are sent from the campaign and bounced through a real email system.

The cron job doesn’t create a case for a bounced message, but it does add the email into a Target list, so then you can do whatever processing you need. It can be human processing, or Workflow processing.

OK, thanks for the information. It looks like that isn’t happening then. This is the email receipt for the bounce:


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:

  noexist@talkingcouch.uk
    Unrouteable address

------ This is a copy of the message, including all the headers. ------

Return-path: <gavin@marketing.talkingcouch.uk>
Received: from [52.49.212.214] (helo=crm.talkingcouch.uk)
	by ip-172-31-24-237.eu-west-1.compute.internal with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.84_2)
	(envelope-from <gavin@marketing.talkingcouch.uk>)
	id 1dNIVr-0002ql-9u
	for noexist@talkingcouch.uk; Tue, 20 Jun 2017 13:44:10 +0100
Date: Tue, 20 Jun 2017 13:44:02 +0100
To: noexist@talkingcouch.uk
From: gavin@marketing.talkingcouch.uk
Reply-To: gavin@marketing.talkingcouch.uk
Message-ID: <1205c591f5a308575d77b69ac7c04de8@crm.talkingcouch.uk>
X-Mailer: PHPMailer 5.2.21 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="b1_1205c591f5a308575d77b69ac7c04de8"
X-SA-Exim-Connect-IP: 52.49.212.214
X-SA-Exim-Mail-From: gavin@marketing.talkingcouch.uk
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	ip-172-31-24-237.eu-west-1.compute.internal
X-Spam-Level: 
X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,BAYES_00,
	HTML_MESSAGE autolearn=ham autolearn_force=no version=3.4.0
Subject: Check bounce
X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000)
X-SA-Exim-Scanned: Yes (on ip-172-31-24-237.eu-west-1.compute.internal)

This is a multi-part message in MIME format.

This is the only error in the suitecrm.log file and it is repeated many times but the time stamps don’t match the scheduler so it may be unrelated:


[ERROR] convert: Conversion of 2017-12-09 11:55:00 from Y-m-d H:i to Y-m-d H:i:s failed

Not the end of the world but it would be nice to know that things are working correctly. I can always add it to the Target list manually.

Did you configure the timezone for the cron jobs?

You know you have two php.ini’s, one for the web server, one for CLI (which is normally where the cron jobs run). You have to set timezone in both.

Yes, both /etc/php/7.0/apache2/php.ini and /etc/php/7.0/cli/php.ini contain:


date.timezone = "Europe/London"

You can have a look at the code to try and find more clues:

https://github.com/salesagility/SuiteCRM/blob/032cc000331e1d9a411e468f292e8f9d14d553fd/modules/Schedulers/_AddJobsHere.php#L396-L413

For example, you could try that query from MySQL to see what it’s returning.

I have the same problem. I installed suitecrm from turnkeylinux and in their documentation I can read that cron jobs are correctly configured and working.
I do not receive bounced mail nor read message notification (I know this may be another problem but anyway…)

I do not understand also why I need to create another bounce account like bounce@mydomain.com when I receive bounce notification on the from address (info@mydomain.com)

Help us please!
Thanks in advance,
Mario

@mgiammarco and @doahh, what version of SuiteCRM is each of you running? If it’s 7.9 or 7.9.1 this is likely just a bug, the new Email system is still undergoing a lot of fixes.

Sorry forgot: it is 7.8.3 from turnkey linux. I have not updated it.

I’m on 7.9.1 so may well just be an issue with the current email upgrades.

Looks like the inbound email account is correctly configured:


mysql> SELECT id FROM inbound_email WHERE deleted=0 AND status='Active' AND mailbox_type='bounce';
+--------------------------------------+
| id                                   |
+--------------------------------------+
| b747ff7a-6580-1c92-8189-5948ea3a87db |
+--------------------------------------+
1 row in set (0.00 sec)

I don’t have a local LAMP setup and my PHP is next to useless but looking through Github the next call is to importMessages(). I’m using IMAP and so it then goes to importMailboxMessages() and then to importOneEmail(…). The last function looks like it deletes messages that were deleted on the server from the email_cache table. I may be reading it wrong but this seems like an internal cleanup and not something that is meant to be adding a bounced message to a queue. I’m happy to be corrected.

importOnEmail(…) has a doc comment of:


@deprecated since - 7.9 use returnImportedEmail instead

so it looks like the wrong function is being called in importMailboxMessages() for the SuiteCRm version I am on.

Yes, you are right, it’s probably a bug, calling the deprecated function. That function seems to be replaced by returnImportedEmail.

Inside returnImportedEmail there is a call to HandleMailboxType which handles bounces. It doesn’t seem to get called at all in the old importOneEmail function, although I’m sure there was some bounce handling somewhere…

I’ll bring this up on Github with the developer of the Email module and we’ll see what he says. Thanks.

@mgiammarco if you are running 7.9.x then you surely must have a different issue. I would make sure your cronjobs are running (see “last run time” in Admin/schedulers).

Can you guys help out with testing of the fix? It’s here:

https://github.com/salesagility/SuiteCRM/pull/3777/files

Thanks!

I have made the changes. However, in modules/InboundEmail/InboundEmail.php the changes are on lines:

  1. 4374 and not 4410;
  2. 7574 and not 7609.

As a first time user of SuiteCRM I am not sure what is meant to happen but I am not seeing any difference. I added a new email to the list that generates the bounce receipt and I left that email in the inbox. I have set the Run Process Bounced Campaign Emails to run every minute. After it runs there are no entries in either of the Bounced Messages sections of the campaign, nor is there anything in the suitecrm.log file that looks relevant:


Sat Jun 24 11:22:20 2017 [14001][1][ERROR] convert: Conversion of 2017-06-24 11:30 16:00 from Y-m-d H:i to Y-m-d H:i:s failed
Sat Jun 24 11:22:36 2017 [14435][1][ERROR] Unable to get proper side for link assigned_user_link
Sat Jun 24 11:22:36 2017 [14435][1][ERROR] Unable to get proper side for link assigned_user_link
Sat Jun 24 11:22:40 2017 [27624][1][ERROR] Unable to get proper side for link assigned_user_link
Sat Jun 24 11:22:40 2017 [27624][1][ERROR] Unable to get proper side for link assigned_user_link
Sat Jun 24 11:37:35 2017 [10968][1][ERROR] Unable to get proper side for link assigned_user_link
Sat Jun 24 11:37:35 2017 [10968][1][ERROR] Unable to get proper side for link assigned_user_link
Sat Jun 24 11:40:22 2017 [12403][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 24 11:40:22 2017 [12403][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 24 11:40:22 2017 [12403][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 24 11:40:22 2017 [12403][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 24 11:55:50 2017 [12808][1][ERROR] Field date_time_end expecting datetime format, but got value:

The only thing I can think of is that SuiteCRM sends email out through the System account and the bounce handler is using my user account. I don’t know if that would cause a problem. The bounce receipt is received in my user accounts mailbox.

The line differences are because of other fixes that have been done in that file. They might contain important stuff. Ideally you would only be testing a complete 7.9.2 when it came out, but we’re doing a bit of early work here (thanks!).

It’s normal for the mail to go out through system account, but to bounce to an independent bounce account. Many people use configurations like that to keep bounces separate from the rest.

I’m not so sure about receiving bounces in an inbound user account. Maybe it’s also ok, but I’m not sure. Maybe the system processes the email differently, and then doesn’t get to do the bounce processing…

Can you try using a different bounce-account, only for that purpose?

Once again, thanks for your cooperation.