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 #4120

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions bin/v-import-cpanel
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,17 @@ for folder in *; do
$BIN/v-add-mail-account $new_user $folder $mail_account $tmp_pass
mv $mail_account /home/$new_user/mail/$folder/
chown -R $new_user:mail /home/$new_user/mail/$folder/

# Decompress gzipped emails
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
gunzip -c "$mail_file" > "${mail_file}.decompressed" && mv "${mail_file}.decompressed" "$mail_file"
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
pass=$(grep "^$mail_account:" ../../etc/${folder}/shadow | awk -F ":" '{print $2}')
USER_DATA=$HESTIA/data/users/$new_user/
Expand Down