courier-imap 4.3.0 broke webmail on freebsd 5.4

guyu

Registered
Jan 16, 2007
4
0
151
Nightly run of upcp upgraded courier-imap to 4.3.0 from 4.2.1, which broke imap login.

Error message "* BYE [ALERT] Fatal error: Account's mailbox directory is not owned by the
correct uid or gid: No such file or directory"

All cpanel user mail directories are gid:mail, which courier-imap objected to. Changing the
gid to that of the user fixed the problem, although I preferred to downgrade courier-imap
to 4.2.1 which doesn't object to gid mail.
 

Elikster

Well-Known Member
Feb 8, 2003
118
1
168
Known Issue

It is known issue today within Cpanel.

The main culprit is that courier-imap got upgraded on their box from
4.1.1 or 4.2.1 to 4.3.0, which effectively breaks the IMAP accessiblity
due to the user's folder not being owned as user:user instead of
user:mail as it is commonly setup.

The fix for this is to deinstall the local port install of Courier
4.3.0 and then install it by pkg_add -r courier-imap. However on the
FreeBSD 5.x tree, this command will install it properly as follows since
the ports file system got changed:

i386 Version:
pkg_add
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/mail/courier-imap-4.2.1,1.tbz

x86_64 Version:
pkg_add
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-5-stable/mail/courier-imap-4.2.1,1.tbz
 

cPanelNick

Administrator
Staff member
Mar 9, 2015
3,481
35
208
cPanel Access Level
DataCenter Provider
If you have disabled usebsdpkg (removed /var/cpanel/usrbsdpkgs) You should recreate it and run /scripts/courierup --force. We are working on an update for compatibility with the version that the freebsd ports maintainers recently released into ports.
 

cPanelNick

Administrator
Staff member
Mar 9, 2015
3,481
35
208
cPanel Access Level
DataCenter Provider
Builds 18468 or later are now compatible with 4.3.0
Builds 18473 or later are optimized to work with 4.3.0 (no optimizations where lost for earlier versions)
 

nyjimbo

Well-Known Member
Jan 25, 2003
1,135
1
168
New York
WHM 11.11.0 cPanel 11.16.0-S18473 broke our IMAP on Freebsd 6.2 this weekend. We started getting calls on imap failures and so we did the "courierup --force" (note: /var/cpanel/usebsdpkgs was already in place) and saw it spotting and fixing hundreds of bad ownership or permission settings on all the users and then it re-did the 4.3.0 install. I am not sure it even needed to do the whole reinstall as while it was scrolling the screen on one of the system consoles with the ownership/permission thing we noticed we could now log into webmail ok on one account it fixed.

So it appears that the 4.3.0 gets installed with S18473 and breaks imap and you have to do the courierup --force AGAIN to fix it.
 

nyjimbo

Well-Known Member
Jan 25, 2003
1,135
1
168
New York
What is really weird is that any NEW accounts we create in WHM seem to have the wrong permissions for webmail:

Notice: Unknown: [CLOSED] IMAP connection broken (server response) (errflg=1) in Unknown on line 0

Notice: Unknown: [ALERT] Fatal error: Account's mailbox directory is not owned by the correct uid or gid: No such file or directory in Unknown on line 0

Doing another "courierup --force" doesnt seem to fix this.

This is after updating to 11.16.0-CURRENT_18514, we had to go to each affected domain to the mail folder and chown uid:uid for it to work.
 
Last edited:

carlaron

Well-Known Member
Jun 26, 2003
45
0
156
Builds 18468 or later are now compatible with 4.3.0
Builds 18473 or later are optimized to work with 4.3.0 (no optimizations where lost for earlier versions)
This helped me... I think the problem is that courier gets updated automatically, while my cpanel is set to manual/stable (i hate having things upgraded behind my back). The newer courier uses different permissions than the older webmail uses...

I kept reading all these other posts saying to set ownership of the mail folders to
user.mail

and it was already that way.

Then this thread told me that the ownership needs it to be
user.user

I manually fixed one user, and that worked... so the previous posts where actually BACKWARDS.... it may be that with older versions of courier, that was the correct ownership, but not anymore...

I ran the cpanel update, and part of that was to change ownership on ALL accounts to
user.user

and that seems to have worked for all clients!