wiki:TemplatePermissions

Version 1 (modified by rjl, 16 years ago) (diff)

--

Why can't Maia read my template files?

Typical error messages:

*Warning*: fopen(/var/amavis/maia/templates/newuser.tpl): failed to open
 stream: Permission denied in
 /var/www/public_html/mail/internal-init.php* on line *150*

*Warning*: filesize(): Stat failed for
 /var/amavis/maia/templates/newuser.tpl (errno=13 - Permission denied) in
 /var/www/public_html/mail/internal-init.php* on line *151*

*Warning*: fread(): supplied argument is not a valid stream resource in
 /var/www/public_html/mail/internal-init.php* on line *151*

*Warning*: fclose(): supplied argument is not a valid stream resource in
 /var/www/public_html/mail/internal-init.php* on line *152*

The template files (*.tpl) need to be readable by your web server user. If your web server runs as user "www", or "www-data" or somesuch, that user needs to have read permissions on the template files. You can do this, for example, by adding this user to the "amavis" group, and making sure that the "amavis" group has read permissions on the templates.

In other words, on /var/amavis/maia/templates, let all of the template files be owned by amavis, group amavis, readable by both:

  chown amavis.amavis /var/amavis/maia/templates/*.tpl
  chmod 644 /var/amavis/maia/templates/*.tpl

Then, if your web server user is "www", add that user to your "amavis" group:

  usermod -G amavis www