Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilherme Filippo
ISPConfig 3
Commits
2b7e04ff
Commit
2b7e04ff
authored
Feb 10, 2010
by
tbrehm
Browse files
Improved dovecot support.
parent
feec447f
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/plugins-available/mail_plugin.inc.php
View file @
2b7e04ff
...
...
@@ -139,12 +139,14 @@ class mail_plugin {
$app
->
log
(
"Set ownership on "
.
escapeshellcmd
(
$data
[
'new'
][
'maildir'
]),
LOGLEVEL_DEBUG
);
//* This is to fix the maildrop quota not being rebuilt after the quota is changed.
exec
(
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$maildomain_path
)
.
"' "
.
$mail_config
[
'mailuser_name'
]);
// Avoid maildirmake quota bug, see debian bug #214911
$app
->
log
(
'Created Maildir: '
.
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$maildomain_path
)
.
"' "
.
$mail_config
[
'mailuser_name'
],
LOGLEVEL_DEBUG
);
if
(
$mail_config
[
'pop3_imap_daemon'
]
!=
'dovecot'
)
{
exec
(
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$maildomain_path
)
.
"' "
.
$mail_config
[
'mailuser_name'
]);
// Avoid maildirmake quota bug, see debian bug #214911
$app
->
log
(
'Created Maildir: '
.
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$maildomain_path
)
.
"' "
.
$mail_config
[
'mailuser_name'
],
LOGLEVEL_DEBUG
);
}
}
//* Set the maildir quota
if
(
is_dir
(
$data
[
'new'
][
'maildir'
]
.
'/new'
))
{
if
(
is_dir
(
$data
[
'new'
][
'maildir'
]
.
'/new'
)
&&
$mail_config
[
'pop3_imap_daemon'
]
!=
'dovecot'
)
{
exec
(
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$data
[
'new'
][
'maildir'
])
.
"' "
.
$mail_config
[
'mailuser_name'
]);
$app
->
log
(
'Set Maildir quota: '
.
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$data
[
'new'
][
'maildir'
])
.
"' "
.
$mail_config
[
'mailuser_name'
],
LOGLEVEL_DEBUG
);
}
...
...
@@ -219,8 +221,10 @@ class mail_plugin {
exec
(
'chown -R '
.
$mail_config
[
'mailuser_name'
]
.
':'
.
$mail_config
[
'mailuser_group'
]
.
' '
.
escapeshellcmd
(
$data
[
'new'
][
'maildir'
]));
$app
->
log
(
"Set ownership on "
.
escapeshellcmd
(
$data
[
'new'
][
'maildir'
]),
LOGLEVEL_DEBUG
);
//* This is to fix the maildrop quota not being rebuilt after the quota is changed.
exec
(
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$maildomain_path
)
.
"' "
.
$mail_config
[
'mailuser_name'
]);
// Avoid maildirmake quota bug, see debian bug #214911
$app
->
log
(
'Updated Maildir quota: '
.
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$maildomain_path
)
.
"' "
.
$mail_config
[
'mailuser_name'
],
LOGLEVEL_DEBUG
);
if
(
$mail_config
[
'pop3_imap_daemon'
]
!=
'dovecot'
)
{
exec
(
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$maildomain_path
)
.
"' "
.
$mail_config
[
'mailuser_name'
]);
// Avoid maildirmake quota bug, see debian bug #214911
$app
->
log
(
'Updated Maildir quota: '
.
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$maildomain_path
)
.
"' "
.
$mail_config
[
'mailuser_name'
],
LOGLEVEL_DEBUG
);
}
}
// Move mailbox, if domain has changed and delete old mailbox
...
...
@@ -237,15 +241,10 @@ class mail_plugin {
}
//This is to fix the maildrop quota not being rebuilt after the quota is changed.
// Courier Layout
if
(
is_dir
(
$data
[
'new'
][
'maildir'
]
.
'/new'
))
{
if
(
is_dir
(
$data
[
'new'
][
'maildir'
]
.
'/new'
)
&&
$mail_config
[
'pop3_imap_daemon'
]
!=
'dovecot'
)
{
exec
(
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$data
[
'new'
][
'maildir'
])
.
"' "
.
$mail_config
[
'mailuser_name'
]);
$app
->
log
(
'Updated Maildir quota: '
.
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$data
[
'new'
][
'maildir'
])
.
"' "
.
$mail_config
[
'mailuser_name'
],
LOGLEVEL_DEBUG
);
}
// Dovecot Layout
if
(
is_dir
(
$data
[
'new'
][
'maildir'
]
.
'/Maildir/new'
))
{
exec
(
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$data
[
'new'
][
'maildir'
])
.
"/Maildir' "
.
$mail_config
[
'mailuser_name'
]);
$app
->
log
(
'Updated Maildir quota: '
.
"su -c 'maildirmake -q "
.
$data
[
'new'
][
'quota'
]
.
"S "
.
escapeshellcmd
(
$data
[
'new'
][
'maildir'
])
.
"/Maildir' "
.
$mail_config
[
'mailuser_name'
],
LOGLEVEL_DEBUG
);
}
}
function
user_delete
(
$event_name
,
$data
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment