After installing SuiteCRM, I was unable to receive emails.
After troubleshooting, the issue was traced back to the ID command.
Upon confirming the use of php-imap2, the relevant code was found in:
vendor/javanile/php-imap2/src/Roundcube/ImapClient.php:1786
/**
* Executes ID command (RFC2971)
*
* @param array $items Client identification information key/value hash
*
* @return array|false Server identification information key/value hash, False on error
* @since 0.6
*/
public function id($items = array())
{
if (is_array($items) && !empty($items)) {
foreach ($items as $key => $value) {
$args[] = $this->escape($key, true);
$args[] = $this->escape($value, true);
}
}
list($code, $response) = $this->execute('ID',
array(!empty($args) ? '(' . implode(' ', (array) $args) . ')' : $this->escape(null)),
0, '/^\* ID /i');
if ($code == self::ERROR_OK && $response) {
$response = substr($response, 5); // remove prefix "* ID "
$items = $this->tokenizeResponse($response, 1);
$result = array();
if (is_array($items)) {
for ($i=0, $len=count($items); $i<$len; $i += 2) {
$result[$items[$i]] = $items[$i+1];
}
}
return $result;
}
return false;
}
vendor/javanile/php-imap2/src/Roundcube/ImapClient.php:943
// Send ID info
if (!empty($this->prefs['ident']) && $this->getCapability('ID')) {
$this->data['ID'] = $this->id($this->prefs['ident']);
}
$auth_method = $this->prefs['auth_type'];
Final Solution
Modified the connection parameters in:
vendor/javanile/php-imap2/src/Connection.php:126
$success = $client->connect($this->host, $this->user, $this->password, [
'port' => $this->port,
'ssl_mode' => $this->sslMode,
'auth_type' => $this->flags & OP_XOAUTH2 ? 'XOAUTH2' : 'CHECK',
'timeout' => -1,
'force_caps' => false,
// Add ID Command parameters
'ident' => [
'name' => 'SuiteCRM',
'version' => '8.8.0',
'vendor' => 'SugarCRM',
'support-email' => 'xxx@163.com',
]
]);
By adding the ID command parameters (ident
), the email reception issue was resolved.