Email not working in v 7.9.7

I’ve been trying to install the latest version in order to be able to use some of the new features that are missing in old versions (like email to: autocomplete)

However after installing the 7.9.7 version the email stopped working alltogether…
I’ve found 3 similar topics here already, but none of them had any solutions :dry:

https://suitecrm.com/forum/installation-upgrade-help/15214-email-broken-after-upgrade-to-7-9-4#51260
https://suitecrm.com/forum/suitecrm-7-0-discussion/16750-error-sending-email-please-contact-your-administrator-for-assistance#56290
https://suitecrm.com/forum/suitecrm-7-0-discussion/16398-emails-module-not-working#55274

I’m able to send the email when I go to:
Admin->email settings -> send test email. and i also receive the email in the inbox where i send it.

When I try to send an actual email from the interface, I get the error:
Error Sending Email. Please contact your administrator for assistance.

I get this message in my suitecrm.log file:
[SECURITY] User x attempted to send an email using incorrect email account settings in which they do not have access to.

And the user is logged out (with the next action i’m taken to the login page).

Could there be such a big bug in an actual release? Or is there some setting that i’m not aware of? Any help would be appreciated.

Best wishes

On one of those posts you linked, there’s a post by me referencing this other post:

https://suitecrm.com/forum/suitecrm-7-0-discussion/16507-mail-stopped-working-error-smtp-connect-failed#55682

That is a debugging procedure for email, it should enable you to get to the bottom of this.

This is not happening to everybody… it seems to be just some very specific combination of circumstances. If you can find out and tell us what it is, there’s a better chance of getting it fixed… Thanks.

Hey pgr,

Thank you for your fast response. I have done the following:

  1. copied the SugarPHPMailer.php file (for backup and then edited the original file)
  2. removed the smtpConnect function (lines 354-373 in my case)
  3. copied the code from your post to the file (starting at line 354)
  4. logged in the page and tried sending the email.

Unfortunately looks like the code is not getting run, when I try to send the email i still get the same error in the front end and still just this message in the log

Sat Dec 2 00:01:00 2017 [13359][1][SECURITY] User Administrator attempted to send an email using incorrect email account settings in which they do not have access to.

Am i supposed to clear some cache or sth to make sure the new/changed file is beeing used?

Thank you!

No, I don’t think it’s a cache thing.

You said earlier that you could send from the “Test send email” button - can you try that again and see if my code runs, and you have extra messages in suitecrm.log?

About your error: there is a check that users can’t send from an account if it’s the system account (Admin / Outbound Email settings), or if it belongs to another user. Unless you can find that is really happening in your configuration, I would just give up and try deleting all accounts and starting a fresh configuration. There might be something misconfigured in your database.

Hey!

I have done as you suggested, and have this in the log. I have replaced the domain name and usernames and such with *****
Sat Dec 2 11:05:33 2017 [21872][1][FATAL] ------------ Entering SugarMailer send
Sat Dec 2 11:05:33 2017 [21872][1][FATAL] PHPMailer Send Function override: { FromName: ***** CRM From: ***** Host: ***** UserName: ***** }
Sat Dec 2 11:05:33 2017 [21872][1][FATAL] ------------ Entering smtpConnect
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 3: Connection: opening to :25, timeout=300, options=array ( }
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { ) }
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 3: Connection: opened }
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 2: SERVER -> CLIENT: 220 ***** ESMTP Postfix (Ubuntu)
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 1: CLIENT -> SERVER: EHLO *****
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 2: SERVER -> CLIENT: 250-

}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 250-PIPELINING
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 250-SIZE 10240000
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 250-ETRN
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 250-STARTTLS
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 250-ENHANCEDSTATUSCODES
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 250-8BITMIME
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 250 DSN
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 1: CLIENT -> SERVER: AUTH CRAM-MD5
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 2: SERVER -> CLIENT: 334 PDE1MTcxODE5MzUuMjI1OTc4NEBtYWlsLnRyYXVtaG9jaHplaXQuY2M+
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 1: CLIENT -> SERVER: ******
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] smtpConnect: { 2: SERVER -> CLIENT: 235 2.7.0 Authentication successful
}
Sat Dec 2 11:05:34 2017 [21872][1][FATAL] ------------ Exiting smtpConnect
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 3: Connection: opening to :25, timeout=300, options=array ( }
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { ) }
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 3: Connection: opened }
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 2: SERVER -> CLIENT: 220 ***** ESMTP Postfix (Ubuntu)
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: EHLO *****
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 2: SERVER -> CLIENT: 250-

}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 250-PIPELINING
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 250-SIZE 10240000
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 250-ETRN
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 250-STARTTLS
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 250-ENHANCEDSTATUSCODES
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 250-8BITMIME
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 250 DSN
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: AUTH CRAM-MD5
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 2: SERVER -> CLIENT: 334 *****
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: ********
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 2: SERVER -> CLIENT: 235 2.7.0 Authentication successful
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: MAIL FROM:<>
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 2: SERVER -> CLIENT: 250 2.1.0 Ok
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: RCPT TO:<
>
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 2: SERVER -> CLIENT: 250 2.1.5 Ok
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: DATA
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 2: SERVER -> CLIENT: 354 End data with .
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: Date: Sat, 2 Dec 2017 11:05:33 +0100
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: To: *****
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: From: ***** <>
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: Subject: Test E-Mail von SuiteCRM
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: Message-ID: <c329b18aa588ea883316335736d7dbe9@
>
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.25 (https://github.com/PHPMailer/PHPMailer)
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: MIME-Version: 1.0
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: Content-Type: text/plain; charset=UTF-8
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: Content-Transfer-Encoding: quoted-printable
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER:
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: Diese E-Mail wurde gesendet, um die Einstellungen des ausgehenden Mail Serv=
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: ers in SuiteCRM zu testen. Wenn Sie diese Meldung lesen, ist anzunehmen, da=
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: ss diese richtig sind.
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER:
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: .
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 2: SERVER -> CLIENT: 250 2.0.0 Ok: queued as C88012C80D2B
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 1: CLIENT -> SERVER: QUIT
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 2: SERVER -> CLIENT: 221 2.0.0 Bye
}
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] smtp send: { 3: Connection: closed }
Sat Dec 2 11:05:35 2017 [21872][1][FATAL] ------------ Exiting SugarMailer send

