Created
May 21, 2014 17:50
-
-
Save racerxdl/9716a504c38c80dcea64 to your computer and use it in GitHub Desktop.
Shell script to move emails from wrong folders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in folder/* | |
do | |
if grep -q "Delivered-To: email@nobody" "$i" | |
then | |
mv "$i" destfolder/ | |
else | |
echo "NOK" # Doesnt have Delivery To | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment