| | 332 | |
| | 333 | # |
| | 334 | # Squirrelmail |
| | 335 | # |
| | 336 | class _Squirrel: |
| | 337 | |
| | 338 | def __init__(self, ares): |
| | 339 | self._ares = ares |
| | 340 | |
| | 341 | def setup(self): |
| | 342 | f = open(self._ares.root + 'etc/mailname', 'w+') |
| | 343 | f.write("%s\n" % (self._ares.fqdn)) |
| | 344 | f.close() |
| | 345 | |
| | 346 | f = open(self._ares.root + 'etc/apache2/conf.d/squirrelmail.conf', 'w+') |
| | 347 | f.write('<VirtualHost *>\n') |
| | 348 | f.write(' DocumentRoot /usr/share/squirrelmail\n') |
| | 349 | f.write(' ServerName %s\n' % (self._ares.fqdn)) |
| | 350 | f.write(' SSLEngine on\n') |
| | 351 | f.write(' SSLCertificateFile /etc/apache2/apache.pem\n') |
| | 352 | f.write('</VirtualHost>\n') |
| | 353 | f.close() |
| | 354 | |
| | 355 | aug = self._ares.aug |
| | 356 | |
| | 357 | cfg = '/files/etc/default/locale' |
| | 358 | loc = aug.get(cfg + '/LANG').lstrip('"').rstrip('"').split('.')[0] |
| | 359 | |
| | 360 | cfg = '/files/etc/squirrelmail/config.php' |
| | 361 | aug.set(cfg + '/$squirrelmail_default_language', '\'%s\'' % loc) |
| | 362 | |
| | 363 | cfg = '/files/etc/php5/apache2/php.ini' |
| | 364 | aug.set(cfg + '/PHP/memory_limit', '32M') |
| | 365 | |