Dovecot Custom Configuration.

mpkapadia

Active Member
Apr 10, 2002
41
0
306
Hello

I have dedicated server wherein i need to have custom number for pop3 limits per IP.
Its usually set in /etc/dovecot/dovecot.conf.

I am looking to change
mail_max_userip_Connections = 3

to
mail_max_userip_Connections = 6

Now my problem is that with every Cpanel Update this value gets reset.

How can i make the modifications in such a way that it does not get reset on cpanel update.

One way to do it will be chattr +I . This will prevent ANY changes to dovecot configuration file.

But that way if there is any important update for dovecot , i will not get the same.

I want a way for Routine updates to work and at the same time this value to not be reset. Any other place to make this change to accomplish whats needed above.
 

visualmtb

Member
Aug 12, 2011
13
0
51
Hi

I'm having a similar issue, but the settings I need to change in the /etc/dovecot/dovecot.conf are not in WHM » Service Configuration » Mailserver Configuration and every time there are updates or if I make a change using WHM » Service Configuration » Mailserver Configuration then any advanced setting made in dovecot.conf get put back to default values. How can I set the following settings [pop3_uidl_format = %08Xu%08Xv and pop3_client_workarounds = outlook-no-nuls oe-ns-eoh] in dovecot.conf without worrying they will default back.


Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
Hello :)

You can edit the following file for local modifications to the Dovecot configuration:

Code:
/var/cpanel/templates/dovecot2.2/main.local
Note: You can copy this file from /var/cpanel/templates/dovecot2.2/main.default if it does not exist. After making the custom modifications, you must run:

Code:
/scripts/builddovecotconf
Thank you.
 

visualmtb

Member
Aug 12, 2011
13
0
51
Hi Michael,

Thank you, that works! :)

But I'm a bit confused about something, in the main.default file the 2 settings I want to change seem to have a check to see if they are already defined in dovecot.conf:

Code:
[%- IF protocol_pop3.pop3_uidl_format.defined %]
  pop3_uidl_format = [% protocol_pop3.pop3_uidl_format %]
[%- ELSE %]
  #pop3_uidl_format = UID%u-%v
[%- END %]
and

Code:
[%- IF protocol_pop3.pop3_client_workarounds.defined %]
  pop3_client_workarounds = [% protocol_pop3.pop3_client_workarounds %]
[%- ELSE %]
  #pop3_client_workarounds =
[%- END %]
But for some reason they were overwritten when the system updated, shouldn't this code skip the pop3_client_workarounds and pop3_uidl_format settings if they were already defined in dovecot.conf?

Thanks
 

visualmtb

Member
Aug 12, 2011
13
0
51
Hi Michael,

My mistake, the /var/cpanel/templates/dovecot2.2/main.default is combined with the /var/cpanel/conf/dovecot/main file during build not the dovecot.conf file.

Knowing this, can I just add the settings in the /var/cpanel/conf/dovecot/main instead of creating a main.local file, will that do the same thing?

Thanks again for the help!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
You will need to use the /var/cpanel/templates/dovecot2.2/main.local file so that changes are preserved during updates.

Thank you.
 

visualmtb

Member
Aug 12, 2011
13
0
51
Actually from my research if the directives you want to change in the dovecot.conf file exist in the template file: /var/cpanel/templates/dovecot2.2/main.default then the changes you wish to make should be added to the /var/cpanel/conf/dovecot/main. If you create a main.local file in the template folder and dovecot updates, and adds new directives that never existed before the update, then you have to manually update the main.local file you created which is a pain to remember. Since the changes I want to make already exist in the dovecot.conf and template file /var/cpanel/templates/dovecot2.2/main.default I only have to add my changes to the /var/cpanel/conf/dovecot/main.cf

This is from the Dovecot manual:

If the directive you wish to change is already present in the template file, simply provide a value in the main datastore. For example, to change the "lock_method" to "dotlock" add a line like this lock_method: dotlock to /var/cpanel/conf/dovecot/main:

If the directives you want to use in the dovecot.conf file do not exist in the template, copy the main.default template file to one named main.local
Warning
When using this method please note that updates to the dovecot binaries may require matching
updates to the dovecot template file. The dovecot update system does not touch the main.local
template in any way, and it is the responsibility of the administrator to reconcile cPanel's
template changes in main.default with the site specific main.local template.