Handle maildir-format dis under /var/spool/mail https://sourceforge.net/p/webadmin/bugs/4305/

This commit is contained in:
Jamie Cameron
2013-10-08 21:29:06 -07:00
parent cad6e3e2dd
commit 70f3d7ca7d
2 changed files with 7 additions and 2 deletions

View File

@@ -1659,6 +1659,9 @@ else {
}
# mail_file_style(user, basedir, style)
# Given a directory and username, returns the path to that user's mail file
# under the directory based on the style (which may force use of parts of
# the username).
sub mail_file_style
{
if ($_[2] == 0) {

View File

@@ -99,10 +99,12 @@ else {
'index' => scalar(@rv) } );
}
# Check for /var/mail/USERNAME file
# Check for /var/mail/USERNAME file or directory
if ($dir) {
$dir =~ s/\/$//; # Trailing / means maildir format.
# Postfix sometimes does this.
local $mf = &mail_file_style($uinfo[0], $dir, $style);
push(@rv, { 'type' => 0,
push(@rv, { 'type' => -d $mf ? 1 : 0,
'name' => $mf,
'file' => $mf,
'user' => $uinfo[0],