Using egrep in /var/spool/postfix returns no results
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
-1
down vote
favorite
My machine is using CentOS 7.1. I'm trying to search through all the files within /var/spool/postfix
.
The way I'm trying to achieve this is with:
$ egrep -lir --include="*.*" "somemail@somedomain.com" ./ > /root/results.txt
However, that search always comes back empty (results.txt
is created, but there's nothing inside). Thinking that there might be a problem with @
, or the --include
, I've reduced the search to:
$ egrep -lir "somedomain.com" ./ > /root/results.txt
But that gives no results as well. I'm positive that there's at least ONE file with the string I'm looking for, so there should be at least one result within the *.txt.
How can I find the files containing the desired string, by using egrep
? If that's not possible, any other searching method is welcome.
Why I need this / Background
Due to poor choice of email account and password, the machine was used to send around 500k spam messages, which started bouncing back pretty quickly, filling up the HDD. The offensive email account was deleted, the machine taken offline, and now I'm trying to hunt down a specific email message, among all those in /var/spool/postfix/defer
and /var/spool/postfix/deferred
.
I gues I could use a variant of mailq > /root/results.txt
, but I'd like to do it with egrep, grep, find
or any other command which returns already filtered results.
shell postfix search
add a comment |Â
up vote
-1
down vote
favorite
My machine is using CentOS 7.1. I'm trying to search through all the files within /var/spool/postfix
.
The way I'm trying to achieve this is with:
$ egrep -lir --include="*.*" "somemail@somedomain.com" ./ > /root/results.txt
However, that search always comes back empty (results.txt
is created, but there's nothing inside). Thinking that there might be a problem with @
, or the --include
, I've reduced the search to:
$ egrep -lir "somedomain.com" ./ > /root/results.txt
But that gives no results as well. I'm positive that there's at least ONE file with the string I'm looking for, so there should be at least one result within the *.txt.
How can I find the files containing the desired string, by using egrep
? If that's not possible, any other searching method is welcome.
Why I need this / Background
Due to poor choice of email account and password, the machine was used to send around 500k spam messages, which started bouncing back pretty quickly, filling up the HDD. The offensive email account was deleted, the machine taken offline, and now I'm trying to hunt down a specific email message, among all those in /var/spool/postfix/defer
and /var/spool/postfix/deferred
.
I gues I could use a variant of mailq > /root/results.txt
, but I'd like to do it with egrep, grep, find
or any other command which returns already filtered results.
shell postfix search
mailq|grep mail@domain maybe? or grep -r mail@domain * maybe?
â stoney
Jul 19 at 13:01
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
My machine is using CentOS 7.1. I'm trying to search through all the files within /var/spool/postfix
.
The way I'm trying to achieve this is with:
$ egrep -lir --include="*.*" "somemail@somedomain.com" ./ > /root/results.txt
However, that search always comes back empty (results.txt
is created, but there's nothing inside). Thinking that there might be a problem with @
, or the --include
, I've reduced the search to:
$ egrep -lir "somedomain.com" ./ > /root/results.txt
But that gives no results as well. I'm positive that there's at least ONE file with the string I'm looking for, so there should be at least one result within the *.txt.
How can I find the files containing the desired string, by using egrep
? If that's not possible, any other searching method is welcome.
Why I need this / Background
Due to poor choice of email account and password, the machine was used to send around 500k spam messages, which started bouncing back pretty quickly, filling up the HDD. The offensive email account was deleted, the machine taken offline, and now I'm trying to hunt down a specific email message, among all those in /var/spool/postfix/defer
and /var/spool/postfix/deferred
.
I gues I could use a variant of mailq > /root/results.txt
, but I'd like to do it with egrep, grep, find
or any other command which returns already filtered results.
shell postfix search
My machine is using CentOS 7.1. I'm trying to search through all the files within /var/spool/postfix
.
The way I'm trying to achieve this is with:
$ egrep -lir --include="*.*" "somemail@somedomain.com" ./ > /root/results.txt
However, that search always comes back empty (results.txt
is created, but there's nothing inside). Thinking that there might be a problem with @
, or the --include
, I've reduced the search to:
$ egrep -lir "somedomain.com" ./ > /root/results.txt
But that gives no results as well. I'm positive that there's at least ONE file with the string I'm looking for, so there should be at least one result within the *.txt.
How can I find the files containing the desired string, by using egrep
? If that's not possible, any other searching method is welcome.
Why I need this / Background
Due to poor choice of email account and password, the machine was used to send around 500k spam messages, which started bouncing back pretty quickly, filling up the HDD. The offensive email account was deleted, the machine taken offline, and now I'm trying to hunt down a specific email message, among all those in /var/spool/postfix/defer
and /var/spool/postfix/deferred
.
I gues I could use a variant of mailq > /root/results.txt
, but I'd like to do it with egrep, grep, find
or any other command which returns already filtered results.
shell postfix search
edited Jul 19 at 21:51
slmâ¦
232k65479649
232k65479649
asked Jul 19 at 12:50
FiddlingAway
14
14
mailq|grep mail@domain maybe? or grep -r mail@domain * maybe?
â stoney
Jul 19 at 13:01
add a comment |Â
mailq|grep mail@domain maybe? or grep -r mail@domain * maybe?
â stoney
Jul 19 at 13:01
mailq|grep mail@domain maybe? or grep -r mail@domain * maybe?
â stoney
Jul 19 at 13:01
mailq|grep mail@domain maybe? or grep -r mail@domain * maybe?
â stoney
Jul 19 at 13:01
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
The GNU grep
can do the regular expression searches using the -E
switch, so there's no need to use egrep
.
I'd do the following:
$ grep -rilE 'somemail@somedomain.com' . | tee /root/results.txt
You can change out the | tee
with a >
if you don't want to see the results via the terminal.
References
- What is the difference between `grep`, `egrep`, and `fgrep`?
What's the practical difference between this suggestion and the OP's ownegrep -lir "somedomain.com" ./
?
â roaima
Jul 19 at 23:18
@roaima - this uses-E
and uses single ticks, the OP had double.
â slmâ¦
Jul 20 at 0:06
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
The GNU grep
can do the regular expression searches using the -E
switch, so there's no need to use egrep
.
I'd do the following:
$ grep -rilE 'somemail@somedomain.com' . | tee /root/results.txt
You can change out the | tee
with a >
if you don't want to see the results via the terminal.
References
- What is the difference between `grep`, `egrep`, and `fgrep`?
What's the practical difference between this suggestion and the OP's ownegrep -lir "somedomain.com" ./
?
â roaima
Jul 19 at 23:18
@roaima - this uses-E
and uses single ticks, the OP had double.
â slmâ¦
Jul 20 at 0:06
add a comment |Â
up vote
1
down vote
The GNU grep
can do the regular expression searches using the -E
switch, so there's no need to use egrep
.
I'd do the following:
$ grep -rilE 'somemail@somedomain.com' . | tee /root/results.txt
You can change out the | tee
with a >
if you don't want to see the results via the terminal.
References
- What is the difference between `grep`, `egrep`, and `fgrep`?
What's the practical difference between this suggestion and the OP's ownegrep -lir "somedomain.com" ./
?
â roaima
Jul 19 at 23:18
@roaima - this uses-E
and uses single ticks, the OP had double.
â slmâ¦
Jul 20 at 0:06
add a comment |Â
up vote
1
down vote
up vote
1
down vote
The GNU grep
can do the regular expression searches using the -E
switch, so there's no need to use egrep
.
I'd do the following:
$ grep -rilE 'somemail@somedomain.com' . | tee /root/results.txt
You can change out the | tee
with a >
if you don't want to see the results via the terminal.
References
- What is the difference between `grep`, `egrep`, and `fgrep`?
The GNU grep
can do the regular expression searches using the -E
switch, so there's no need to use egrep
.
I'd do the following:
$ grep -rilE 'somemail@somedomain.com' . | tee /root/results.txt
You can change out the | tee
with a >
if you don't want to see the results via the terminal.
References
- What is the difference between `grep`, `egrep`, and `fgrep`?
answered Jul 19 at 13:29
slmâ¦
232k65479649
232k65479649
What's the practical difference between this suggestion and the OP's ownegrep -lir "somedomain.com" ./
?
â roaima
Jul 19 at 23:18
@roaima - this uses-E
and uses single ticks, the OP had double.
â slmâ¦
Jul 20 at 0:06
add a comment |Â
What's the practical difference between this suggestion and the OP's ownegrep -lir "somedomain.com" ./
?
â roaima
Jul 19 at 23:18
@roaima - this uses-E
and uses single ticks, the OP had double.
â slmâ¦
Jul 20 at 0:06
What's the practical difference between this suggestion and the OP's own
egrep -lir "somedomain.com" ./
?â roaima
Jul 19 at 23:18
What's the practical difference between this suggestion and the OP's own
egrep -lir "somedomain.com" ./
?â roaima
Jul 19 at 23:18
@roaima - this uses
-E
and uses single ticks, the OP had double.â slmâ¦
Jul 20 at 0:06
@roaima - this uses
-E
and uses single ticks, the OP had double.â slmâ¦
Jul 20 at 0:06
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%2f457212%2fusing-egrep-in-var-spool-postfix-returns-no-results%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
mailq|grep mail@domain maybe? or grep -r mail@domain * maybe?
â stoney
Jul 19 at 13:01