1

Topic: DBMail Integration

- iRedMail version: 0.7.2
- Linux/BSD distribution name and version: Centos 5.6

Hi Zhang,

I have integrated DBMail with iredmail with help of the integration article.

I there possibility to control DBMail users in iredmail Control panel.

Regards,

Mohan

----

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

2

Re: DBMail Integration

Try separated DBMailAdmin here: http://dbmailadmin.org/
It's an iRedMail sub-project. smile

3

Re: DBMail Integration

Hi Zhang,


I have configured DBMailadmin, with the article you have suggested.

I am getting error while accessing dbmailadmin in browser.

I have pasted the error log message below kindly advice

AttributeError: 'general'
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1] mod_wsgi (pid=1719): Target WSGI script '/var/www/dbmailadmin/dbmailadmin.py' cannot be loaded as Python module.
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1] mod_wsgi (pid=1719): Exception occurred processing WSGI script '/var/www/dbmailadmin/dbmailadmin.py'.
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1] Traceback (most recent call last):
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1]   File "/var/www/dbmailadmin/dbmailadmin.py", line 8, in ?
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1]     from libs import iredbase
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1]   File "libs/iredbase.py", line 34, in ?
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1]   File "/usr/lib/python2.4/site-packages/web/utils.py", line 76, in __getattr__
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1]     raise AttributeError, k
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1] AttributeError: 'general'


Thanks,

Regards,
Mohan

4

Re: DBMail Integration

mohan wrote:

[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1]     raise AttributeError, k
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1] AttributeError: 'general'

File owner or permission of DBMailAdmin config file "settings.ini" is incorrect. Please make sure owner is "dbmailadmin:dbmailadmin", file permission is 0400.

5

Re: DBMail Integration

ZhangHuangbin wrote:
mohan wrote:

[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1]     raise AttributeError, k
[Sat Dec 17 13:16:33 2011] [error] [client 127.0.0.1] AttributeError: 'general'

File owner or permission of DBMailAdmin config file "settings.ini" is incorrect. Please make sure owner is "dbmailadmin:dbmailadmin", file permission is 0400.


Hi Zhang,

The permission and ownership of the file settings.ini file is 0400 and dbmailadmin.

kindly advice.

Regards,
Mohan

6

Re: DBMail Integration

Did you restart Apache after changing file permission and owner?

If same error occurs after restarted Apache, please post output of below command:

# ls -l settings.ini

Also, paste whole content of file settings.ini, don't forget to remove passwords before posting.

7

Re: DBMail Integration

Hi Zhang,

I have restarted apache after chaning file permission and ownership.

In the dbmailadmin installation article it is mentioned to set like this in /etc/httpd/conf.d/ssl.conf

WSGIScriptAlias /dbmailadmin /var/www/iredadmin/dbmailadmin.py/
Alias /dbmailadmin/static /var/www/dbmailadmin/static/

is this /var/www/iredadmin/dbmailadmin.py or /var/www/dbmailadmin/dbmailadmin.py kindly suggest.

I am pasting the output of : ls -l settings.ini

-r-------- 1 dbmailadmin dbmailadmin 3108 Dec 19 11:30 settings.ini

contents in settings.ini file:

[general]
# Site webmaster's mail address.
#webmaster = zhb@iredmail.org

# Debug mode: True, False.
# Warning: Do *NOT* enable debug in product server.
debug = True

# Mail detail message of '500 internal server error' to webmaster: True, False.
# If set to True, iredadmin will mail detail error to webmaster when
# it catches 'internal server error' via LOCAL mail server to aid
# in debugging production servers.
mail_error_to_webmaster = False

# Default language.
lang = en_US

# Database backend: dbmail_mysql.
backend = dbmail_mysql

# Min/Max admin password length.
#   - min_passwd_length: 0 means unlimited, but at least 1 character
#                        is required.
#   - max_passwd_length: 0 means unlimited.
# User password length is controlled in domain profile.
min_passwd_length = 0
max_passwd_length = 0

[dbmailadmin]
# Database used to store iRedAdmin data. e.g. sessions, log.
host = 127.0.0.1
port = 3306
db = dbmailadmin
user = dbmailadmin
passwd = *********

############################################
# Database used to store mail accounts.
#
[dbmail]
host = 127.0.0.1
port = 3306
db = dbmail
user = dbmail
passwd = **********

#################################################################
# Settings used for Policyd (1.8.x) integration. Provides global
# white-/blacklist, sender/recipient throttling, etc.
#
[policyd]

# Enable policyd integration: True, False.
enabled = False

# SQL Database used to store policyd data, eg. whitelist, blacklist.
# You can find related information in policyd config files:
#   - On RHEL/CentOS:   /etc/policyd.conf
#   - On Debian/Ubuntu: /etc/postfix-policyd.conf
#   - On FreeBSD:       /usr/local/etc/policyd.conf
# Related parameters:
#   host    -> MYSQLHOST
#   port    -> 3306 (Default)
#   db      -> MYSQLDBASE
#   user    -> MYSQLUSER
#   passwd  -> MYSQLPASS
host = 127.0.0.1
port = 3306
db = policyd
user = policyd
passwd = passwd

