Skip to main content

Dovecot in Plesk for Linux 12.0!

In Plesk 12.0 previews we present full-fledged Dovecot IMAP/POP3 server support with server-side mail filtering via Sieve. The community asked and we deliver!

Dovecot is an open-source high-performance secure and actively developed IMAP and POP3 email server for Linux systems. It’s fast, simple to configure, requires no special administration and uses very little memory. It’s also quite admin-friendly with comprehensive error messages. In Plesk 12.0 Dovecot will serve as an alternative for Courier-IMAP which was the only supported IMAP/POP3 server for quite some time.

We ship Dovecot with Pigeonhole plugin which provides both server-side mail filtering at the time of mail delivery using rules written in standardized Sieve language and a ManageSieve server to manage them. Using the ManageSieve protocol, users can upload their Sieve scripts remotely, without needing direct filesystem access through FTP or SCP. Additionally ManageSieve server always makes sure that uploaded scripts are valid and compile without errors. We use ManageSieve to integrate filter management in webmails (both Roundcube and Horde).

How to install Plesk preview

Caveat emptor: preview builds aren’t for use on production servers. They may (and will) contain bugs and unfinished features. Parallels will not be providing any kind of technical support for machines with preview builds or upgraded from preview builds. Please use preview builds to evaluate new features and give us your feedback (see detail at the end of the post). This is the best opportunity for you to influence development of the next version, since it’s highly unlikely any significant changes will be made after Plesk 12.0 exits previews stage.

While we usually support upgrading from previous preview builds, we won’t be doing so this time (from Plesk 11.6.x, where x < 11.6.4). So you’ll either need to make a clean installation or upgrade from Plesk <= 11.5.30.

To install a preview build, go grab Parallels Installer according to the instructions here or just download it via this direct link: http://autoinstall.plesk.com/plesk-installer . Then launch the installer with  --all-versions  option to make the preview versions visible. You’ll want to install 11.6.4 version or higher (we recommend at least 12.0.5). Release notes for preview builds can be found here.

How to install Dovecot support

It’s just as easy as installing any other component in Plesk. In installer web-interface it is located here, just select it and proceed with installation:

Dovecot component in Parallels Installer web interface
Dovecot component in Parallels Installer web interface

In interactive console interface it is located here:

Dovecot component in Parallels Installer interactive console interface
Dovecot component in Parallels Installer interactive console interface

You can also switch from Courier-IMAP to Dovecot in non-interactive mode using following simple command:

Switching between Courier-IMAP and Dovecot is also supported via VZ templates (Provider-Controlled Versioned Templates only)! It is really simple ( $VEID  is target container ID):

However we don’t release preview versions of VZ templates, so you’ll have to wait until release to try it out.

Switching from Courier-IMAP to Dovecot is as painless and easy as switching from QMail to Postfix. Ideally your mail users wouldn’t even notice it! If they do, please tell us and we’ll try to fix that.

Integration with Plesk

Dovecot is fully integrated into Plesk the way you would expect from IMAP/POP3 server. The service is manageable from Panel and is tracked by WatchDog extension. IMAP/POP3 traffic usage statistics is collected the same way as for Courier-IMAP. Working with SELinux enabled is also supported. There is no Sieve rules management directly in Panel, instead mail users are supposed to manage server-side mail filters using webmails or other clients that are capable of talking to ManageSieve server.

You can customize Dovecot and Pigeonhole configuration to fit your specific needs the usual way — by adding custom configuration into /etc/dovecot/conf.d/ . Please read comments in  /etc/dovecot/dovecot.conf  for details.

However, if you install Dovecot, you will not have access to the following two outdated features usually supported by Panel: authentication via short mailnames when QMail is installed and POP3 before SMTP (aka SMTP after POP). However you may rather easily implement the latter one manually. If you feel you need this feature, drop a note in the comments below explaining why you need it and I’ll consider writing a post that will explain why using POP3 before SMTP is bad and how to implement it manually.

Integration with Horde and Roundcube webmails

The most requested feature that is a part of Dovecot support, namely server-side mail filtering, is manageable via webmails. Both Horde and Roundcube now provide convenient means of constructing and managing custom Sieve filters that doesn’t actually require any knowledge of Sieve language whatsoever.

I’ll demonstrate creating a filter that sends out an “out of office” message (aka “vacation” message or autoresponder) in response to incoming mail in a given period of time.

Horde

Both Horde and Roundcube webmails have filter constructors, but Horde even has a separate page to conveniently set up autoresponder. Of course, you’ll need Dovecot installed to see it.

Horde filters page when Dovecot is installed
Horde filters page when Dovecot is installed (click to enlarge)

To reach it log into webmail and go to Mail -> Filters (see screenshot above). Clicking big green “New Rule” button will allow you to create a custom rule. Instead we’ll click “Vacation” in the panel on the left. This will bring us
to the autoresponder customization screen depicted below.

