in the schema the port is defined as "text" when it should be defined as "string" since text makes it translatable and opens the possibility to have configurations that are not synchronized between languages.

CommentFileSizeAuthor
#2 2865696-fix-schema-2.patch1.4 KBrodrigoaguilera

Comments

rodrigoaguilera created an issue. See original summary.

rodrigoaguilera’s picture

Title: Wrong schema for settings smtp port » Wrong schema for smtp settings
Status: Active » Needs review
StatusFileSize
new1.4 KB

Patch attached fixing all texts that should be strings

ToxaViking’s picture

Works for me

estoyausente’s picture

Status: Needs review » Reviewed & tested by the community

works for me too.

wundo’s picture

  • wundo committed c9496a9 on 8.x-1.x authored by rodrigoaguilera
    Issue #2865696 by rodrigoaguilera, ToxaViking, estoyausente, wundo:...
wundo’s picture

Status: Reviewed & tested by the community » Fixed
r-m-n’s picture

Hello, I'm having the same problem as in https://www.drupal.org/node/2839554 ('Use encrypted protocol' selector is disabled when the site admin is not in the default language). I have applied the patch manually and cleared the cache and there is no change. Any help would be appreciated. I'm Using Drupal 8.

waxstuka’s picture

Hi r-m-n,
you can solve this by hand. If you are a drupal noob like me, go to MYDRUPAL/modules/smtp/config/schema
and edit the smtp.schema.yml file.

You have to replace the word "text" with "sting" as rodrigoaguilera described.

estoyausente’s picture

@r-m-n, @waxstuka you only have to update the module to the last version, this patch is already applied in it.

r-m-n’s picture

HI waxstuka and estoyausente (nice username, btw!). Thanks for your replies, this issue is vitally important for me. I have done both the things you suggest and cleared cache but there is no change.

I'm using SMTP version 8.x-1.0-beta3, is there a newer version?

My smtp.schema.yml file looks like this:

smtp.settings:
  type: config_object
  label: 'SMTP config.'
  mapping:
    smtp_on:
      type: boolean
      label: 'Turn this module on or off'
    smtp_host:
      type: string
      label: 'SMTP server'
    smtp_hostbackup:
      type: string
      label: 'SMTP backup server'
    smtp_port:
      type: string
      label: 'SMTP port'
    smtp_protocol:
      type: string
      label: 'Use encrypted protocol'
    smtp_username:
      type: string
      label: 'Username'
    smtp_password:
      type: string
      label: 'Password'
    smtp_from:
      type: email
      label: 'E-mail from address'
    smtp_fromname:
      type: string
      label: 'E-mail from name'
    smtp_client_hostname:
      type: string
      label: 'Hostname'
    smtp_client_helo:
      type: string
      label: 'HELO'
    smtp_allowhtml:
      type: string
      label: 'Allow to send e-mails formated as HTML'
    smtp_test_address:
      type: email
      label: 'E-mail address to send a test e-mail to'
    smtp_debugging:
      type: boolean
      label: 'Enable debugging'
    prev_mail_system:
      type: string
      label: 'Previous mail system'

Can you see anything obvious that I'm doing wrong?

waxstuka’s picture

This drives me crazy... yesterday it worked. Now it doesn't at all...
While trying this a couple times I am getting sometimes a test email but nearly all the time I am getting an mail error in /admin/reports/dblog. This is rly spooky. How can I debug this. Is there any other way then just seeing the mails in the log files?

I would like to add, that I am using smtp mail with a version of php 5.6.30, this one works fine!

On the other system I am using php version 7.0.18, this is the broken one...

estoyausente’s picture

Your smtp.schema.yml is correct but I'm not sure if your config is rebuild automatically when the file is updated. Maybe reinstall the module would be a good idea.

Remind that this module is still in a beta status :)

r-m-n’s picture

Thanks for your comment estoyausente, I'm updating core at the moment. When it finishes, I'll try to reinstall the module. I'll report back later.

r-m-n’s picture

@estoyausente, I finished upgrading to core 8.3.5, then I uninstalled SMTP and reinstalled version 8.x-1.0-beta3. The first thing I did was look at smtp.schema.yml and type is set to 'text' so I can't see how the patch is applied in this latest version of SMTP.

Here is what I did next, just incase it will help others with the same problem. Before activating the SMTP module, I changed all the 'text' to 'string' saved smtp.schema.yml and then activated the module. I went to the non-default language first and configured the module. Then I checked in the default language, the settings were the same. Then I made sure my mail system was set to SMTP. I sent a test message with the site in default and non-default languages, and... it worked!

Now, let's see how stable it is. I hope I don't have these problems again.

Many thanks to everyone that has given their input. :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sarikak’s picture

I'm using Drupal 8.3.7, and have the 8.x-1.0-beta2 version of the SMTP module.
Before the only language of the site was English and everything worked very well. After switching to multi-language, mailing does not work with the English language, and not for other languages. On the configuration page I have this message:

Disabled fields are overridden in site-specific configuration file.

Unable to send email. Contact the site administrator if the problem persists.

I have also applied the above-mentioned patch.

Edited

Finally, I got this issue resolved.
The actual reason for this error is the newly implemented multi-language feature.
I have applied the patch from the issue
Also first configure the SMTP settings for the non-default language.

thanks @rodrigoaguilera

foolfitz’s picture

Me too, after applied # patch, I still can't send mail for other languages, and it shows "Unable to send email. Contact the site administrator if the problem persists."
I use 8.x-1.0-beta2.

overseayalig’s picture

Anyone knows how to fix this on Drupal 7? The Drupal 7 version does not even have this config folder under the folder of the module...

luison’s picture

@r-m-n was right!!

I'm running the beta4 version and still persist the problem.
I had to uninstall the module, install the same module and then go to the non-english configuration (spanish in my case). Configure in spanish and... now it works! in spanish and in english also.

Should be fixed...

luison’s picture

Priority: Normal » Major

@r-m-n was right!!

I'm running the beta4 version and still persist the problem.
I had to uninstall the module, install the same module and then go to the non-english configuration (spanish in my case). Configure in spanish and... now it works! in spanish and in english also.

Should be fixed...

alienzed’s picture

Where exactly is the non-english configuration page for SMTP? How does one get there, I am not finding it!