##############################################################################
# Settings used for Amavisd-new integration. Provides spam/virus quaranting,
# releasing, etc.
#
[amavisd]

########### Logging into SQL (@storage_sql_dsn) ##########
# Logging into SQL: True, False.
# Log info of incoming/outgoing emails into SQL.
# It's @storage_sql_dsn setting in amavisd. You can find this setting
# in amavisd-new config files:
#   - On RHEL/CentOS:   /etc/amavisd.conf
#   - On Debian/Ubuntu: /etc/amavis/conf.d/50-user.conf
#   - On FreeBSD:       /usr/local/etc/amavisd.conf
# Reference:
# http://www.iredmail.org/wiki/index.php? … in.Amavisd
logging_into_sql = False

host = 127.0.0.1
port = 3306
db = amavisd
user = amavisd
passwd = passwd

# #### Quarantining ####
# Release quarantined SPAM/Virus mails: True, False.
# iRedAdmin-Pro will connect to @quarantine_server to release quarantined mails.
# How to enable quarantining in Amavisd-new:
# http://www.iredmail.org/wiki/index.php? … ining.SPAM
quarantine = False

# Amavisd server address.
server = 127.0.0.1

# Port of 'AM.PDP-INET'. Default is 9998.
quarantine_port = 9998


Thanks,
Regards,
Mohan

8

Re: DBMail Integration

mohan wrote:

is this /var/www/iredadmin/dbmailadmin.py or /var/www/dbmailadmin/dbmailadmin.py kindly suggest.

It's /var/www/dbmailadmin/dbmailadmin.py, sorry about this typo error.

mohan wrote:

[general]
# Site webmaster's mail address.
#webmaster = zhb_at_iredmail.org

Please do NOT comment out this setting, just replace "zhb@xxx" by your email address, then restarting Apache. For example:

webmaster = mohan@example.com

9

Re: DBMail Integration

ZhangHuangbin wrote:
mohan wrote:

is this /var/www/iredadmin/dbmailadmin.py or /var/www/dbmailadmin/dbmailadmin.py kindly suggest.

It's /var/www/dbmailadmin/dbmailadmin.py, sorry about this typo error.

mohan wrote:

[general]
# Site webmaster's mail address.
#webmaster = zhb_at_iredmail.org

Please do NOT comment out this setting, just replace "zhb@xxx" by your email address, then restarting Apache. For example:

webmaster = mohan@example.com


Hi Zhang,

I have given webmaster=test@mydomain.com

I am not able to access https://localhost/dbmailadmin

I have pasted the error message for your reference:

[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1] mod_wsgi (pid=3642): Target WSGI script '/var/www/dbmailadmin/dbmailadmin.py' cannot be loaded as Python module.
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1] mod_wsgi (pid=3642): Exception occurred processing WSGI script '/var/www/dbmailadmin/dbmailadmin.py'.
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1] Traceback (most recent call last):
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]   File "/var/www/dbmailadmin/dbmailadmin.py", line 8, in ?
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]     from libs import iredbase
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]   File "libs/iredbase.py", line 34, in ?
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]   File "/usr/lib/python2.4/site-packages/web/utils.py", line 76, in __getattr__
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]     raise AttributeError, k
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1] AttributeError: 'general'

Thanks,
Regards,
Mohan

10

Re: DBMail Integration

Hi Zhang,

I have given webmaster=test@mydomain.com

I am not able to access https://localhost/dbmailadmin

I have pasted the error message for your reference:

[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1] mod_wsgi (pid=3642): Target WSGI script '/var/www/dbmailadmin/dbmailadmin.py' cannot be loaded as Python module.
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1] mod_wsgi (pid=3642): Exception occurred processing WSGI script '/var/www/dbmailadmin/dbmailadmin.py'.
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1] Traceback (most recent call last):
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]   File "/var/www/dbmailadmin/dbmailadmin.py", line 8, in ?
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]     from libs import iredbase
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]   File "libs/iredbase.py", line 34, in ?
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]   File "/usr/lib/python2.4/site-packages/web/utils.py", line 76, in __getattr__
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]     raise AttributeError, k
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1] AttributeError: 'general'

Thanks,
Regards,
Mohan

FWIW I was running into this problem too, and ended chowning -R /path/to/dbmailadmin to the user apache runs as. This allowed me to actually be able to load the page, and find other issues, but those will come in another post shortly.

11

Re: DBMail Integration

mohan wrote:

[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1]     raise AttributeError, k
[Wed Dec 21 14:29:44 2011] [error] [client 127.0.0.1] AttributeError: 'general'

That means you don't have correct file permission for config file 'settings.ini'. It should be owned by user dbmailadmin, group dbmailadmin, file permission 0400.

soundfx440 wrote:

FWIW I was running into this problem too, and ended chowning -R /path/to/dbmailadmin to the user apache runs as. This allowed me to actually be able to load the page, and find other issues, but those will come in another post shortly.

iRedAdmin should be run as separated system user/group: dbmailadmin:dbmailadmin, not Apache user.
Please follow our installation guide strictly:
http://dbmailadmin.org/doc.html