1 (edited by gaudec 2015-06-21 08:09:54)

Topic: Updated to Ubuntu 14.04, mail stopped working

==== Required information ====
- iRedMail version: 0.9.2
- Store mail accounts in MySQL
- Web server: Apache
- Linux/BSD distribution name and version: Ubuntu 14.04
- Related log if you're reporting an issue: ?
====

Today I updated Ubuntu from 12.04 to 14.04 to get a more recent PHP version. E-mail stopped working.

When I try to send mail from Thunderbird it says "The mail server responded: 4.3.5 Server configuration problem".

When I click "Get Messages" it seems to validate the password correctly, but no new e-mails arrive (I can see some new e-mails in the logs).

I'm no expert, so I don't know where to look. I haven't seen any obvious errors in the logs, and I see amavisd, dovecot, lmtp, clamd and smtpd running.

Where can I start debugging this?

Update:

iredapd.log shows e-mails arriving like this:

DATE TIME INFO [IP] RCPT, FROM -> TO, DUNNO

dovecot.log shows me checking the e-mail:

DATE TIME pop3-login: Info: Login: user=<mymail@domain.com>, method=PLAIN, rip=XX.XX.XX.XX, lip=XX.XX.XX.XX, mpid=57XX, TLS, session=<.....>
DATE TIME pop3(mymail@domain.com): Info: Disconnected: Logged out top=0/0, retr=0/0, del=0/1, size=344552

dovecot-sieve.log shows:

... saved mail to INBOX

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Updated to Ubuntu 14.04, mail stopped working

I found out that the iptables rules had been reset. After fixing that I get

Jun 21 02:48:45 auth-worker(6224): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL server on '127.0.0.1' (4) - waiting for 125 seconds before retry

