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