Horde "Vacation" filter page
Horde “Vacation” filter page (click to enlarge)

Looks like you can set up everything you need here: vacation start and end dates, autoresponder subject and body, and even some additional settings in the “Advanced Settings” tab.

When you’re done with setting up the autoresponder, click “Save and Enable”. This will internally generate a script in Sieve language that will then be sent via ManageSieve daemon to mail backend. Current script generated by Horde can be viewed on the “Script” page.

Horde "Script" page
Horde “Script” page (click to enlarge)

You may manually activate or deactivate it, as well as fetch a Sieve script currently installed in the mail backend with the help of “Show Active Script” button.

Horde stores its filters in DB and is not able to actually import existing Sieve scripts from mail backend. We use Horde Ingo “Sieve” backend to manage Sieve filters. When Courier-IMAP is installed backend is switched back to the default one.

Roundcube

Roundcube doesn’t have a separate page to set up autoresponder, but it can be easily done using generic Sieve filters constructor. To reach it, go to Settings -> Filters and click “+” sign (add new filter).

Roundcube SieveRules plugin (click to see full version)
Roundcube SieveRules plugin (click to see full version)

Enter a filter name, set filter rules policy to “matching all of the following rules” and add two rules that match “Arrival date” to define autoresponder period. Add one filter action “Out of Office Message” and set up its subject and body. You may also click “Advanced options” to see some additional settings (shown on the screenshot above). When you’re done click “Save” and filters will be automatically applied to the mail backend the same way Horde does it.

With Roundcube we actually ship two plugins that can be used to manage Sieve filters. Those are “managesieve” and “sieverules”. By default we only enable the second one as a more advanced one. However you may switch to “managesieve” plugin in Roundcube configuration.

Both plugins don’t allow viewing the generated Sieve script, however both of them have limited import capabilities. When Courier-IMAP is installed “Filters” settings page will still be shown, but will not be accessible.

Known issues

Please tell us, if you find any!

Just before 11.6.4 preview we partially broke SELinux support for authentication in Dovecot on RedHat el6 and CentOS 6, so for now please either disable SELinux or set it into permissive mode via “setenforce 0″ . This issue will be fixed in the next preview.

Conclusion

We’re interested in your feedback about this feature. You may leave it here in the comments below or in one of Dovecot threads over at Plesk 11.x for Linux Suggestions and Feedback forum. If you have any questions related to this feature feel free to ask them as well. We’d also like to thank the community for its valuable input for Dovecot development.

If you have an opportunity, please try Dovecot out. We hope you’ll be amazed how smooth it works!

