0

So im running ISPconfig with Dovecot as mail-server (storing mails via mysql). Yesterday i made some changes to the mysql-config. I wanted the server to answer also External Requests.

The Problem is, with "bind-address" activated to the external server-ip, Dovecot couldnt connect to Mysql as localhost anymore.

"postfix/smtpd[726]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111)"

I found out that commenting out "skip-external-locking" would have been enough. So i changed the mysql-config back to listen on every ip.

But i noticed, in the time where Dovecot couldnt connect to Mysql, of course no mails have been stored.

So my Question is if there is any way to reconstruct them. I mean are they stored anywhere as plain-text file, while the mysql-server is "down", or is there any kind of queue? Or are those Mails simply gone forever?!

Thanks

Daniel
  • 51
  • 1
  • 1
  • 7
  • What mail are you referring to? – Michael Hampton Jan 18 '15 at 17:44
  • mails of the ispconfig clients. – Daniel Jan 18 '15 at 17:53
  • That is not clear. Are you trying to say your whole database disappeared? – Michael Hampton Jan 18 '15 at 18:08
  • I ment to say that during the time i had a bogus mysql-config, the smtpd service couldnt connect to the database. So in this timeframe my ispconfig clients couldnt recieve any mails. is there any backup for this mails, when they couldnt be stored to mysql and so weren't delivered to my clients? – Daniel Jan 18 '15 at 18:14
  • Did you drop the emails then? – Michael Hampton Jan 18 '15 at 18:22
  • Well the thing is, actually i dont know what happend to those mails. I just know that while smtpd had no connection to mysql, no mails were delivered to my clients. Actually that was part my question. What happens to such mails and how can i restore or access them? – Daniel Jan 18 '15 at 18:25
  • Why haven't you checked your logs, then? – Michael Hampton Jan 18 '15 at 18:31
  • [Administration panels are off topic](http://serverfault.com/help/on-topic). [Even the presence of an administration panel on a system,](http://meta.serverfault.com/q/6538/118258) because they [take over the systems in strange and non-standard ways, making it difficult or even impossible for actual system administrators to manage the servers normally](http://meta.serverfault.com/a/3924/118258), and tend to indicate low-quality questions from *users* with insufficient knowledge for this site. – HopelessN00b Apr 01 '15 at 18:52

1 Answers1

1

If your smtp server (ISPConfig seems to use postfix) wasn't able to accept those mails (i.e., if it needs the mysql connection to store them), it will have answered the requests from the foreign mail servers with an error - you should check your mail server logs as already suggested. In this case the sending mail servers should retry after a while (depending on configuration, probably 4 h).

If the mail has been accepted, then the local delivery agent should have stored it somewhere (probably /var/spool/postfix/incoming). In this case, the mails will be passed on to mysql soon after restoring the connection to mysql.


The log shows, that the mail from the sending server has been rejected with error code 451. This means, the sending server will try again sending this mail after a configured delay.

nlu
  • 661
  • 5
  • 9
  • yes. exactly this was happening. in my logs i can see it was attempted to deliver multiple times, but always ends with "Client host rejected: Server configuration error;" and after some time the retry just stopped. so i guess those mails were not accepted and nowhere on my local drive? – Daniel Jan 18 '15 at 19:43
  • base error is always "proxy:mysql:/etc/postfix/mysql-virtual_domains.cf: table lookup problem" – Daniel Jan 18 '15 at 19:44
  • could you please post the complete log for one of the rejected emails? – nlu Jan 18 '15 at 21:51
  • http://pastebin.com/E5D3jmud – Daniel Jan 19 '15 at 04:25
  • I thought you solved the problem with mysql not being reachable? Meanwhile the mails that were rejected should have been resent. – nlu Jan 20 '15 at 21:08
  • yes the problem is fixed now, and new mails coming in, but not all of the ones during the downtime were sent. some (very little) but yea.next time im checking ispconfig's monitoring page, after i made changes to services. sadly it does not support mail-notification. and thanks for your help :) – Daniel Jan 21 '15 at 02:58