Zoho SMTP don't send email OJS 3.0

Hi,
I am running a OJS 3.0.1, I tried many time zoho mail on this system but failed while I run gmail successfully please suggest the setting

; Use SMTP for sending mail instead of mail()
smtp = On

; SMTP server settings
smtp_server = “ssl://smtp.zoho.com”
smtp_port = 465

; Enable SMTP authentication
; Supported mechanisms: ssl, tls
smtp_auth = LOGIN
smtp_username = “info@actamedica.org
smtp_password = “PASS”

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
allow_envelope_sender = On

; Default envelope sender to use if none is specified elsewhere
default_envelope_sender = “info@actamedica.org

Could you clarify whether you are having problems with Zoho or Gmail? If you are having problems with Zoho, then you might want to check if IMAP is enabled. Usually, by default they do not enable it. To do this go to the Control Panel > Mail Accounts > Select the Email ID You Want > Click IMAP Access Disabled. The status should be changed to “enabled”. Hope this helps.

Hi @asmecher @Srivats_Shankar

I tried smtp settings of Gmail, Yandex, Hotmail and Zoho in OJS 3.0.2. All smtp configurations, except zoho, worked successfully.

I also realized that Zoho email smtp settings works in OJS 2.4 but it does not work in OJS 3.0 releases.
All IMAP settings are enabled and all configurations i made seems correct.

Interesting. I will try to see if I can get this to work on my instance. At the moment does removing ssl:// work for you? This would make the SMTP server “smtp.zoho.com” only.

Could you also uncomment the line “Supported mechanisms: ssl, tls”

hi @asmecher @Srivats_Shankar

i tried almost all combination like
smtp_server, only smtp.zoho.com, ssl://, tls://
smtp_server tried 465, 587
smtp_auth tried LOGIN, PLAIN, ssl, tls

I highly doubt this, but by any chance have you activated two factor authentication?

No not activated TFA

An exception caught by PHPMailer should be recorded in your error_log.

Do you see any detail there which might help?

Hi @ctgraham

i found only error notification in postfix mail log, however there is not any error message in Appache.log. Here is the error notification recorded in postfix.mail

Mar 9 16:29:54 hsn2 postfix/smtpd[10511]: warning: hostname vps863.hidehost.net does not resolve to address 91.200.12.150: Name or service not known
Mar 9 16:29:54 hsn2 postfix/smtpd[10511]: connect from unknown[91.200.12.150]
Mar 9 16:29:57 hsn2 postfix/smtpd[10511]: warning: unknown[91.200.12.150]: SASL LOGIN authentication failed: authentication failure
Mar 9 16:29:57 hsn2 postfix/smtpd[10511]: lost connection after AUTH from unknown[91.200.12.150]
Mar 9 16:29:57 hsn2 postfix/smtpd[10511]: disconnect from unknown[91.200.12.150]
Mar 9 16:31:24 hsn2 postfix/smtpd[10511]: connect from unknown[93.174.93.18]
Mar 9 16:31:26 hsn2 postfix/smtpd[10511]: warning: unknown[93.174.93.18]: SASL LOGIN authentication failed: authentication failure
Mar 9 16:31:26 hsn2 postfix/smtpd[10511]: disconnect from unknown[93.174.93.18]
Mar 9 16:34:46 hsn2 postfix/anvil[10221]: statistics: max connection rate 1/60s for (smtp:112.124.76.177) at Mar 9 16:26:15
Mar 9 16:34:46 hsn2 postfix/anvil[10221]: statistics: max connection count 1 for (smtp:112.124.76.177) at Mar 9 16:26:15
Mar 9 16:34:46 hsn2 postfix/anvil[10221]: statistics: max cache size 1 at Mar 9 16:26:15
Mar 9 16:38:17 hsn2 postfix/smtpd[11183]: warning: hostname vps863.hidehost.net does not resolve to address 91.200.12.150: Name or service not known
Mar 9 16:38:17 hsn2 postfix/smtpd[11183]: connect from unknown[91.200.12.150]
Mar 9 16:38:19 hsn2 postfix/smtpd[11183]: warning: unknown[91.200.12.150]: SASL LOGIN authentication failed: authentication failure
Mar 9 16:38:19 hsn2 postfix/smtpd[11183]: lost connection after AUTH from unknown[91.200.12.150]
Mar 9 16:38:19 hsn2 postfix/smtpd[11183]: disconnect from unknown[91.200.12.150]
Mar 9 16:41:39 hsn2 postfix/anvil[11185]: statistics: max connection rate 1/60s for (smtp:91.200.12.150) at Mar 9 16:38:17
Mar 9 16:41:39 hsn2 postfix/anvil[11185]: statistics: max connection count 1 for (smtp:91.200.12.150) at Mar 9 16:38:17
Mar 9 16:41:39 hsn2 postfix/anvil[11185]: statistics: max cache size 1 at Mar 9 16:38:17

Were you able to connect to zoho with OJS 2.x on this same box? The warnings might suggest that the mail connection is not trusting the fact that your DNS name doesn’t map the to IPv4 address you are using.

It is also possible that that warning is not fatal, and the real concern is the failed SASL authentication.

You might be able to differentiate between these possible problems by manually testing a PHPMailer connection to zoho:
http://phpmailer.worxware.com/?pg=examplebsmtp

I can confirm the problem and identify the cause of the problem. Zoho mail’s relay restrictions do not allow mail to be sent form a FROM address, that is not the Zoho mail users account own address. And it make s sense ;).
My dirty workaround is to modify the lib/pkp/lib/vendor/phpmailer/phpmailer/class.phpmailer.php:
and change
$this->From = $from;
to
$this->From = ‘myzohoacaunt@zoho.com’;
but this is messy. An elegant and much more sensible solution would be, if OJS FROM mail would originally be set as the account mail, and the ojs users adder would be moved to ReplyTo field.

Thanks.

I also am having problems with ZOHO and OJS, versoin 3.1.1-1

I have tried the above workaround, but still no success.

It used to work, but I was trying today to test some email templates, and it seems to be broken.

public function setFrom($address, $name = ‘’, $auto = true)
{
$address = trim($address);
$name = trim(preg_replace(’/[\r\n]+/’, ‘’, $name)); //Strip breaks and trim
// Don’t validate now addresses with IDN. Will be done in send().
if (($pos = strrpos($address, ‘@’)) === false or
(!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
!$this->validateAddress($address)) {
$error_message = $this->lang(‘invalid_address’) . " (setFrom) $address";
$this->setError($error_message);
$this->edebug($error_message);
if ($this->exceptions) {
throw new phpmailerException($error_message);
}
return false;
}
$address = “.@mm**s.org”;
$this->From = $address;
$this->FromName = $name;
//$this->FromName = “MMSG”; //added
if ($auto) {
if (empty($this->Sender)) {
$this->Sender = $address;
}
}
return true;
}

As I said - it does not work with FROM being different than the zoho mail account – my solotion was to hack
lib/pkp/lib/vendor/phpmailer/phpmailer/class.phpmailer.php

I understand.

I have used the same email address as the zoho: my zoho email is using another domain registered : mmsj*.org

That is the one that I use to enter zoho mail.

Thanks

Stephen

I’m not sure what’s going on. I have the exact same hack and it’s working.
What’s in apache2 error log?
B.