# Bug - Email configuration (Closed)

**URL:** https://discussions.eramba.org/t/bug-email-configuration-closed/110
**Category:** Forum - Software
**Created:** [January 25, 2017, 4:26pm UTC](https://discussions.eramba.org/t/bug-email-configuration-closed/110 "2017-01-25T16:26:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jonas.von.scholten](https://discussions.eramba.org/user_avatar/discussions.eramba.org/jonas.von.scholten/32/349_2.png) [@jonas.von.scholten](https://discussions.eramba.org/u/jonas.von.scholten)
#### Post date: [January 25, 2017, 4:26pm UTC](https://discussions.eramba.org/t/bug-email-configuration-closed/110/1 "2017-01-25T16:26:01Z")

</div>

The ~/app/Network/Email/ErambaCakeEmail.php contains an error.

The following clause does not allow for default SMTP relay (unauthorized):

```
    if ($settings['SMTP_USE'] == 1) {
        $emailConfig['transport'] = 'Smtp';
        $emailConfig['host'] = $settings['SMTP_HOST'];
        $emailConfig['username'] = $settings['SMTP_USER'];
        $emailConfig['password'] = $settings['SMTP_PWD'];
        $emailConfig['timeout'] = $settings['SMTP_TIMEOUT'];
        $emailConfig['port'] = $settings['SMTP_PORT'];

        if ($settings['USE_SSL'] == Setting::USE_SSL_SSL) {
            $host = 'ssl://' . $emailConfig['host'];
            $emailConfig['host'] = $host;
        }

        if ($settings['USE_SSL'] == Setting::USE_SSL_TLS) {
            $emailConfig['tls'] = true;
        }
    }

```

Please insert this extra if-clause or similar (after the last update the mail feature broke):

```
    if ($settings['SMTP_USE'] == 1) {
        $emailConfig['transport'] = 'Smtp';
        $emailConfig['host'] = $settings['SMTP_HOST'];

```

> ```
> if($settings['USE_SSL'] != 0){
> $emailConfig['username'] = $settings['SMTP_USER'];
> $emailConfig['password'] = $settings['SMTP_PWD'];
> }
> 
> ```

```
        $emailConfig['timeout'] = $settings['SMTP_TIMEOUT'];
        $emailConfig['port'] = $settings['SMTP_PORT'];

        if ($settings['USE_SSL'] == Setting::USE_SSL_SSL) {
            $host = 'ssl://' . $emailConfig['host'];
            $emailConfig['host'] = $host;
        }

        if ($settings['USE_SSL'] == Setting::USE_SSL_TLS) {
            $emailConfig['tls'] = true;
        }
    }

```

---

<div class="post-metadata">

### Author: ![kisero](https://discussions.eramba.org/user_avatar/discussions.eramba.org/kisero/32/2925_2.png) [@kisero](https://discussions.eramba.org/u/kisero)
#### Post date: [January 25, 2017, 5:08pm UTC](https://discussions.eramba.org/t/bug-email-configuration-closed/110/2 "2017-01-25T17:08:30Z")

</div>

> [@jonas.von.scholten](#):
>
> default SMTP relay (unauthorized)

Hi Jonas,

What you mean by “default SMTP relay (unauthorized)” ?

thanks

---

<div class="post-metadata">

### Author: ![martin](https://discussions.eramba.org/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@martin](https://discussions.eramba.org/u/martin)
#### Post date: [January 25, 2017, 5:50pm UTC](https://discussions.eramba.org/t/bug-email-configuration-closed/110/3 "2017-01-25T17:50:02Z")

</div>

Hello,

As I understand now, you are trying to use a SMTP server that does not require authentication at all.

after some digging i understand what is the problem in your case, your snippet of code confused me for a moment because it would force unauthorized login for all servers not using encryption to connect. Its clear at the moment and we will provide a fix for this case on our next update.

Thanks for reporting,  
Martin

---

<div class="post-metadata">

### Author: ![jonas.von.scholten](https://discussions.eramba.org/user_avatar/discussions.eramba.org/jonas.von.scholten/32/349_2.png) [@jonas.von.scholten](https://discussions.eramba.org/u/jonas.von.scholten)
#### Post date: [January 25, 2017, 7:30pm UTC](https://discussions.eramba.org/t/bug-email-configuration-closed/110/4 "2017-01-25T19:30:15Z")

</div>

Yes… My fix is not really a fix…

The fix should be something like (PseudoCode):  
If ($setting[SMTP\_UserName] != Null) {  
SetUsernameAndPassword();

}

That way you can leave the username/password empty or still use basic authentication on port 25(not possible with my fix)

---

<div class="post-metadata">

### Author: ![kisero](https://discussions.eramba.org/user_avatar/discussions.eramba.org/kisero/32/2925_2.png) [@kisero](https://discussions.eramba.org/u/kisero)
#### Post date: [January 26, 2017, 8:54am UTC](https://discussions.eramba.org/t/bug-email-configuration-closed/110/5 "2017-01-26T08:54:52Z")

</div>

Hi jonas,

[https://github.com/kisero/eramba\_v2/issues/454](https://github.com/kisero/eramba_v2/issues/454)

there we go - the compliance pdf you asked me the other day is also in this package!

regards
