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