Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Clearing out a bunch of spam with spoofed emails that were bounced back to some poor guy with a catchall email

We don't really want to delete them all just in case.

   1  
   2  cd /usr/local/scratch/
   3  mkdir junk
   4  find /var/spool/postfix -exec grep "somediscernible-feature.com" '{}' \; | awk '{print($3)}' | xargs -J X mv X ./junk/


The "find" produces

   1  
   2  Binary file /var/spool/postfix/active/D/D8832E38 matches
   3  Binary file /var/spool/postfix/active/D/D78EC1C72 matches
   4  Binary file /var/spool/postfix/active/D/D593D279D matches
   5  Binary file /var/spool/postfix/active/D/D0EB32833 matches


The awk

   1  
   2  /var/spool/postfix/active/D/D8832E38
   3  /var/spool/postfix/active/D/D78EC1C72
   4  /var/spool/postfix/active/D/D593D279D
   5  /var/spool/postfix/active/D/D0EB32833


And then the mv, moves it.
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS