Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update v-import-cpanel #4139

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion bin/v-import-cpanel
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,15 @@ for folder in *; do
decompressed_count=0
for mail_file in $(find /home/$new_user/mail/$folder -type f); do
if file "$mail_file" | grep -q "gzip compressed"; then
original_time=$(stat -c %y "$mail_file" 2>/dev/null)
gunzip -c "$mail_file" > "${mail_file}.decompressed" && mv "${mail_file}.decompressed" "$mail_file"
let decompressed_count++
if [ ! -z "$original_time" ]; then
touch -d "$original_time" "$mail_file"
fi
let decompressed_count++
fi
done

echo "$decompressed_count emails decompressed for $mail_account@$folder"

find /home/$new_user/mail/$folder -type f -name 'dovecot*' -delete
Expand Down