26 thoughts

  1. burnley -

    Any chance to see this backported into 11.5.30?

    Reply

  2. Markus Eyrich -

    Is Horde/Roundcube also updated to support Sieve Filters?

    Reply

    Nikolay Vizovitin -

    Yes, of course.

    If you’re interested in details, we’ve updated Roundcube to 0.9.4 (latest version at the time of update) to support SieveRules plugin and repackaged our psa-pear for Horde to support Sieve Ingo backend. As usual we’ll be updating third-party Plesk components once more right before release.

    In Plesk 12.0 you’ll be able to manage Sieve filters via both Roundcube and Horde right out of the box, no additional customization required.

    Reply

  3. James -

    Very glad to see this feature! Any idea when this become a stable release?

    Reply

    Nikolay Vizovitin -

    Nice to see you’re interested in it, James!

    However, you’ll have to wait for official announcements about release dates. It’s a relatively long way from here. Is 11.5.30 stable yet? 😉

    For now you may try out the preview version and give us your feedback. We’ll be releasing new preview versions roughly biweekly.

    Reply

  4. spider -

    YES! finally!!!

    Reply

  5. Brian Craigie -

    Happy happy!

    How can we be notified when 11.6.4 is officially released? Is there a something we can sign up to so we can be notified?

    Thanks 🙂

    Reply

    admin -

    Hi, you can subscribe for Service Provider Newsletter in http://www.parallels.com/about/subscribe/
    Once this new version is released, it will be definitely announced

    Reply

  6. linuxuser1978 -

    Hello,

    what is with Clamav ??

    I see only commercial AntiVirus Engine (KAV and Dr.Web ??

    With pyzor, razor and dcc support for Spamassassin ??

    Reply

  7. Martijn -

    This is great! Thanks for listening to the user voice. Now on to DNSSEC support! 🙂

    Reply

    Nikolay Vizovitin -

    Martijn, thanks for your interest in Plesk development!

    If you have any ideas, thoughts or preferences regarding DNSSEC support, feel free to share them on http://plesk.uservoice.com . Thoughtful comments will generally improve our understanding of Plesk users’ needs, thus improving features quality and reducing development time. 🙂

    Don’t hesitate to try out Plesk 12 preview and evaluate Dovecot support, as well as other new features!

    Reply

  8. Eser -

    I just upgraded to Plesk 12.0.18. Switched from Courier to Dovecot. Works perfect. But im missing Sieve. I use the thunderbird sieve plugin, i also tried roundcube. But i cannot access the sieve plugin. Looks like its not even running. How to enable it in Plesk 12?

    Reply

    Nikolay Vizovitin -

    Sieve is enabled by default when you install Dovecot in Plesk. Make sure you are using the correct port (4190) to connect to the ManageSieve server from your mail client. Roundcube shipped with Plesk is also automatically configured to include filters support (outlined in the article) which actually uses Sieve. Also make sure port 4190 is not firewalled on your server or client if you’re using a local mail client.

    Reply

    Eser -

    lsof -i shows me two processes running. telnet myhost 4190 gives me the welcome text for sieve. so yes it runs. but on roundcube it says “Unable to connect to sieve server”.
    Whats wrong?

    Reply

  9. Kingsley -

    GReat thanks for the tutorial

    Reply

  10. Tom -

    Hello.

    I think this forced namespace is a big disadvantage in Courier.
    A lot of clients have various problems with sync and subfolders.

    I think, I could solve this problem for me with dovecot.

    I add a custom conf file:
    /etc/dovecot/conf.d/20-kkbits.conf

    with content:
    # Dovecot My own Config
    namespace inbox {
    separator = .
    prefix =
    inbox = yes
    }

    With this I override the namespace that is define in:
    /etc/dovecot/conf.d

    # Default private namespace setup compatible with Courier-IMAP.
    namespace inbox {
    separator = .
    prefix = INBOX.
    inbox = yes
    }

    I could not easily remove namespace inbox in /etc/dovecot/conf.d because of:
    # PLEASE DON’T EDIT ANYTHING IN THIS FILE! ANY CHANGES WILL BE LOST ON UPGRADE.

    Is there any conflict or problem in Mailfolders, Panel, Updates or other issues with this method ?

    I tested this method in existing Testmailboxes on various clients and I still had no problem.

    Thank you

    Reply

  11. Mèz -

    Hello ;

    I just want know , how safe is the passage from courier -imap to Devecot , we are having some 110 Go of mails , and what would be the changes to do on outlook’s 2013 configuration ?

    Thank you Guys

    Reply

  12. John Stephens -

    Hello,
    you said “If you feel you need this feature (POP3 before SMTP), drop a note in the comments below explaining why you need it and I’ll consider writing a post that will explain why using POP3 before SMTP is bad and how to implement it manually.”

    The reason we would like to have it is that if we migrate from a server/services where the current users already have set up their email clients to work in that manner, losing that option would make their emails clients unable to send emails.

    Would you share how it is possible to set up dovecot, postfix and plesk to have this enabled?

    Reply

    Nikolay Vizovitin -

    Sure, but I’ll need some time to dig up the solution and post it. Hang tight 🙂

    Reply

    John Stephens -

    Thank you, waiting for a sollution.

    Reply

    Nikolay Vizovitin -

    I’ve posted up the example configuration and a short guide at https://bitbucket.org/vizovitin/dovecot-conf-examples/src/tip/pop3-before-smtp/?at=default

    However it needs to be made crystal clear: this is not an officially supported feature, it may (an will) be removed in some future release. Plesk doesn’t support POP3 before SMTP with Dovecot for a good reason – it’s actually a security risk and shouldn’t be used nowadays. Please consider phasing out support of this mail feature for you customers in the near future.

    Sorry for such a long delay in reply. Unfortunately I got very sick shortly after I got your question and couldn’t get back to you.

    Reply

  13. Dirk Aldekamp -

    Dovecot supports Shared Folders as far as i know. So if i Switch to Dovecot in Plesk i will be able to Setup this Feature (over the Shell not the GUI)?

    Reply

  14. Leo -

    I really need an help, please.

    I use PLESK 12.0.18+ DOVECOT 2.2.X ROUNDCUBE 1.0.5

    All works fine for 30-45 minutes then start with errors, all the same:

    [27-May-2015 13:36:24 +0200]: IMAP Error: Login failed for [email protected] from xxx.xxx.117.225(X-Real-IP: xxx.xxx.117.225). Could not connect to ssl://mail.xxxxxit:993: Empty startup greeting in /usr/share/psa-roundcube/program/lib/Roundcube/rcube_imap.php on line 184 (POST /?_task=mail&_action=refresh?_task=&_action=)

    After 1 error the webmail is unusable (slow or random imap connection error) until i restart DOVECOT
    I tried change with localhost:143
    Nothing change

    Please help!

    Reply

    Leo -

    Solved.

    by the way ty

    Reply

    Guillermo Rey -

    I have the same issue. How can you fix it?

    best regards.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *