1 (edited by cloudchemistry 2016-02-19 12:50:18)

Topic: SLOW Mail Receiving & Internal Server Errors

==== Required information ====
- iRedMail version (check /etc/iredmail-release):     v0.9.3
- Linux/BSD distribution name and version: UBUNTU 14
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MYSQL
- Web server (Apache or Nginx): NGINX
- Manage mail accounts with iRedAdmin-Pro? YES
- Related log if you're reporting an issue: N/A
====

Any email we get from an outside source takes forever to hit our inbox. This sucks when password resets (for sites like Facebook, Google, or really whatever else) take forever, and on top of that since I updated my system to the new version of iRedmail & iRedAdmin PRO (v2.3.1), I get Internal Server errors everywhere on the backend (users, preferences, etc.). Please help me get rid of these problems, I spent good money here trying to build an awesome mail server. Thanks. smile

----

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

2

Re: SLOW Mail Receiving & Internal Server Errors

*) Did you upgrade your iRedMail to the latest iRedMail-0.9.4?
*) During upgrading iRedMail to the latest iRedMail-0.9.4, our tutorial mentions how to upgrade iRedAPD to the latest iRedAPD-1.8.0, it ships tool to help you manage greylisting, you can whitelist Facebook, Google, etc to avoid greylisting. Reference: http://www.iredmail.org/docs/manage.iredapd.html
*) About "internal server error" in iRedAdmin-Pro, any related error in uwsgi log file? (/var/log/uwsgi*)

3

Re: SLOW Mail Receiving & Internal Server Errors

1. Yes, I believe I followed the tutorial correctly on updating iRedMail.
2. Yes, I believe I followed the tutorial correctly on updating iRedAPD.
3. The log details are below:

****** START LOG *******
mx.cloudchemistryvapor.com [pid: 7987|app: 0|req: 50/87] 24.229.10.82 () {52 vars in 1275 bytes} [Fri Feb 19 10:13:27 2016] GET /iredadmin => generated 4937 bytes in 300 msecs (HTTP/1.1 200) 1 headers in 121 bytes (3 switches on core 0)
mx.cloudchemistryvapor.com [pid: 7988|app: 0|req: 38/88] 24.229.10.82 () {62 vars in 1597 bytes} [Fri Feb 19 10:13:36 2016] POST /iredadmin/login => generated 0 bytes in 28 msecs (HTTP/1.1 303) 3 headers in 228 bytes (2 switches on core 0)
mx.cloudchemistryvapor.com [pid: 7987|app: 0|req: 51/89] 24.229.10.82 () {56 vars in 1465 bytes} [Fri Feb 19 10:13:37 2016] GET /iredadmin/dashboard/checknew => generated 21031 bytes in 1759 msecs (HTTP/1.1 200) 1 headers in 121 bytes (2 switches on core 0)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process
    return self.handle()
  File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate
    return handle_class(cls)
  File "/usr/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class
    return tocall(*args)
  File "/opt/www/iRedAdmin-Pro-SQL-2.3.1/libs/sqllib/decorators.py", line 26, in proxyfunc
    return func(*args, **kw)
  File "/opt/www/iRedAdmin-Pro-SQL-2.3.1/controllers/sql/user.py", line 237, in GET
    mail=self.mail)
  File "/opt/www/iRedAdmin-Pro-SQL-2.3.1/libs/sqllib/user.py", line 253, in get_user_alias_addresses
    where='alias_to = $mail AND is_alias = 1')
  File "/usr/lib/python2.7/dist-packages/web/db.py", line 682, in select
    return self.query(qout, processed=True)
  File "/usr/lib/python2.7/dist-packages/web/db.py", line 644, in query
    self._db_execute(db_cursor, sql_query)
  File "/usr/lib/python2.7/dist-packages/web/db.py", line 587, in _db_execute
    out = cur.execute(query, params)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'alias_to' in 'where clause'")

mx.cloudchemistryvapor.com [pid: 7988|app: 0|req: 39/90] 24.229.10.82 () {54 vars in 1527 bytes} [Fri Feb 19 10:13:44 2016] GET /iredadmin/profile/user/general/postmaster@cloudchemistryvapor.com => generated 21 bytes in 14 msecs (HTTP/1.1 500) 2 headers in 165 bytes (2 switches on core 0)
****** END LOG *******

Thanks for your help.

4

Re: SLOW Mail Receiving & Internal Server Errors

cloudchemistry wrote:

OperationalError: (1054, "Unknown column 'alias_to' in 'where clause'")

You don't have sql column "alias.alias_to" in "vmail" database. it's mentioned in upgrade tutorial for iRedMail-0.9.3:
http://www.iredmail.org/docs/upgrade.ir … 0.9.3.html (search "alias_to")

5

Re: SLOW Mail Receiving & Internal Server Errors

