dovecot.conf not including conf.d/*.conf

  • Hi,


    I tried to debug some Dovecot imap login issues, but changing anything in /etc/dovecot/conf.d/10-logging.conf didn't work.
    While checking /etc/dovecot/dovecot.conf i noticed there's no include line for the files in conf.d. Is that for a reason or is this a bug?



    using
    - i-MSCP 1.3.0
    - Ubuntu 16.04.1 LTS

  • @DSX


    i-MSCP configures dovecot using only two files which are:


    • /etc/dovecot/dovecot.conf
    • /etc/dovecot/dovecot-sql.conf

    Other files are not used.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • I see. Does that mean when i add a include statement in /etc/dovecot/dovecot.conf, that will be undone when i do a re-config or update of i-MSCP?
    If so, what would be the recommended way to make that change persistent? (is this what your Listener Files are for?)


    Thank you.

  • @DSX



    I see. Does that mean when i add a include statement in /etc/dovecot/dovecot.conf, that will be undone when i do a re-config or update of i-MSCP?

    Yes ;)



    If so, what would be the recommended way to make that change persistent? (is this what your Listener Files are for?)


    Indeed, the listener files (which hold event listeners) allow to inject your exotic changes and make them persistent.


    You could create the following listener to inject your configuration snippet automatically in the /etc/dovecot/dovecot.conf file:



    /etc/imscp/listeners.d/10_dovecot_include.pl:

    Perl
    1. #!/usr/bin/perlpackage Listener::Dovecot::Include;use strict;use warnings;use iMSCP::EventManager;iMSCP::EventManager->getInstance()->register( 'beforePoBuildConf', sub { my ($cfgTpl, $tplName) = @_; return 0 unless index( $tplName, 'dovecot.conf' ) != -1; $$cfgTpl.= <<'EOF';# Added by Listener::Dovecot::Include listener!include <whatever_existent_file_you_want>EOF 0; });1;__END__

    Note: You must not forget to replace <whatever_existent_file_you_want> by your file path.


    Then, to activate that listener:

    Code
    1. # perl /var/www/imscp/engine/setup/imscp-reconfigure -danv

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Awesome, thank you very much! 8)



    There are 2 typos in your example tho:


    line 3: Package Listener::Dovecot::Include; should be package Listener::Dovecot::Include;
    line 7: use iMSCP::EventManager, should be use iMSCP::EventManager;

  • @DSX


    Fixed. Sorry. I've written this only for educational purpose ( like a pig, I have to admit :D ).

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Lol, no problem. Mistakes happen and besides that, i don't have any problem thinking for myself when something is not working as it is supposed to work. I might even learn a thing or two about perl. ^^