Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
domainepublic
alternc
Commits
92965e64
Commit
92965e64
authored
Aug 25, 2012
by
Alan Garcia
Browse files
Mail deletion
parent
09e0234e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Makefile
View file @
92965e64
...
...
@@ -25,8 +25,8 @@
# Purpose of file: Makefile des binaires de /usr/lib/alternc
# ----------------------------------------------------------------------
#
SETUID
=
mail_add mail_del
quota_edit quota_get mem_add mem_del du.pl
SCRIPTS
=
sqlbackup.sh rawstat.daily quota_init quota_delete update_domains.sh slave_dns sendmail spoolsize.php fixperms.sh alternc-dboptimize export_account.php cron_users_doit.sh cron_users.sh compress_logs.sh delete_logs.sh quota-warning.sh
SETUID
=
quota_edit quota_get mem_add mem_del du.pl
SCRIPTS
=
sqlbackup.sh rawstat.daily quota_init quota_delete update_domains.sh slave_dns sendmail spoolsize.php fixperms.sh alternc-dboptimize export_account.php cron_users_doit.sh cron_users.sh compress_logs.sh delete_logs.sh quota-warning.sh
mail_deletion.sh
LIBS
=
functions.sh functions_hosting.sh functions_dns.sh
BIN
=
$(DESTDIR)
/usr/lib/alternc/
...
...
src/mail_deletion.sh
View file @
92965e64
...
...
@@ -31,6 +31,10 @@ elif [ -f "$LOCK_FILE" ]; then
fi
fi
# If there is ionice, add it to the command line
ionice
=
""
ionice
>
/dev/null
&&
ionice
=
"ionice -c 3 "
# We lock the application
echo
$$
>
"
$LOCK_FILE
"
...
...
@@ -44,8 +48,17 @@ mysql_query "SELECT id, quote(replace(path,'!','\\!')) FROM mailbox WHERE mail_a
echo
"Error : this directory will not be deleted, pattern incorrect"
continue
fi
test
-d
$path
&&
nice
10
rm
-rf
$path
mysql_query
"DELETE FROM mailbox WHERE id=
$id
;"
# If no dir, DELETE
# If dir and rm ok, DELETE
# Other case, do nothing
if
[
-d
$path
]
;
then
$ionice
rm
-rf
$path
&&
mysql_query
"DELETE FROM mailbox WHERE id=
$id
AND mail_action='DELETING';"
# Do the rm again in case of newly added file during delete. Should not be usefull
test
-d
$path
&&
$ionice
rm
-rf
$path
else
mysql_query
"DELETE FROM mailbox WHERE id=
$id
AND mail_action='DELETING';"
fi
done
# List the adresses to DELETE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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