Ok, so going through the setups again and adding this new column seems to have fixed the internal server errors. Is there a good way to verify how long it takes to receive mail from outside sources?

6

Re: SLOW Mail Receiving & Internal Server Errors

I'm still experiencing extreme delays in receiving emails hmm

7

Re: SLOW Mail Receiving & Internal Server Errors

Any idea how I can diagnose this issue? Thanks.

8

Re: SLOW Mail Receiving & Internal Server Errors

If you're running iRedAPD-1.8.0 (shipped in iRedMail-0.9.4, and mentioned in iRedMail upgrade tutorial), you can check its log file /var/log/iredapd/iredapd.log, it logs how greylisting behaves. Or, you can download the latest greylisting plugin to get more log:
https://bitbucket.org/zhb/iredapd/raw/d … listing.py

*) You can also manage greylisting with /opt/iredapd/tools/greylisting_settings.py.
*) You can also whitelist some sender domains with /opt/iredapd/tools/spf_to_greylist_whitelists.py.

Reference:
http://www.iredmail.org/docs/manage.iredapd.html

9

Re: SLOW Mail Receiving & Internal Server Errors

Thanks. But I still have no idea how to read this log. I see this a bunch of times:

* Query SQL server to get mail domain names.
2016-02-22 13:00:01 INFO * Parsing domains, 36 in total.
2016-02-22 13:00:01 INFO     + [amazon.com]
2016-02-22 13:00:03 INFO     + [aol.com]
2016-02-22 13:00:03 INFO     + [constantcontact.com]
2016-02-22 13:00:05 INFO     + [craigslist.org]
2016-02-22 13:00:05 INFO     + [cust-spf.exacttarget.com]
2016-02-22 13:00:05 INFO     + [ebay.com]
2016-02-22 13:00:09 INFO     + [exacttarget.com]
2016-02-22 13:00:09 INFO     + [facebook.com]
2016-02-22 13:00:09 INFO     + [fbmta.com]
2016-02-22 13:00:09 INFO     + [fishbowl.com]
2016-02-22 13:00:11 INFO     + [github.com]
2016-02-22 13:00:11 INFO     + [gmx.com]
2016-02-22 13:00:11 INFO     + [google.com]
2016-02-22 13:00:11 INFO     + [hotmail.com]
2016-02-22 13:00:11 INFO     + [icloud.com]
2016-02-22 13:00:11 INFO     + [icontact.com]
2016-02-22 13:00:11 INFO     + [inbox.com]
2016-02-22 13:00:11 INFO     + [instagram.com]
2016-02-22 13:00:11 INFO     + [linkedin.com]
2016-02-22 13:00:11 INFO     + [mail.com]
2016-02-22 13:00:12 INFO     + [mailchimp.com]
2016-02-22 13:00:12 INFO     + [mailgun.com]
2016-02-22 13:00:12 INFO     + [mailjet.com]
2016-02-22 13:00:12 INFO     + [microsoft.com]
2016-02-22 13:00:12 INFO     + [outlook.com]
2016-02-22 13:00:12 INFO     + [paypal.com]
2016-02-22 13:00:15 INFO     + [pinterest.com]
2016-02-22 13:00:17 INFO     + [reddit.com]
2016-02-22 13:00:17 INFO     + [sendgrid.com]
2016-02-22 13:00:17 INFO     + [tumblr.com]
2016-02-22 13:00:17 INFO     + [twitter.com]
2016-02-22 13:00:17 INFO     + [yahoo.com]
2016-02-22 13:00:17 INFO     + [yandex.ru]
2016-02-22 13:00:17 INFO     + [zendesk.com]
2016-02-22 13:00:17 INFO     + [zoho.com]

But what does this mean and what is the ultimate fix to stop these sometimes 10-15 minute delays in receiving mail?

10

Re: SLOW Mail Receiving & Internal Server Errors

The delay is caused by greylisting, i suggest you read http://greylisting.org/ for more technical details to understand what it is and how it works.

*) In iRedMail, iRedAPD plugin "/opt/iredapd/plugins/greylisting.py" offers greylisting feature.
*) You can whitelist some domains with /opt/iredapd/tools/spf_to_greylist_whitelists.py. It's configured to run every 10 minutes in root's cron job.
*) You can also disable greylisting if you want. or, just disable greylisting for some local domains. Reference:
http://www.iredmail.org/docs/manage.iredapd.html

11

Re: SLOW Mail Receiving & Internal Server Errors

Greylisting is not enabled in settings.py, so this can't be the cause. Any other ideas?

12

Re: SLOW Mail Receiving & Internal Server Errors

cloudchemistry wrote:

Greylisting is not enabled in settings.py, so this can't be the cause. Any other ideas?

Do you have Cluebringer running? Please show us output of commands below:

postconf smtpd_recipient_restrictions
postconf smtpd_end_of_data_restrictions

Also, you have to check maillog to figure out what exactly caused this delay.