Author Topic: Email Issue - 454 4.7.1 Relay access denied AND 111 Can't open SMTP stream  (Read 7032 times)

colifato

  • Newbie
  • *
  • Posts: 47
    • View Profile
After the upgrade ultiuma FORCE EHCP I have the problem that emails are not going away.
Moreover, when given in error, and puts as blocked by fail2ban .
What are the steps to resolve this problem?

I get this error when trying to send email:

Quote
454 4.7.1 Relay access denied

Then, I got this error too:

Quote
111 Can't open SMTP stream.

::EDIT::

Fix is here:   http://ehcpforce.tk/forums/index.php?topic=60.msg256#msg256
« Last Edit: May 16, 2016, 10:23:54 pm by earnolmartin »

earnolmartin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
    • View Profile
Re: Problem after update
« Reply #1 on: May 12, 2016, 08:40:59 pm »
Please post logs.  Is PolicyD / SpamAssassin / AmavisD installed?

colifato

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Problem after update
« Reply #2 on: May 13, 2016, 07:49:02 am »
The error is SASL LOGIN authentication failed: authentication failure

earnolmartin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
    • View Profile
Re: Problem after update
« Reply #3 on: May 14, 2016, 12:15:59 am »
Is the courier-authdaemon service running?  When are you getting that error?  Any relevant entries in /var/log/auth.log?

Please list the steps you're performing to trigger this error.  Are you trying to send email from SquirrelMail or are you having issues accessing an email account via POP3?  I need more information.  There could be an issue somewhere in a scenario I haven't thought of since Ubuntu 16.04 required changes to SASL authentication since libpam-mysql no longer works.

Also, are you running Ubuntu 16.04?

Please let me know.

colifato

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Problem after update
« Reply #4 on: May 14, 2016, 07:53:17 am »
I'm using Ubuntu Server 14.04 LTS.
When i try to send using Squirrelmail i see this error:
May 14 10:46:05 server1 postfix/smtpd[22144]: connect from localhost[::1]
May 14 10:46:05 server1 postfix/smtpd[22144]: NOQUEUE: reject: RCPT from localhost[::1]: 454 4.7.1 <xxxx@gmail.com>: Relay access denied; from=<xxxx@xxxxxx.com.ar> to=<xxxxx@gmail.com> proto=ESMTP helo=<webmail.xxxxx.com.ar>
May 14 10:46:05 server1 postfix/smtpd[22144]: lost connection after RCPT from localhost[::1]
May 14 10:46:05 server1 postfix/smtpd[22144]: disconnect from localhost[::1]

And /var/log/auth.log show:
May 14 10:50:02 server1 postfix/smtpd[2913]: sql_select option missing
May 14 10:50:02 server1 postfix/smtpd[2913]: auxpropfunc error no mechanism available
May 14 10:50:02 server1 postfix/smtpd[2913]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql

Via pop3 or using webmail i have error.

I need update to Ubuntu Server 16.04 lts?

Greets

earnolmartin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
    • View Profile
Re: Problem after update
« Reply #5 on: May 14, 2016, 03:04:44 pm »
No, you don't need to upgrade to Ubuntu 16.04.

Are you using a relay?  For some reason, it is denying you access.  Try disabling ipv6 as well in postfix?

colifato

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Problem after update
« Reply #6 on: May 14, 2016, 03:23:57 pm »
Another error:
May 14 18:18:44 server1 saslauthd[2450]: pam_mysql - MySQL error (Can't connect to MySQL server on '127.0.0.1' (111))
May 14 18:18:44 server1 saslauthd[2450]: DEBUG: auth_pam: pam_authenticate failed: Authentication service cannot retrieve authentication info
May 14 18:18:44 server1 saslauthd[2450]: do_auth         : auth failure: [user=martin@xxxxx.com.ar] [service=smtp] [realm=xxxxx.com.ar] [mech=pam] [reason=PAM auth error]
May 14 18:18:46 server1 saslauthd[2452]: pam_mysql - MySQL error (Can't connect to MySQL server on '127.0.0.1' (111))
May 14 18:18:46 server1 saslauthd[2452]: DEBUG: auth_pam: pam_authenticate failed: Authentication service cannot retrieve authentication info
May 14 18:18:46 server1 saslauthd[2452]: do_auth         : auth failure: [user=martin@www.xxxxx.com.ar] [service=smtp] [realm=www.xxxxx.com.ar] [mech=pam] [reason=PAM auth error]


I'm not using relay

earnolmartin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
    • View Profile
Re: Problem after update
« Reply #7 on: May 14, 2016, 10:14:59 pm »
Ok, so it looks like your MySQL server is down.  Check its status and logs?  Can you connect to any MySQL database?  Are you using MariaDB or MySQL?

colifato

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Problem after update
« Reply #8 on: May 15, 2016, 07:59:05 am »
MMMMMMM... in the update, ask me if i want change to MariaDB
:(
I say yes :D

earnolmartin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
    • View Profile
Re: Problem after update
« Reply #9 on: May 15, 2016, 03:07:48 pm »
Can you connect to any databases via PHPMyAdmin?

Have you restarted the server after applying the update?

Have you checked to see that the mysql service is running?  Have you checked mysql logs?  MariaDB is a direct drop-in, so it should have just worked.

Let me know.

colifato

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Problem after update
« Reply #10 on: May 15, 2016, 06:54:24 pm »
Mysql is running:
mysql     5679  3.3  8.0 566724 248296 ?       Ssl  may14  67:52 /usr/sbin/mysqld
root     24163  0.0  0.0  14320   936 pts/0    D+   21:43   0:00 grep --color=auto mysql

I can connect with the user ehcp and with the other users that i have.. all ok
I have restarted the server 5 or 6 times

I continue receiving this message when i try send a test mail:
warning: mail-yw0-f169.google.com[209.85.161.169]: SASL PLAIN authentication failed: authentication failure


earnolmartin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
    • View Profile
Re: Problem after update
« Reply #11 on: May 15, 2016, 11:08:05 pm »
Did you make sure your server's IP network is included in the postfix configuration under the mynetworks section?

I have no idea what's going on with your server nor if the upgrade script is at fault.

Can you give me SSH access so that I can take a look? 

colifato

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Problem after update
« Reply #12 on: May 16, 2016, 04:16:09 am »
Check your private message

colifato

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Problem after update
« Reply #13 on: May 16, 2016, 02:19:37 pm »
Have you read my PM ?

earnolmartin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
    • View Profile
Re: Problem after update
« Reply #14 on: May 16, 2016, 10:17:41 pm »
Yes, I just fixed your problem.  I may edit the update / upgrade script in the future, but this problem happens only occasionally.  I have run into it before (doesn't usually happen), and only on a few servers running EHCP.

If you run into a problem like this, the first thing to do is disable ipv6 support in postfix like so:

Code: [Select]
sudo cp /etc/postfix/main.cf /etc/postfix/main.cf.bkup
sudo nano /etc/postfix/main.cf


Find:

Code: [Select]
inet_interfaces = (ANY_SETTING)

Replace with:

Code: [Select]
inet_interfaces = ipv4

Save and exit.

Then, run the Squirrel Mail configuration utility.

Code: [Select]
/var/www/new/ehcp/webmail/config/conf.pl

Enter 2 to edit the server settings.

Enter 3 and change the setting to Sendmail.

Enter 1 to change your domain name for the server.

Enter S to save changes.

Enter Q to quit.

I tested sending an email from RoundCube and SquirrelMail.  Doing the above fixed your issue.