| 1 | Installation |
|---|
| 2 | ============ |
|---|
| 3 | |
|---|
| 4 | Requirements |
|---|
| 5 | ------------ |
|---|
| 6 | |
|---|
| 7 | - Python version 2.6+ |
|---|
| 8 | - Django version 1.2+ (http://docs.djangoproject.com/en/dev/intro/install/#intro-install) |
|---|
| 9 | - south version 0.7+ (http://south.aeracode.org/) |
|---|
| 10 | |
|---|
| 11 | How to install |
|---|
| 12 | -------------- |
|---|
| 13 | |
|---|
| 14 | Download Modoboa's tarball and extract it:: |
|---|
| 15 | |
|---|
| 16 | # tar xzf modoboa-<version>.tar.gz |
|---|
| 17 | # mv modoboa-<version> modoboa |
|---|
| 18 | |
|---|
| 19 | Then, enter the modoboa directory, create a settings.py file (you can |
|---|
| 20 | use settings-sample.py as a model). Specify database relative |
|---|
| 21 | informations. You must choose between mysql and postgresql, other |
|---|
| 22 | types are not supported by major email projects like postfix or |
|---|
| 23 | dovecot. |
|---|
| 24 | |
|---|
| 25 | Create a database with the name you specified in settings.py. Make |
|---|
| 26 | sure your database is using UTF8 as a default charset. If not, you |
|---|
| 27 | will surely have problems (with MySQL at least). You will probably |
|---|
| 28 | need to install a python database backend (like MySQLdb). |
|---|
| 29 | |
|---|
| 30 | Initialise the database by running the following command:: |
|---|
| 31 | |
|---|
| 32 | # python manage.py syncdb |
|---|
| 33 | |
|---|
| 34 | Create the super admin account (just follow the procedure). |
|---|
| 35 | |
|---|
| 36 | Since version 0.8, Modoboa is using south to handle schema |
|---|
| 37 | migration. In order to finish the database creation, you must run the |
|---|
| 38 | first migration like this:: |
|---|
| 39 | |
|---|
| 40 | # python manage.py migrate |
|---|
| 41 | |
|---|
| 42 | How to upgrade |
|---|
| 43 | -------------- |
|---|
| 44 | |
|---|
| 45 | First, decompress the new tarball at the same location than your |
|---|
| 46 | current installation. Then, check if the new version you're installing |
|---|
| 47 | requires a migration:: |
|---|
| 48 | |
|---|
| 49 | 0.8 -> 0.8.1 : project renamed. |
|---|
| 50 | |
|---|
| 51 | * First, rename your mailng folder to modoboa and copy all the |
|---|
| 52 | content from modoboa-0.8.1 to modoboa. |
|---|
| 53 | |
|---|
| 54 | * Edit your settings.py and replace all occurences of mailng by |
|---|
| 55 | modoboa. Make sure you don't modify the DATABASE section as you're |
|---|
| 56 | not going to rename your database. |
|---|
| 57 | |
|---|
| 58 | * Rename the MAILNG_DIR variable to MODOBOA_DIR. |
|---|
| 59 | |
|---|
| 60 | * Add 'django.contrib.messages.middleware.MessageMiddleware' to |
|---|
| 61 | MIDDLEWARE_CLASSES and 'django.contrib.messages' to |
|---|
| 62 | INSTALLED_APPS. Save your modifications. |
|---|
| 63 | |
|---|
| 64 | * Run the following command:: |
|---|
| 65 | |
|---|
| 66 | # python manage.py syncdb |
|---|
| 67 | |
|---|
| 68 | * For all activated extensions, run the following command:: |
|---|
| 69 | |
|---|
| 70 | # export PYTHONPATH=<modoboa_dir>/.. |
|---|
| 71 | # DJANGO_SETTINGS_MODULE=modoboa.settings \ |
|---|
| 72 | <modoboa_dir>/scripts/extension.py <extension> on |
|---|
| 73 | |
|---|
| 74 | * Update your webserver configuration and restart it. |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | 0.7 -> 0.8 : SQL migration needed. |
|---|
| 78 | |
|---|
| 79 | Before you start migration, make sure you have updated your |
|---|
| 80 | INSTALLED_APPS variable and that it contains at least:: |
|---|
| 81 | |
|---|
| 82 | INSTALLED_APPS = ( |
|---|
| 83 | # Django's stuff before |
|---|
| 84 | |
|---|
| 85 | 'south', |
|---|
| 86 | 'modoboa', |
|---|
| 87 | 'modoboa.lib', |
|---|
| 88 | 'modoboa.admin', |
|---|
| 89 | 'modoboa.userprefs', |
|---|
| 90 | ) |
|---|
| 91 | |
|---|
| 92 | Starting with 0.8, modoboa.main doesn't exist anymore. You need to |
|---|
| 93 | remove it from your INSTALLED_APPS. |
|---|
| 94 | |
|---|
| 95 | NB: Before doing this migration, I recommend that you make a copy of your |
|---|
| 96 | existing database. |
|---|
| 97 | |
|---|
| 98 | Finally, run the following commands: |
|---|
| 99 | |
|---|
| 100 | # python manage.py syncdb |
|---|
| 101 | # python manage.py convert_to_south |
|---|
| 102 | # python manage.py migrate --all 0001 --fake |
|---|
| 103 | # python manage.py migrate --all 0002 |
|---|
| 104 | |
|---|
| 105 | 0.6 -> 0.7 : no SQL modifications. |
|---|
| 106 | 0.5 -> 0.6 : no SQL modifications. |
|---|
| 107 | |
|---|
| 108 | Time zone and language |
|---|
| 109 | ---------------------- |
|---|
| 110 | |
|---|
| 111 | Modoboa is available in english, french and german. You can choose |
|---|
| 112 | which language to use by modifying the LANGUAGE_CODE variable inside |
|---|
| 113 | settings.py:: |
|---|
| 114 | |
|---|
| 115 | LANGUAGE_CODE = 'en-US' # English |
|---|
| 116 | # or |
|---|
| 117 | LANGUAGE_CODE = 'fr-FR' # French |
|---|
| 118 | # or |
|---|
| 119 | LANGUAGE_CODE = 'de-DE' # German |
|---|
| 120 | |
|---|
| 121 | You can also specify your time zone by modifying the TIME_ZONE |
|---|
| 122 | variable. For example:: |
|---|
| 123 | |
|---|
| 124 | TIME_ZONE = 'Europe/Paris' |
|---|
| 125 | |
|---|
| 126 | Host configuration |
|---|
| 127 | ------------------ |
|---|
| 128 | |
|---|
| 129 | Before testing Modoboa, you must create a group and a user that will be |
|---|
| 130 | used to store mails on the host filesystem. There is only one |
|---|
| 131 | group/user needed because we are in a virtual hosting configuration |
|---|
| 132 | (ie. users with non-UNIX accounts). |
|---|
| 133 | |
|---|
| 134 | For example, create a vmail group:: |
|---|
| 135 | |
|---|
| 136 | # groupadd vmail |
|---|
| 137 | |
|---|
| 138 | Then create a vmail user:: |
|---|
| 139 | |
|---|
| 140 | # useradd -g vmail -d /var/vmail -m vmail |
|---|
| 141 | |
|---|
| 142 | At last, the system user used to run modoboa will need permissions to |
|---|
| 143 | manipulate directories in vmail's homedir. To do so, edit your /etc/sudoers |
|---|
| 144 | file and add the following inside:: |
|---|
| 145 | |
|---|
| 146 | <user_that_runs_modoboa> ALL=(vmail) NOPASSWD: ALL |
|---|
| 147 | |
|---|
| 148 | Testing installation |
|---|
| 149 | -------------------- |
|---|
| 150 | |
|---|
| 151 | As a typical Django application, Modoboa can be tested using a simple web |
|---|
| 152 | server. Just run this command to start it:: |
|---|
| 153 | |
|---|
| 154 | # python manage.py runserver |
|---|
| 155 | |
|---|
| 156 | You will be able to play with Modoboa by looking at |
|---|
| 157 | http://<youraddress>:8000/modoboa/admin/. |
|---|
| 158 | |
|---|
| 159 | Tips to link Modoboa with postfix |
|---|
| 160 | -------------------------------- |
|---|
| 161 | |
|---|
| 162 | First, define following maps on your server (this should work with |
|---|
| 163 | Postfix versions >= 2.2):: |
|---|
| 164 | |
|---|
| 165 | # /etc/postfix/sql-domains.cf |
|---|
| 166 | user = <user> |
|---|
| 167 | password = <password> |
|---|
| 168 | dbname = <database> |
|---|
| 169 | hosts = 127.0.0.1 |
|---|
| 170 | query = SELECT name FROM admin_domain WHERE name='%s' AND enabled='1' |
|---|
| 171 | |
|---|
| 172 | # /etc/postfix/sql-mailboxes.cf |
|---|
| 173 | user = <user> |
|---|
| 174 | password = <password> |
|---|
| 175 | dbname = <database> |
|---|
| 176 | hosts = 127.0.0.1 |
|---|
| 177 | query = SELECT path FROM admin_mailbox WHERE full_address = '%s' |
|---|
| 178 | |
|---|
| 179 | # /etc/postfix/sql-aliases.cf |
|---|
| 180 | user = <user> |
|---|
| 181 | password = <password> |
|---|
| 182 | dbname = <database> |
|---|
| 183 | hosts = 127.0.0.1 |
|---|
| 184 | query = SELECT t3.full_address FROM admin_alias AS t1, admin_alias_mboxes AS t2, admin_mailbox AS t3 WHERE t1.full_address='%s' AND t1.id=t2.alias_id AND t2.mailbox_id=t3.id AND t1.enabled='1' |
|---|
| 185 | |
|---|
| 186 | Then, use the following configuration in your /etc/postfix/main.cf file |
|---|
| 187 | (this is one possible configuration):: |
|---|
| 188 | |
|---|
| 189 | # Stuff before |
|---|
| 190 | mailbox_transport = virtual |
|---|
| 191 | home_mailbox = .maildir/ |
|---|
| 192 | maildrop_destination_recipient_limit = 1 |
|---|
| 193 | virtual_minimum_uid = <vmail user id> |
|---|
| 194 | virtual_gid_maps = static:<vmail group id> |
|---|
| 195 | virtual_uid_maps = static:<vmail user id> |
|---|
| 196 | virtual_mailbox_base = /var/vmail |
|---|
| 197 | |
|---|
| 198 | relay_domains = |
|---|
| 199 | virtual_mailbox_domains = mysql:/etc/postfix/sql-domains.cf |
|---|
| 200 | virtual_mailbox_maps = mysql:/etc/postfix/sql-mailboxes.cf |
|---|
| 201 | virtual_alias_maps = mysql:/etc/postfix/sql-aliases.cf |
|---|
| 202 | # Stuff after |
|---|
| 203 | |
|---|
| 204 | NB: Modoboa supports both maildir and mbox formats. You can specify |
|---|
| 205 | which format to use by modifying the MAILBOX_TYPE parameter available |
|---|
| 206 | in the admin panel. |
|---|
| 207 | |
|---|
| 208 | Tips to activate auto-reply messages in Postifx |
|---|
| 209 | ----------------------------------------------- |
|---|
| 210 | |
|---|
| 211 | Since version 0.6, mail users can define an auto-reply message with Modoboa. |
|---|
| 212 | |
|---|
| 213 | To activate the extension, edit your settings.py and add the following |
|---|
| 214 | line inside the INSTALLED_APPS variable:: |
|---|
| 215 | |
|---|
| 216 | 'modoboa.extensions.postfix_autoreply', |
|---|
| 217 | |
|---|
| 218 | Run the following command to activate the component:: |
|---|
| 219 | |
|---|
| 220 | # export PYTHONPATH=<modoboa_dir>/.. |
|---|
| 221 | # DJANGO_SETTINGS_MODULE=modoboa.settings \ |
|---|
| 222 | <modoboa_dir>/scripts/extension.py postfix-autoreply on |
|---|
| 223 | |
|---|
| 224 | Then run the following commands to update Modoboa SQL schema and content:: |
|---|
| 225 | |
|---|
| 226 | # python manage.py syncdb |
|---|
| 227 | # python manage.py migrate postfix-autoreply |
|---|
| 228 | # export PYTHONPATH=$PWD/.. |
|---|
| 229 | # DJANGO_SETTINGS_MODULE=modoboa.settings ./scripts/postfix_autoreply/upgrade_autoreply.py |
|---|
| 230 | |
|---|
| 231 | The user that executes the autoreply script needs to access |
|---|
| 232 | settings.py. You must apply proper permissions on this file. For |
|---|
| 233 | example, if settings.py belongs to www-data:www-data, you can add the |
|---|
| 234 | vmail user to the www-data group and set the read permission for the |
|---|
| 235 | group. |
|---|
| 236 | |
|---|
| 237 | To make Postfix understand this feature, you need to update your configuration |
|---|
| 238 | files as follow:: |
|---|
| 239 | |
|---|
| 240 | # /etc/postfix/main.cf |
|---|
| 241 | transport_maps = mysql:/etc/postfix/maps/sql-transport.cf |
|---|
| 242 | virtual_alias_maps = mysql:/etc/postfix/maps/sql-aliases.cf |
|---|
| 243 | mysql:/etc/postfix/maps/sql-autoreplies.cf |
|---|
| 244 | |
|---|
| 245 | # /etc/postfix/master.cf |
|---|
| 246 | autoreply unix - n n - - pipe |
|---|
| 247 | flags= user=vmail:<group> argv=<path_to_modoboa>/scripts/postfix_autoreply/autoreply $sender $mailbox |
|---|
| 248 | |
|---|
| 249 | Then, create new map files with the following content:: |
|---|
| 250 | |
|---|
| 251 | # /etc/postfix/maps/sql-transport.cf |
|---|
| 252 | user = <user> |
|---|
| 253 | password = <password> |
|---|
| 254 | dbname = <database> |
|---|
| 255 | hosts = 127.0.0.1 |
|---|
| 256 | query = SELECT method FROM postfix_autoreply_transport WHERE domain='%s' |
|---|
| 257 | |
|---|
| 258 | # /etc/postfix/maps/sql-autoreplies.cf |
|---|
| 259 | user = <user> |
|---|
| 260 | password = <password> |
|---|
| 261 | dbname = <database> |
|---|
| 262 | hosts = 127.0.0.1 |
|---|
| 263 | query = SELECT full_address, autoreply_address FROM postfix_autoreply_alias WHERE full_address='%s' |
|---|
| 264 | |
|---|
| 265 | Finally, edit the shell script 'autoreply' located inside the |
|---|
| 266 | 'scripts' directory and change the value of BASEDIR. (just put absolute path |
|---|
| 267 | of the directory where modoboa is installed) |
|---|
| 268 | |
|---|
| 269 | NB: auto-reply messages are just sent one time per sender for a |
|---|
| 270 | pre-defined time period. By default, this period is equal to 1 day |
|---|
| 271 | (86400s), you can adjust this value by modifying the AUTOREPLY_TIMEOUT |
|---|
| 272 | parameter available in the admin panel. |
|---|
| 273 | |
|---|
| 274 | NB: Be sure that both 'autoreply' and 'autoreply.py' scripts (located |
|---|
| 275 | inside the 'scripts/postfix_autoreply' directory) have good |
|---|
| 276 | permissions (ie. 0755). |
|---|
| 277 | |
|---|
| 278 | Tips to link Modoboa with dovecot |
|---|
| 279 | -------------------------------- |
|---|
| 280 | |
|---|
| 281 | If you are using 'maildir' format to store mailboxes, add the |
|---|
| 282 | following line inside your main Dovecot config file |
|---|
| 283 | (/etc/dovecot/dovecot.conf):: |
|---|
| 284 | |
|---|
| 285 | mail_location = maildir:<path_to_mailboxes>/%d/%n/.maildir |
|---|
| 286 | |
|---|
| 287 | If you are using 'mbox' format, put the following:: |
|---|
| 288 | |
|---|
| 289 | mail_location = mbox:<path_to_mailboxes>/%d/%n/:INBOX=<path_to_mailboxes>/%d/%n/Inbox |
|---|
| 290 | |
|---|
| 291 | To make the authentication work, edit 'dovecot.conf' and add the |
|---|
| 292 | following inside:: |
|---|
| 293 | |
|---|
| 294 | auth default { |
|---|
| 295 | # ... stuff before |
|---|
| 296 | |
|---|
| 297 | passdb sql { |
|---|
| 298 | # Path for SQL configuration file, see /etc/dovecot/dovecot-sql.conf for |
|---|
| 299 | # example |
|---|
| 300 | args = /etc/dovecot/dovecot-sql.conf |
|---|
| 301 | } |
|---|
| 302 | |
|---|
| 303 | userdb sql { |
|---|
| 304 | # Path for SQL configuration file |
|---|
| 305 | args = /etc/dovecot/dovecot-sql.conf |
|---|
| 306 | } |
|---|
| 307 | |
|---|
| 308 | # ... stuff after |
|---|
| 309 | } |
|---|
| 310 | |
|---|
| 311 | Be sure to activate only one backend (per type) inside your configuration |
|---|
| 312 | (comment other ones). |
|---|
| 313 | |
|---|
| 314 | Then, edit your /etc/dovecot/dovecot-sql.conf and modify following lines:: |
|---|
| 315 | |
|---|
| 316 | driver = mysql |
|---|
| 317 | connect = host=<mysqld socket> dbname=<database> user=<user> password=<password> |
|---|
| 318 | default_pass_scheme = CRYPT |
|---|
| 319 | password_query = SELECT full_address AS user, password FROM admin_mailbox WHERE full_address = '%u' |
|---|
| 320 | user_query = SELECT path AS home, uid, gid FROM admin_mailbox WHERE full_address = '%u' |
|---|
| 321 | |
|---|
| 322 | Enable quotas with Dovecot |
|---|
| 323 | -------------------------- |
|---|
| 324 | |
|---|
| 325 | Put the following lines inside your dovecot.conf file:: |
|---|
| 326 | |
|---|
| 327 | protocol imap { |
|---|
| 328 | mail_plugins = quota imap_quota |
|---|
| 329 | } |
|---|
| 330 | |
|---|
| 331 | Before continuing, you need to know which quota backend must be user |
|---|
| 332 | (function of mailboxes format):: |
|---|
| 333 | * 'mbox' : backend=dirsize, |
|---|
| 334 | * 'maildir' : backend=maildir. |
|---|
| 335 | |
|---|
| 336 | If you use version prior to 1.1, add also the following configuration:: |
|---|
| 337 | |
|---|
| 338 | plugin { |
|---|
| 339 | # 10 MB default quota limit |
|---|
| 340 | quota = <backend>:storage=10240 |
|---|
| 341 | } |
|---|
| 342 | |
|---|
| 343 | Then modify the above user_query inside dovecot-sql.conf file like |
|---|
| 344 | that to activate per user quotas:: |
|---|
| 345 | |
|---|
| 346 | user_query = SELECT path AS home, uid, gid, concat('<backend>:storage=', quota / 1024) AS quota FROM admin_mailbox WHERE full_address = '%u' |
|---|
| 347 | |
|---|
| 348 | For version >= 1.1, put the following configuration inside dovecot.conf file:: |
|---|
| 349 | |
|---|
| 350 | plugin { |
|---|
| 351 | # Default 10M storage limit with an extra 5M limit when saving to Trash. |
|---|
| 352 | quota = <backend>:User quota |
|---|
| 353 | quota_rule = *:storage=10M |
|---|
| 354 | quota_rule2 = Trash:storage=5M |
|---|
| 355 | } |
|---|
| 356 | |
|---|
| 357 | Then modify the above user_query inside dovecot-sql.conf to activate |
|---|
| 358 | user quotas:: |
|---|
| 359 | |
|---|
| 360 | user_query = SELECT path AS home, uid, gid, concat('*:storage=', quota, 'M') AS quota_rule FROM admin_mailbox WHERE full_address = '%u' |
|---|
| 361 | |
|---|
| 362 | Tips to serve Modoboa behind Apache2 |
|---|
| 363 | ------------------------------------ |
|---|
| 364 | |
|---|
| 365 | First, be sure to have apache2 and mod_python installed on your |
|---|
| 366 | server. |
|---|
| 367 | |
|---|
| 368 | Create a new virtualhost in your Apache configuration and put the |
|---|
| 369 | following inside:: |
|---|
| 370 | |
|---|
| 371 | <VirtualHost *:80> |
|---|
| 372 | <Location "/"> |
|---|
| 373 | SetHandler mod_python |
|---|
| 374 | PythonHandler django.core.handlers.modpython |
|---|
| 375 | PythonPath "['<path to directory that contains modoboa dir>'] + sys.path" |
|---|
| 376 | SetEnv DJANGO_SETTINGS_MODULE modoboa.settings |
|---|
| 377 | </Location> |
|---|
| 378 | Alias "/static" "<path to modoboa dir>/static" |
|---|
| 379 | <Location "/static/"> |
|---|
| 380 | SetHandler None |
|---|
| 381 | </Location> |
|---|
| 382 | </VirtualHost> |
|---|
| 383 | |
|---|
| 384 | This is one possible configuration. Note that you will certainly need more |
|---|
| 385 | configuration in order to launch Apache. |
|---|
| 386 | |
|---|
| 387 | Using the amavisd-new quarantine plugin |
|---|
| 388 | --------------------------------------- |
|---|
| 389 | |
|---|
| 390 | This plugin allows you and your users to handle amavisd-new SQL |
|---|
| 391 | quarantine. You can consult messages and/or release or delete them. |
|---|
| 392 | |
|---|
| 393 | If you plan to use it, first make sure to have those requirements |
|---|
| 394 | installed on your server:: |
|---|
| 395 | |
|---|
| 396 | - mysqldb python module (http://mysql-python.sourceforge.net/) |
|---|
| 397 | - lxml python module (http://codespeak.net/lxml/) |
|---|
| 398 | |
|---|
| 399 | To activate the extension, edit your settings.py and add the following |
|---|
| 400 | line inside the INSTALLED_APPS variable:: |
|---|
| 401 | |
|---|
| 402 | 'modoboa.extensions.amavis_quarantine', |
|---|
| 403 | |
|---|
| 404 | Then run the following command to activate the component:: |
|---|
| 405 | |
|---|
| 406 | # export PYTHONPATH=<modoboa_dir>/.. |
|---|
| 407 | # DJANGO_SETTINGS_MODULE=modoboa.settings \ |
|---|
| 408 | <modoboa_dir>/scripts/extension.py amavis-quarantine on |
|---|
| 409 | |
|---|
| 410 | Then, you need to specify where is the database that contains the |
|---|
| 411 | quarantine. Inside settings.py, add a new connection to the |
|---|
| 412 | DB_CONNECTIONS variable like this:: |
|---|
| 413 | |
|---|
| 414 | DB_CONNECTIONS = { |
|---|
| 415 | "amavis_quarantine" : {"driver" : "mysql", |
|---|
| 416 | "host" : "<your_host>", |
|---|
| 417 | "dbname" : "<amavis_dbname>", |
|---|
| 418 | "login" : "<user>", |
|---|
| 419 | "password" : "<password>"} |
|---|
| 420 | } |
|---|
| 421 | |
|---|
| 422 | |
|---|
| 423 | Replace values between <> with yours. |
|---|
| 424 | |
|---|
| 425 | When viewing messages, you can choose to display links (addresses, |
|---|
| 426 | images). In order to display images correctly, you need to create a |
|---|
| 427 | tmp directory under static/ for storing them. For example:: |
|---|
| 428 | |
|---|
| 429 | # mkdir <modoboa_dir>/static/tmp |
|---|
| 430 | |
|---|
| 431 | To be able to release messages, first take a look at this page:: |
|---|
| 432 | |
|---|
| 433 | http://www.ijs.si/software/amavisd/amavisd-new-docs.html#quar-release |
|---|
| 434 | |
|---|
| 435 | It shows how to configure amavisd-new to listen somewhere for the |
|---|
| 436 | AM.PDP protocol. This protocol is used to send release requests. |
|---|
| 437 | |
|---|
| 438 | Below is an example of a working configuration:: |
|---|
| 439 | |
|---|
| 440 | $interface_policy{'SOCK'} = 'AM.PDP-SOCK'; |
|---|
| 441 | $interface_policy{'9998'} = 'AM.PDP-INET'; |
|---|
| 442 | |
|---|
| 443 | $policy_bank{'AM.PDP-SOCK'} = { |
|---|
| 444 | protocol => 'AM.PDP', |
|---|
| 445 | auth_required_release => 0, |
|---|
| 446 | }; |
|---|
| 447 | $policy_bank{'AM.PDP-INET'} = { |
|---|
| 448 | protocol => 'AM.PDP', |
|---|
| 449 | inet_acl => [qw( 127.0.0.1 [::1] )], |
|---|
| 450 | }; |
|---|
| 451 | |
|---|
| 452 | Don't forget to update the inet_acl list if you plan to release from |
|---|
| 453 | the network. |
|---|
| 454 | |
|---|
| 455 | Once amavisd-new is configured, just tell Modoboa where it can find the |
|---|
| 456 | "release server" by modifying following parameters in the admin panel:: |
|---|
| 457 | |
|---|
| 458 | # "unix" or "inet" |
|---|
| 459 | AM_PDP_MODE = "inet" |
|---|
| 460 | |
|---|
| 461 | # "unix" mode only |
|---|
| 462 | AM_PDP_SOCKET = "/var/amavis/amavisd.sock" |
|---|
| 463 | |
|---|
| 464 | # "inet" mode only |
|---|
| 465 | AM_PDP_HOST = "127.0.0.1" |
|---|
| 466 | AM_PDP_PORT = 9998 |
|---|
| 467 | |
|---|
| 468 | Last point, Modoboa provides a simple script that periodically purge |
|---|
| 469 | the amavisd-new quarantine database. If you plan to use it, you can |
|---|
| 470 | add the following line inside root's crontab:: |
|---|
| 471 | |
|---|
| 472 | 0 0 * * * PYTHONPATH=<modoboa_dir/..> \ |
|---|
| 473 | DJANGO_SETTINGS_MODULE=modoboa.settings \ |
|---|
| 474 | <modoboa_dir>/extensions/amavis_quarantine/cleanup.py |
|---|
| 475 | |
|---|
| 476 | Replace modoboa_dir with the installation path of Modoboa. |
|---|
| 477 | |
|---|
| 478 | By default, messages older than 14 days are automatically purged. You |
|---|
| 479 | can modify this value by changing the MAX_MESSAGES_AGE parameter in the admin panel. |
|---|
| 480 | |
|---|
| 481 | Using the statistics plugin |
|---|
| 482 | --------------------------- |
|---|
| 483 | |
|---|
| 484 | This plugin allows you to collect various statistics about emails |
|---|
| 485 | traffic on your server. It parses log file to collect information and |
|---|
| 486 | then generates graphics in PNG format. |
|---|
| 487 | |
|---|
| 488 | If you plan to use it, first make sure to have those requirements |
|---|
| 489 | installed on your server:: |
|---|
| 490 | |
|---|
| 491 | - rrdtool python binding (http://oss.oetiker.ch/rrdtool/) |
|---|
| 492 | |
|---|
| 493 | To activate the extension, edit your settings.py and add the following |
|---|
| 494 | line inside the INSTALLED_APPS variable:: |
|---|
| 495 | |
|---|
| 496 | 'modoboa.extensions.stats', |
|---|
| 497 | |
|---|
| 498 | Then run the following command to activate the component:: |
|---|
| 499 | |
|---|
| 500 | # export PYTHONPATH=<modoboa_dir>/.. |
|---|
| 501 | # DJANGO_SETTINGS_MODULE=modoboa.settings \ |
|---|
| 502 | <modoboa_dir>/scripts/extension.py stats on |
|---|
| 503 | |
|---|
| 504 | Then, adapt the following parameters to your environnement:: |
|---|
| 505 | |
|---|
| 506 | # Path to mail log file |
|---|
| 507 | LOGFILE = "/var/log/mail.log" |
|---|
| 508 | |
|---|
| 509 | # Path to directory where rrd files are stored |
|---|
| 510 | RRD_ROOTDIR = "/tmp/modoboa" |
|---|
| 511 | |
|---|
| 512 | # Path to directory where png files are stored |
|---|
| 513 | IMG_ROOTDIR = "<modoboa_dir>/static/graphs" |
|---|
| 514 | |
|---|
| 515 | Make sure the directories that will contain those files exist. If not, |
|---|
| 516 | create them before going further. For example (according to previous |
|---|
| 517 | parameters):: |
|---|
| 518 | |
|---|
| 519 | $ mkdir /tmp/modoboa |
|---|
| 520 | $ mkdir <modoboa_dir>/static/graphs |
|---|
| 521 | |
|---|
| 522 | To finish, you need to collect information periodically in order to |
|---|
| 523 | feed rrd files. To do so, just add the following lines into root's |
|---|
| 524 | crontab:: |
|---|
| 525 | |
|---|
| 526 | */5 * * * * PYTHONPATH=<modoboa_dir/..> DJANGO_SETTINGS_MODULE=modoboa.settings <modoboa_dir>/scripts/stats/logparser.py |
|---|
| 527 | |
|---|
| 528 | Replace modoboa_dir with the installation path of Modoboa. |
|---|
| 529 | |
|---|
| 530 | Graphics are automatically created after each new parsing. |
|---|
| 531 | |
|---|
| 532 | Using the webmail component |
|---|
| 533 | --------------------------- |
|---|
| 534 | |
|---|
| 535 | Modoboa provides a simple webmail component (you can browse, read and |
|---|
| 536 | compose messages). With this feature, it is possible to deploy an almost |
|---|
| 537 | standalone emails platform just with Modoboa. |
|---|
| 538 | |
|---|
| 539 | The following requirements are needed before going further:: |
|---|
| 540 | |
|---|
| 541 | - lxml python module (http://codespeak.net/lxml/) |
|---|
| 542 | - pycrypto python module (http://www.dlitz.net/software/pycrypto/) |
|---|
| 543 | |
|---|
| 544 | Just run the following command to activate the component:: |
|---|
| 545 | |
|---|
| 546 | # export PYTHONPATH=<modoboa_dir>/.. |
|---|
| 547 | # DJANGO_SETTINGS_MODULE=modoboa.settings \ |
|---|
| 548 | <modoboa_dir>/scripts/extension.py webmail on |
|---|
| 549 | |
|---|
| 550 | Sometimes, inline images are integrated inside emails. To display |
|---|
| 551 | them, Modoboa stores them inside a temporary folder. Make sure the |
|---|
| 552 | following path exists, otherwise create it:: |
|---|
| 553 | |
|---|
| 554 | # mkdir <path_to_modoboa>/static/tmp |
|---|
| 555 | |
|---|
| 556 | The user that is running Modoboa will need the write permission inside |
|---|
| 557 | this folder. |
|---|
| 558 | |
|---|
| 559 | Next, go to the admin panel and modify the following parameters in |
|---|
| 560 | order to communicate with your IMAP and SMTP servers:: |
|---|
| 561 | |
|---|
| 562 | IMAP_SECURED = no |
|---|
| 563 | IMAP_SERVER = 127.0.0.1 |
|---|
| 564 | IMAP_PORT = 143 |
|---|
| 565 | |
|---|
| 566 | SMTP_SECURED = no |
|---|
| 567 | SMTP_AUTHENTICATION = no |
|---|
| 568 | SMTP_SERVER = 127.0.0.1 |
|---|
| 569 | SMTP_PORT = 25 |
|---|
| 570 | |
|---|
| 571 | Last but not least, modify the SECRET_KEY parameter and choose a new |
|---|
| 572 | value (exactly 16 characters). This key is really important, it is |
|---|
| 573 | used to encrypt/decrypt user passwords stored inside sessions. |
|---|
| 574 | |
|---|
| 575 | Do not communicate this key to anyone!! |
|---|