Is it a correct way to clear the exim mail queue?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I use the following command to delete the exim mail queues
exiqgrep -i | xargs exim -Mrm
or
# following commands seems to work faster compared to the above.
exim -bpru | awk 'print $3' | xargs exim -Mrm
But the above commands do not work when the mail queue size is more than 100,000. It get stuck. So, I am using the following script which works fine regardless of the number of mails in the queue.
My question is, will it delete correctly ?
/etc/init.d/exim stop;
sleep 10;
killall -9 exim eximd
sleep 5;
#clean out the mail queue
find /var/spool/exim -mindepth 2 -type f -exec rm -rfv ;
#clean out the mail db files
find /var/spool/exim/db -type f -exec rm -rvf ;
/etc/init.d/exim restart
linux email exim cpanel
add a comment |Â
up vote
3
down vote
favorite
I use the following command to delete the exim mail queues
exiqgrep -i | xargs exim -Mrm
or
# following commands seems to work faster compared to the above.
exim -bpru | awk 'print $3' | xargs exim -Mrm
But the above commands do not work when the mail queue size is more than 100,000. It get stuck. So, I am using the following script which works fine regardless of the number of mails in the queue.
My question is, will it delete correctly ?
/etc/init.d/exim stop;
sleep 10;
killall -9 exim eximd
sleep 5;
#clean out the mail queue
find /var/spool/exim -mindepth 2 -type f -exec rm -rfv ;
#clean out the mail db files
find /var/spool/exim/db -type f -exec rm -rvf ;
/etc/init.d/exim restart
linux email exim cpanel
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I use the following command to delete the exim mail queues
exiqgrep -i | xargs exim -Mrm
or
# following commands seems to work faster compared to the above.
exim -bpru | awk 'print $3' | xargs exim -Mrm
But the above commands do not work when the mail queue size is more than 100,000. It get stuck. So, I am using the following script which works fine regardless of the number of mails in the queue.
My question is, will it delete correctly ?
/etc/init.d/exim stop;
sleep 10;
killall -9 exim eximd
sleep 5;
#clean out the mail queue
find /var/spool/exim -mindepth 2 -type f -exec rm -rfv ;
#clean out the mail db files
find /var/spool/exim/db -type f -exec rm -rvf ;
/etc/init.d/exim restart
linux email exim cpanel
I use the following command to delete the exim mail queues
exiqgrep -i | xargs exim -Mrm
or
# following commands seems to work faster compared to the above.
exim -bpru | awk 'print $3' | xargs exim -Mrm
But the above commands do not work when the mail queue size is more than 100,000. It get stuck. So, I am using the following script which works fine regardless of the number of mails in the queue.
My question is, will it delete correctly ?
/etc/init.d/exim stop;
sleep 10;
killall -9 exim eximd
sleep 5;
#clean out the mail queue
find /var/spool/exim -mindepth 2 -type f -exec rm -rfv ;
#clean out the mail db files
find /var/spool/exim/db -type f -exec rm -rvf ;
/etc/init.d/exim restart
linux email exim cpanel
linux email exim cpanel
asked Feb 19 '16 at 10:54
Mani
201817
201817
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
4
down vote
I believe you are looking for this...
service exim stop
rm -fvr /var/spool/exim/input
service exim restart
However a slightly more sane method is to remove the messages on a per user basis...
egrep -Rl "((`pwd | cut -d / -f3`|$(grep `pwd | cut -d / -f3` /etc/userdomains | cut -d : -f1 | tr 'n' '|' | sed 's/|$//g'))|/home/`pwd | cut -d / -f3`)|X-Failed-Recipients" /var/spool/exim/input --include='*-H' | awk -F "/" 'gsub("-[A-Z]$","");print$NF' | xargs exim -Mrm
add a comment |Â
up vote
0
down vote
In addition, to delete the emails of a specific user:
grep -lr 'user@domain.com' /var/spool/exim/input/ |
sed -e 's/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g' |
xargs exim -Mrm
exim -bp |
grep "user_email-account" |
awk 'print $3' |
xargs exim -Mrm
add a comment |Â
up vote
0
down vote
To remove all messages from the queue, enter:
# exim -bp | awk '/^ *[0-9]+[mhd]/print "exim -Mrm " $3' | bash
New contributor
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
I believe you are looking for this...
service exim stop
rm -fvr /var/spool/exim/input
service exim restart
However a slightly more sane method is to remove the messages on a per user basis...
egrep -Rl "((`pwd | cut -d / -f3`|$(grep `pwd | cut -d / -f3` /etc/userdomains | cut -d : -f1 | tr 'n' '|' | sed 's/|$//g'))|/home/`pwd | cut -d / -f3`)|X-Failed-Recipients" /var/spool/exim/input --include='*-H' | awk -F "/" 'gsub("-[A-Z]$","");print$NF' | xargs exim -Mrm
add a comment |Â
up vote
4
down vote
I believe you are looking for this...
service exim stop
rm -fvr /var/spool/exim/input
service exim restart
However a slightly more sane method is to remove the messages on a per user basis...
egrep -Rl "((`pwd | cut -d / -f3`|$(grep `pwd | cut -d / -f3` /etc/userdomains | cut -d : -f1 | tr 'n' '|' | sed 's/|$//g'))|/home/`pwd | cut -d / -f3`)|X-Failed-Recipients" /var/spool/exim/input --include='*-H' | awk -F "/" 'gsub("-[A-Z]$","");print$NF' | xargs exim -Mrm
add a comment |Â
up vote
4
down vote
up vote
4
down vote
I believe you are looking for this...
service exim stop
rm -fvr /var/spool/exim/input
service exim restart
However a slightly more sane method is to remove the messages on a per user basis...
egrep -Rl "((`pwd | cut -d / -f3`|$(grep `pwd | cut -d / -f3` /etc/userdomains | cut -d : -f1 | tr 'n' '|' | sed 's/|$//g'))|/home/`pwd | cut -d / -f3`)|X-Failed-Recipients" /var/spool/exim/input --include='*-H' | awk -F "/" 'gsub("-[A-Z]$","");print$NF' | xargs exim -Mrm
I believe you are looking for this...
service exim stop
rm -fvr /var/spool/exim/input
service exim restart
However a slightly more sane method is to remove the messages on a per user basis...
egrep -Rl "((`pwd | cut -d / -f3`|$(grep `pwd | cut -d / -f3` /etc/userdomains | cut -d : -f1 | tr 'n' '|' | sed 's/|$//g'))|/home/`pwd | cut -d / -f3`)|X-Failed-Recipients" /var/spool/exim/input --include='*-H' | awk -F "/" 'gsub("-[A-Z]$","");print$NF' | xargs exim -Mrm
answered Feb 19 '16 at 11:29
rcjohnson
81049
81049
add a comment |Â
add a comment |Â
up vote
0
down vote
In addition, to delete the emails of a specific user:
grep -lr 'user@domain.com' /var/spool/exim/input/ |
sed -e 's/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g' |
xargs exim -Mrm
exim -bp |
grep "user_email-account" |
awk 'print $3' |
xargs exim -Mrm
add a comment |Â
up vote
0
down vote
In addition, to delete the emails of a specific user:
grep -lr 'user@domain.com' /var/spool/exim/input/ |
sed -e 's/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g' |
xargs exim -Mrm
exim -bp |
grep "user_email-account" |
awk 'print $3' |
xargs exim -Mrm
add a comment |Â
up vote
0
down vote
up vote
0
down vote
In addition, to delete the emails of a specific user:
grep -lr 'user@domain.com' /var/spool/exim/input/ |
sed -e 's/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g' |
xargs exim -Mrm
exim -bp |
grep "user_email-account" |
awk 'print $3' |
xargs exim -Mrm
In addition, to delete the emails of a specific user:
grep -lr 'user@domain.com' /var/spool/exim/input/ |
sed -e 's/^.*/([a-zA-Z0-9-]*)-[DH]$/1/g' |
xargs exim -Mrm
exim -bp |
grep "user_email-account" |
awk 'print $3' |
xargs exim -Mrm
edited Mar 15 at 12:28
exhuma
13818
13818
answered Feb 23 '16 at 10:33
A Yashpal
765
765
add a comment |Â
add a comment |Â
up vote
0
down vote
To remove all messages from the queue, enter:
# exim -bp | awk '/^ *[0-9]+[mhd]/print "exim -Mrm " $3' | bash
New contributor
add a comment |Â
up vote
0
down vote
To remove all messages from the queue, enter:
# exim -bp | awk '/^ *[0-9]+[mhd]/print "exim -Mrm " $3' | bash
New contributor
add a comment |Â
up vote
0
down vote
up vote
0
down vote
To remove all messages from the queue, enter:
# exim -bp | awk '/^ *[0-9]+[mhd]/print "exim -Mrm " $3' | bash
New contributor
To remove all messages from the queue, enter:
# exim -bp | awk '/^ *[0-9]+[mhd]/print "exim -Mrm " $3' | bash
New contributor
edited 3 mins ago
slmâ¦
242k66501669
242k66501669
New contributor
answered 10 mins ago
Sheraz Chaudhery
1
1
New contributor
New contributor
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f264318%2fis-it-a-correct-way-to-clear-the-exim-mail-queue%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password