Suspend email delivery during account archiving

GLPI #48692
This commit is contained in:
Daniel Berteaud 2021-03-08 08:14:32 +01:00
parent ce4d4efaee
commit 3f8d0c636a
1 changed files with 3 additions and 0 deletions

View File

@ -123,6 +123,9 @@ foreach my $u (@delete){
}
my $archive = $user->prop('ExpireArchiveBeforeDelete') || 'yes';
if ( $archive =~ m/^yes|enabled|1|on$/ ){
# Suspend email delivery, prevent tar ending with exit code 1
# because Maildir changed during archive
system('chmod', '+t', getpwnam($u)->dir)
my $tar = $archive_path . '/' . $u . '-' . $now->ymd . '.tar.' . $archive_ext;
my $res = system(
'tar',