The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Dovecot Custom Configuration.

Discussion in 'E-mail Discussions' started by mpkapadia, May 19, 2014.

  1. mpkapadia

    mpkapadia Active Member

    Joined:
    Apr 10, 2002
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Have you seen the settings located here:
    WHM » Service Configuration » Mailserver Configuration
     
  3. mpkapadia

    mpkapadia Active Member

    Joined:
    Apr 10, 2002
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Oops .
    My bad. It lets me do exactly what I wanted to .

    Thanks a lot.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You're welcome.
     
  5. visualmtb

    visualmtb Member

    Joined:
    Aug 12, 2011
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  7. visualmtb

    visualmtb Member

    Joined:
    Aug 12, 2011
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  8. visualmtb

    visualmtb Member

    Joined:
    Aug 12, 2011
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    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!
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  10. visualmtb

    visualmtb Member

    Joined:
    Aug 12, 2011
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
Loading...

Share This Page