I tried using the mysql credentials found in /etc/postfix/mysql/*.cf to log into mysql and it works fine, so I don't know why it can't log in.

3

Re: Updated to Ubuntu 14.04, mail stopped working

Check /etc/dovecot/dovecot-mysql.conf, do you have correct SQL credential?

4

Re: Updated to Ubuntu 14.04, mail stopped working

Yes, the credentials seem to work when copied and used in the terminal. I noticed though that the permissions are 770 root:root. Might that be the reason?

drwxr-xr-x   2 root    root     4096 Jun 20 21:59 conf.d
-rw-rw-r--   1 root    root     9540 Jun 19 02:13 dovecot.conf
-rw-r--r--   1 root    root     3795 Oct 20  2014 dovecot.conf.2014.10.20.13.40.28
-rw-r--r--   1 root    root     4401 May 14  2014 dovecot.conf.ucf-dist
-rw-r-----   1 root    dovecot   410 May 14  2014 dovecot-db.conf.ext
-rw-r-----   1 root    dovecot   852 May 14  2014 dovecot-dict-sql.conf.ext
-r-x------   1 dovecot dovecot     0 Oct 20  2014 dovecot-master-users-password
-r-xr-x---   1 root    root      749 Oct 20  2014 dovecot-mysql.conf
lrwxrwxrwx   1 root    root       26 Jun 20 21:59 dovecot.pem -> /etc/ssl/certs/dovecot.pem
-r-x------   1 dovecot dovecot   505 Oct 20  2014 dovecot-share-folder.conf
-rw-r-----   1 root    dovecot  5447 May 14  2014 dovecot-sql.conf.ext
-r-x------   1 dovecot dovecot   334 Oct 20  2014 dovecot-used-quota.conf
drwx------   2 root    root     4096 Jun 20 21:59 private
-rw-r--r--   1 root    root      121 May 14  2014 README

5

Re: Updated to Ubuntu 14.04, mail stopped working

Any error in Postfix log file (/var/log/mail.log)?

6

Re: Updated to Ubuntu 14.04, mail stopped working

ZhangHuangbin wrote:

Any error in Postfix log file (/var/log/mail.log)?

No, mail.log has not been updated in 6 hours.

Updated logs during the last hour: dovecot.log, mysql.log (empty), iredapd.log, fail2ban.log, dovecot-sieve.log (empty), dovecot-lmtp.log (empty).

Thanks for the help! I'll continue in the morning (I'm sick and it's 4am).

7

Re: Updated to Ubuntu 14.04, mail stopped working

Restart syslog (first) and postfix services, then check whether or not Postfix correctly logs info in /var/log/mail.log.
Looks like there's something wrong in syslog config file.

8

Re: Updated to Ubuntu 14.04, mail stopped working

I couldn't find a "syslog" service. I read here that it was deleted for someone when upgrading to 14.04. I then installed rsyslog.

dovecot.log
Jun 21 11:39:35 auth-worker(11356): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL server on '127.0.0.1' (4) - waiting for 25 seconds before retry
Jun 21 11:40:05 auth-worker(11356): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL server on '127.0.0.1' (4) - waiting for 125 seconds before retry

mail.log
Jun 21 11:42:46 theserver postfix/trivial-rewrite[11295]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem
Jun 21 11:42:46 theserver postfix/trivial-rewrite[11295]: warning: virtual_mailbox_domains lookup failure
Jun 21 11:42:46 theserver postfix/trivial-rewrite[11295]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem
Jun 21 11:42:46 theserver postfix/trivial-rewrite[11295]: warning: virtual_mailbox_domains lookup failure
Jun 21 11:42:46 theserver postfix/smtpd[11403]: NOQUEUE: reject: RCPT from mail-ig0-f176.google.com[209.85.213.176]: 451 4.3.0 <hijk+caf_=obo=hijk.com@gmail.com>: Temporary lookup failure; from=<hijk+caf_=obo=hijk.com@gmail.com> to=<obo@hijk$.com> proto=ESMTP helo=<mail-ig0-f176.google.com>
Jun 21 11:42:46 theserver postfix/smtpd[11358]: disconnect from mail-lb0-f189.google.com[209.85.217.189]
Jun 21 11:42:46 theserver postfix/smtpd[11403]: disconnect from mail-ig0-f176.google.com[209.85.213.176]

syslog right after installing rsyslog
Jun 21 11:28:59 theserver rsyslogd: [origin software="rsyslogd" swVersion="7.4.4" x-pid="11218" x-info="http://www.rsyslog.com"] start
Jun 21 11:28:59 theserver rsyslogd: rsyslogd's groupid changed to 106
Jun 21 11:28:59 theserver rsyslogd: rsyslogd's userid changed to 102
Jun 21 11:28:59 theserver rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
Jun 21 11:28:59 theserver rsyslogd-2039: Could no open output pipe '/dev/xconsole': No such file or directory [try http://www.rsyslog.com/e/2039 ]
Jun 21 11:29:09 theserver postfix/smtpd[11229]: connect from mail3.nyi.meetup.com[64.90.170.33]
Jun 21 11:29:43 theserver postfix/proxymap[10146]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (110)
Jun 21 11:29:43 theserver postfix/trivial-rewrite[10109]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem
Jun 21 11:29:43 theserver postfix/trivial-rewrite[10109]: warning: virtual_mailbox_domains lookup failure
Jun 21 11:29:43 theserver postfix/smtpd[10195]: NOQUEUE: reject: RCPT from mail-la0-f44.google.com[209.85.215.44]: 451 4.3.0 <****@gmail.com>: Temporary lookup failure; from=<***@gmail.com> to=<***@***.com> proto=ESMTP helo=<mail-la0-f44.google.com>
Jun 21 11:29:43 theserver postfix/smtpd[10195]: disconnect from mail-la0-f44.google.com[209.85.215.44]
Jun 21 11:29:59 theserver postfix/proxymap[10214]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (110)
Jun 21 11:29:59 theserver postfix/trivial-rewrite[10229]: warning: proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf lookup error for "*"
Jun 21 11:30:01 theserver CRON[11250]: (www-data) CMD ([ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh)
Jun 21 11:30:46 theserver postfix/proxymap[10239]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (110)
Jun 21 11:30:46 theserver postfix/trivial-rewrite[10109]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem
Jun 21 11:30:46 theserver postfix/trivial-rewrite[10109]: warning: virtual_mailbox_domains lookup failure
Jun 21 11:30:46 theserver postfix/trivial-rewrite[10109]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem

9 (edited by gaudec 2015-06-21 19:25:52)

Re: Updated to Ubuntu 14.04, mail stopped working

I think this might be related: in mysql:

mysql> show grants for 'vmail'@'localhost';
+--------------------------------------------------------------------------------------------------------------+
| Grants for vmail@localhost                                                                                   |
+--------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'vmail'@'localhost' IDENTIFIED BY PASSWORD '****...****' |
| GRANT SELECT ON `vmail`.* TO 'vmail'@'localhost'                                                             |
+--------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> show grants for 'vmail'@'127.0.0.1';
ERROR 1141 (42000): There is no such grant defined for user 'vmail' on host '127.0.0.1'

I found posts online that fixed issues by replacing 127.0.0.1 with localhost, or the other way around. But I'm not sure what to try: add new grants, edit .cf files, change mysql config to use localhost instead of 127.0.0.1? Or will non of these help?

Update: changing 127.0.0.1 for localhost in the .cf files did have any effect.

10

Re: Updated to Ubuntu 14.04, mail stopped working

After reading about 100 posts about every possible e-mail server problem, and trying all kinds of changes, I focused on the number 10031, found in mail.log (postfix/smtpd: warning: problem talking to server 127.0.0.1:10031: Connection refused".

I assumed it was cluebringer's port. Cluebringer is no longer available in Ubuntu 14.04. I searched for references to that number and found two in postfix/main.cf. I commented out the two "check_policy_service inet:127.0.0.1:10031" and now I can send and receive e-mails.

Is that the right solution?

11

Re: Updated to Ubuntu 14.04, mail stopped working

Cluebringer is available in Ubuntu 14.04. You can try to restart it.

12

Re: Updated to Ubuntu 14.04, mail stopped working

Ah really! It was uninstalled when updating. I'll try to put it back. Thanks!