Using egrep in /var/spool/postfix returns no results

The name of the pictureThe name of the pictureThe name of the pictureClash 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.







share|improve this question





















  • mailq|grep mail@domain maybe? or grep -r mail@domain * maybe?
    – stoney
    Jul 19 at 13:01

















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.







share|improve this question





















  • mailq|grep mail@domain maybe? or grep -r mail@domain * maybe?
    – stoney
    Jul 19 at 13:01













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.







share|improve this question













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.









share|improve this question












share|improve this question




share|improve this question








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

















  • 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











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`?





share|improve this answer





















  • 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










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















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






























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`?





share|improve this answer





















  • 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














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`?





share|improve this answer





















  • 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












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`?





share|improve this answer













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`?






share|improve this answer













share|improve this answer



share|improve this answer











answered Jul 19 at 13:29









slm♦

232k65479649




232k65479649











  • 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
















  • 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















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












 

draft saved


draft discarded


























 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay