Removing Inbox Prefix and Creating Mailboxes Automatically

This is an update to two previous post regarding the removal of the Inbox Prefix, and Creating the default Mailboxes automatically in Dovecot.

If you have created the files mentioned in those posts, please delete them before you continue.

# nano /etc/dovecot/conf.d/99-mailboxes.conf

You can then add the following to the file…

namespace inbox {
  separator = .
  prefix = 
  inbox = yes

  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Spam {
    auto = subscribe 
    special_use = \Junk
  }
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
}

then restart Dovecot…

# systemctl restart dovecot

Ideally you should do this on a new server and migrate your data over.

Add Charset to css and js files

I noticed that my css and js files were being served without the charset in the content type…

content-type: text/css;

It should be (source)…

content-type: text/css; charset=UTF-8

Per Domain

To resolve, login to Plesk and navigate to your domain, and click Apache & nginx Settings, scroll down to Additional nginx directives and add…

charset UTF-8;
charset_types text/plain text/css text/xml application/json application/manifest+json application/javascript application/rss+xml image/svg+xml;

as you can see, you can just list the file types as you would for gzip_types.

Server-wide

You can also apply this server-wide by creating a file in /etc/nginx/conf.d and adding the same directives I mentioned in the previous step.

# nano /etc/nginx/conf.d/charset.conf

Adding…

charset UTF-8;
charset_types text/plain text/css text/xml application/json application/manifest+json application/javascript application/rss+xml image/svg+xml;

You then just need to restart Nginx and you are done.

# systemctl restart nginx

Updated to add server-wide and image/svg+xml.

Horde ActiveSync on Plesk

If you’ve been running ActiveSync on a dedicated subdomain with Horde you’ve probably been relying on Apache Alias directives to get it working.
Now mod_php is deprecated, you don’t have that option.

You now have to set the handler for the /usr/share/psa-horde folder in Additional directives for HTTPS for the subdomain in Plesk.

I copied this over from the main webmail conf, the only change I made was to change PHP version to 7.4.

<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX plesk-php74-fastcgi
FcgidInitialEnv PP_CUSTOM_PHP_INI "/etc/psa-webmail/horde/horde/php.ini"
FcgidMaxRequestLen 134217728
FcgidPassHeader Authorization
<Directory "/usr/share/psa-horde">
<Files ~ (\.php$)>
SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .php
Options +ExecCGI
</Files>
Require all granted
</Directory>
</IfModule>

I hope that helps someone.