So what exactly should i delete and recreate in order to make it work?

Thank you for your help.

Urgent: you didn’t read the warning in that post! Edit your post to remove the garbled text in the line BEFORE this one:

SERVER -> CLIENT: 235 2.7.0 Authentication successful

That’s your password, and it’s not encrypted, it’s just base64 encoded!

I’ll answer your question after you fix this.

Ok, so we know the code is working. Don’t worry about all those “FATAL” messages, I just made everything FATAL to make sure it shows in the log, even if people use low logging levels.

That information won’t get you very far (it worked). It’s really helpful to debug emails that aren’t sending… For some people it’s certificates, for others it’s DNS, for others it’s passwords, for others it’s From field mismatch, for others it’s SuiteCRM email bugs.

About your error: I would delete all email accounts from system (Admin / Email outbound), and from this user you’re trying to send from.

Then set them up again, system first, do the tests, and try to get the system to send by assigning a record to a user, that user should receive a system-sent email.

Once that is working, set up the user’s email, test, and try composing an email. Make sure it’s a different account from the system account.

You might save some work if you can go into the database via phpMyAdmin and check the email accounts tables there:

  • inbound_email
  • outbound_email

Ignore anything with DELETED=1, that’s old stuff, you can even delete those rows. Then just try to figure out if anything looks inconsistent…

1 Like

Hey!
So I went ahead and removed all the system emails from:
Admin -> Email outbound -> select all -> delete

then I created a new system account (with another email user and pass), tested that one works.

Then went back to the users settings:
Profile -> email einstellungen -> einstellungen -> e-mail-konten -> and there I see 2 entries for the “Outgoing SMTP Mail Servers”. One is the system one that I cand edit or delete. I’m guessing that could be the cause of the problem, as the email tries to send over the system account. The second one is the user email, but it seems the system always wants to send using the first one?

When you are composing the email from the user, do you get a “From” box with both accounts to select from?

No, I only get that field as dropdown with only one option. But i went back to the options and found that if I click on the “edit icon” of the “Mail Accounts” sections of the persons E-Mail Konten tab, then I can change which outgoing server will be used.

Mind blown. It is working now (at least for this user), I guess I will have to make the same changes to the other users.

I never would have thought that the settings for the outgoing server would be under mail accounts, especially when there is a section for “Outgoing SMTP Mail Servers”.
In any case: a big thank you for taking your time and helping me solve this issue! :cheer: :cheer: B)

I assume you mean you see only the user’s email there, not the system one.

Can you give me the exact error message (in English, please) so I can look for the place in the code where the error is being thrown?

1 Like

I have now tried to update the production system and there are 2 new problems (hopefully related so fixing one will also help fix the other):

  1. When i go to Email, i can see the emails, but most of the buttons e.g. New email, email settings,… are not responsive… nothing happens when i click them. No errors in console, no errors in server log :confused:
  2. when i go to email settings profile -> email settings -> settings i’m simply redirected to the list of users instead of getting the setting screen for the emails

Please help :S

I’m sorry, I don’t have many ideas about your strange problems…

Do you see any clues in your logs?

I wanted to edit the last post, but could not. Turns out some files ownership changed during the update and therefore could not be read. I’ve changed that back to the correct user and that partially solved. The second part that did it in the end was clearing the browser cache on the client.