iRedMail: “No module named sqlalchemy”

If you’re wondering why you cannot send e-mails after installing iRedMail, make sure “iredapd” is started correctly and isn’t throwing a fit (e.g check /var/log/maillog). In my case I found out iredapd wasn’t running — the log told me:

May 26 00:45:34 beta500 postfix/smtpd[20791]: warning: problem talking to server 127.0.0.1:7777: Connection refused

I therefore proceed to restart iredapd:

root@beta500:/root # service iredapd restart
iredapd is already stopped.
Starting iredapd ...
Traceback (most recent call last):
  File "/opt/iredapd/iredapd.py", line 11, in 
    from sqlalchemy import create_engine
ImportError: No module named sqlalchemy

Aha! That’s why. The solution is as simple as the error indicates! Simply add the package:

root@beta500:/usr/ports/databases # pkg install databases/py-sqlalchemy
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        py27-sqlalchemy: 0.7.10_2
        py27-sqlite3: 2.7.9_6
        sqlite3: 3.8.10.1

The process will require 17 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching py27-sqlalchemy-0.7.10_2.txz: 100%    1 MiB   1.3MB/s    00:01
Fetching py27-sqlite3-2.7.9_6.txz: 100%   28 KiB  29.0kB/s    00:01
Fetching sqlite3-3.8.10.1.txz: 100%  791 KiB 810.5kB/s    00:01
Checking integrity... done (0 conflicting)
[1/3] Installing sqlite3-3.8.10.1...
[1/3] Extracting sqlite3-3.8.10.1: 100%
[2/3] Installing py27-sqlite3-2.7.9_6...
[2/3] Extracting py27-sqlite3-2.7.9_6: 100%
[3/3] Installing py27-sqlalchemy-0.7.10_2...
[3/3] Extracting py27-sqlalchemy-0.7.10_2: 100%
root@beta500:/usr/ports/databases # service iredapd restart
iredapd is already stopped.
Starting iredapd ...

You’re done. Now you can send e-mails again

Leave a Reply

Your email address will not be published. Required fields are marked *