I have an issue with the Email Module. When I config through SuiteCRM the outbound and inbound emails, it doesnât work (SMTP ERROR Could not authenticate).
When I pass the outbound email directly in the SugarPHPMailer.php, it works and I can send emails.
But, I have no alternative for the inbound email.
It seems that when I pass the config through SuiteCRM, it doesnât get the config and I donât know what file to change for Inbound Email.
I also have another error in my log about email : Unable to find relationship emails_email_templates.
I donât know what to do. I can only send email, I do see the list of send email, the inbound email doesnât work.
Can someone help me ?
Iâm in SuiteCRM 7.14.4.
I can suggest ways to get more debugging info.
Uncomment this line and check (in the logs, when sending test email) that the values are correct just before being sent to the server:
https://github.com/salesagility/SuiteCRM/blob/master/include/SugarPHPMailer.php#L444
Next, uncomment these lines to get an extensive log of your SMTP interaction with the server. It should provide you with an exact error.
https://github.com/salesagility/SuiteCRM/blob/master/include/SugarPHPMailer.php#L483-L490
You might also want to look at the database table outbound_email
to check if the settings look right âunder the hoodâ. There have been bugs with the config screens that cause settings to get saved incorrectly. But these should be fixed in your versionâŚ
I did the first two step and when I uncomment the lines and put my smtp config, I can send some Emails but without that I canât.
And for the Inbound Emails, it seems the same. The settings are not correctly saved from the config screens for outbound and inbound emails.
I canât explain why uncommenting the logging code would make a difference to the success of sending the emails⌠or are you talking about uncommenting those other lines to set hard-coded values?
Anyway, consider redoing your email configuration (if by redoing it, it gets saved correctly) or consider setting values directly in the DB.
For this, you will need to work with some fields (I think itâs called stored_options
) that are stored in Base64-encoded JSON.
These sites will help you:
â https://www.base64encode.org/
â https://www.base64decode.org/
I did hard coded values in purpose of debug to see if it works and it work like that. I already retried to redo my email configuration but it didnât work either.
I think I will try to pass directly the setting values in the DB. There is no risk to directly set the values in the DB ? And if I perform a quick and repair, does my modifications will be removed from the DB ?
Also, do you know where I find the JSON ?
The risk of changing those values in the DB is taken care of by doing an export of the table as a backup, before beginning.
QR&R wonât touch these tables (inbound and outbound email).
Iâm going from memory, but if I recall correctly, one of those tables has the stored_options
which looks like itâs encrypted, but itâs just something you run through the base64 decoder and then youâre looking at a JSON array with the options. You can change that (make sure you donât break anything), run it through the base64 encoder, and put it back in the DB.
@SarahJS Before you get into troubleshooting the code, please follow my video. The email user interface is a little un-user friendly.
Please follow my guide here. If this does not work for you, then we can dig deeper in to the whatâs wrong.
1 Like
I did watch your video but it doesnât work. I tried to create a personal outbound and inbound account linked together like in your videos but it just doesnât want to authenticate. Same with the system outbound email.
I tried to see in the DB what config it saved but I cannot retrieve the password because itâs stored in hash. But Iâm sure this is a password save issue because when I hard coded the password in the SugarPHPMailer.php with $this->Password = âmyPasswordâ;, outbound email work so itâs either itâs not stored correctly in the DB or itâs not retrieve correctly when decrypt.
And because I do not know how itâs encrypt I canât say if itâs the first or the two in this situation.
I also tried to retrieve the stored_options in DB like pgr said but in the JSON, password does not seem to appeared. There is the From_addr, To_addr, etc⌠but not smtp config. I donât know if itâs correct.
Do you have any Idea ?
Email works, so I doubt itâs a bug.
So lets review your email setup. What is your email hosting? (ie: gmail, O365, self hosted, etc.)
Do you have an SSL setup for CRM?
Which PHP version are you on?
Have you setup other applications with these email settings that worked?
Have you double checked your login in password is correct by logging in with some other software?
Outbound email only works when I hard coded the password into SugarPHPMailer.php. Otherwise, it doesnât work. Plus, inbound email donât work either.
SMTP server is OVH. Itâs in TLS but with SSL, itâs the same, that doesnât work either. PHP is in 8.2 like the compatibility matrix said.
The config works on other application and works when password is hard coded on files so itâs not an issue with the smtp config (server, port, username and password).
Like I said, because itâs an issue with the password, itâs either it doesnât retrieve the password through the hash in DB or it doesnât save the password correctly in DB but I cannot say because of the hash.
Like in my video, you have to add your password each time add/change the settings in the inbound email account. If your browser overwrites the field with a saved password it stop working.
I did it and I do not save my passwords on my browser. But I can not see the list of emails in the Emails modules.
Also, why the hash of the outbound email password and the inbound email password are not the same because itâs the same account so the same password. They should have the same hash right ?
No emails are listed in the modules unless you specifically import them.
-
test the inbound email and click on folders and able to see a list of folders in the email setup? If so your inbound email is setup correctly. Jus save and your good.
-
test the outbound email by sending a test email. If that gets sent youâre good.
-
ensure in your profile you subscribe to the emails inbox you wish to see.
-
go to activities, emails and your inbox should be there.
So, I configured like in your video Inbound emails and itâs setup correctly.
First question is do I have to setup the account for every user (3 on the same mail) or can I setup an inbound email for the 3 people directly ?
Then, I did go to my profile in settings at the bottom and Iâve selected the inbox of the inbound email.
Now in activities/emails, I see a button at the top right of the page named INBOX but when I click on it, and I select it, i return to the emails blank list view.
How can I see the emails Iâve sent from SuiteCRM ?
I have multiple fatal error from IMAP when it tries to import emails.
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authenti>
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] An Imap error detected: "IMAP open error | debug data"
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] An Imap error detected: "ImapHandler:open: {ssl0.ovh.net:993\/service=imap\/tls\/ssl\/secure}INBOX"
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] An Imap error detected: "ImapHandler:open: mymail"
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] An Imap error detected: "ImapHandler:open: password is empty: no"
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] An Imap error detected: "ImapHandler:open: 32768"
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] An Imap error detected: "IMAP open error | debug data end "
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentic>
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][FATAL] Couldn't connect to mail server id: 8a3be141-6a07-9218-8fb4-66aa2ce0c883
Wed Jul 31 12:27:27 2024 [11442][7024ba96-7523-8954-a622-6399e4c5a8e5][ERROR] Unable to connect to IMAP server.
Thank you but not really helping because I use OVH Mail not Gmail so itâs not the same configuration.
By the way, Iâm sure that my configuration is working because when I configure Inbound email, Iâm able to see the folder that I want to select.
But itâs like itâs working whenever Iâm in the edition of the inbound email but not in Activities/Emails.
When I go to Emails, itâs like it have a wrong config. Thatâs my issue.
you can found file : include\Imap\Imap2Handler.php
line-ă1236ďź
$emailHeaders = json_decode(json_encode($emailHeaders), true);
change to ďź$emailHeaders = json_decode(json_encode($emailHeaders,JSON_INVALID_UTF8_IGNORE), true);
if $emailHeaders is false, return error âImapHandler trying to use a non valid resource stream.â
It doesnât work either to change that in the include/Imap/Imap2Handler.php
You cannot see the emails youâve sent from CRM in a list. You can only see them if for example you send to contact âAâ and the email is related to contact âAâ then you will see the email in the history tab of contact âAâ.
You can only see the inbox of your selected email account in activites->emails
One other thought⌠are you sending as your personal email account or the âsystemâ email account. And did you allow this in email settings or disallow this in email settings?