Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
config
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Operate
Environments
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai3
config
Merge requests
!249
Add 'wipe-mailbox' action to the queue system
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add 'wipe-mailbox' action to the queue system
enq-wipe-mailbox
into
master
Overview
0
Commits
4
Pipelines
4
Changes
3
Merged
ale
requested to merge
enq-wipe-mailbox
into
master
7 months ago
Overview
0
Commits
4
Pipelines
4
Changes
3
Expand
0
0
Merge request reports
Compare
master
version 3
a6d42587
7 months ago
version 2
34d610f8
7 months ago
version 1
cbaa69c0
7 months ago
master (base)
and
latest version
latest version
b9ebbac5
4 commits,
7 months ago
version 3
a6d42587
3 commits,
7 months ago
version 2
34d610f8
2 commits,
7 months ago
version 1
cbaa69c0
1 commit,
7 months ago
3 files
+
97
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
roles/queue/files/wipe-mailbox.sh
0 → 100644
+
48
−
0
Options
#!/bin/bash
confirm
=
0
mailbox
=
while
[
$#
-gt
0
]
;
do
case
"
$1
"
in
--yes-i-am-sure
)
confirm
=
1
;;
-
*
)
echo
"Unkown option
$1
"
>
&2
exit
2
;;
*
)
# First argument is the mailbox name.
if
[
-n
"
${
mailbox
}
"
]
;
then
echo
"Too many arguments "
>
&2
exit
2
fi
mailbox
=
"
$1
"
;;
esac
shift
done
if
[
-z
"
${
mailbox
}
"
]
;
then
echo
"Usage:
$0
<mailbox>"
>
&2
exit
2
fi
if
[
$confirm
-ne
1
]
;
then
echo
"You did not pass the confirmation option --yes-i-am-sure!"
>
&2
exit
1
fi
set
-euo
pipefail
# Get the list of mailboxes in an array.
readarray
-t
mailbox_list < <
(
doveadm mailbox list
-u
${
mailbox
}
2>&1
)
# Expunge each one.
for
m
in
"
${
mailbox_list
[@]
}
"
;
do
doveadm mailbox expunge
-u
"
${
mailbox
}
"
mailbox
"
${
m
}
"
all
done
doveadm purge
-u
"
${
mailbox
}
"
exit
0
Loading