# Bug OP-10392 - SMTP setting issues in packager installation

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-10392

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module |  |
| Target versions | 12.1.2 |
| Observed in versions | 12.1.0 |
| Sprint | 12.1.2 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 12.1.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### **Environment**:

Your OpenProject Version: EoP 12.1.0 / 12.1.1

Operating System / Browser / OpenProject language:

Ubuntu 20.04 LTS / Chromium / English

  

### In Rare Cases

After an Upgrade to OpenProject 12.1.0 or 12.1.1 the new structure for Settings Definitions causes trouble in the smtp settings for OpenProject.

  

### Background

The Settings for SMTP are stored in 3 locations:

*   inside the file `/etc/openproject/installer.dat`
*   inside the file `/etc/openproject/conf.d/smtp`
*   inside the PSQL database (see C. below)

  

### Workaround

####   

#### A. Edit the installer.dat file

  

`sudo vi /etc/openproject/installer.dat`

*   delete all lines that start with `smtp/`
*   add one line instead that looks like `smtp/autoinstall skip`

####   

#### B. Rename the configuration file for smtp

  

`sudo mv /etc/openproject/conf.d/smtp /etc/openproject/conf.d/smtp.invalid`

####   

#### C. Read the SMTP settings from the database

  

```bash
sudo psql $(sudo openproject config:get DATABASE_URL) -c "select * from settings where name like 'smtp_%'"

id |           name            | value |         updated_at         
----+---------------------------+-------+----------------------------
  7 | smtp_enable_starttls_auto | 0     | 2022-05-05 10:46:33.615209
  8 | smtp_ssl                  | 0     | 2022-05-05 10:46:33.622529
  9 | smtp_address              | bar   | 2022-05-06 10:09:54.600924
 10 | smtp_port                 | 25    | 2022-05-05 10:47:07.091567
 11 | smtp_domain               |       | 2022-05-05 10:47:07.103318
 12 | smtp_authentication       | login | 2022-05-05 10:47:07.115532
 13 | smtp_user_name            |       | 2022-05-05 10:47:07.126924
 14 | smtp_password             |       | 2022-05-05 10:47:07.137872
  6 | smtp_openssl_verify_mode  |       | 2022-05-05 10:47:07.159798
```

####   

#### D. Run the openproject reconfiguration wizard

####   
`sudo openproject reconfigure`

  

*   If you need help how to use the wizard, a detailed documentation is located here: [https://www.openproject.org/docs/installation-and-operations/installation/packaged/#step-0-start-the-wizard](https://www.openproject.org/docs/installation-and-operations/installation/packaged/#step-0-start-the-wizard)
*   Inside the Wizard at Step 5 SMTP use the settings from Point C. above
*   After Finishing the Wizard, OpenProject Outgoing Emails should work again.

  

### APPENDIX: Removing Database Entries (for advanced users only)

*   If you like to remove SMTP variables from the database which is not necessary in all cases in this bug report, you may also use the `config:unset` commands on the rails console:

```bash
sudo openproject run env | grep SMTP

SMTP_URL=smtp://user:password@localhost:25/localhost
SMTP_DOMAIN=localhost
SMTP_PORT=25
SMTP_USERNAME=user
SMTP_AUTHENTICATION=login
SMTP_PASSWORD=password

openproject config:unset SMTP_HOST
openproject config:unset SMTP_DOMAIN
openproject config:unset SMTP_PORT
openproject config:unset SMTP_USERNAME
openproject config:unset SMTP_AUTHENTICATION
openproject config:unset SMTP_PASSWORD
```
