Skip to content

Instantly share code, notes, and snippets.

@racerxdl
Created May 21, 2014 17:50
Show Gist options
  • Save racerxdl/9716a504c38c80dcea64 to your computer and use it in GitHub Desktop.
Save racerxdl/9716a504c38c80dcea64 to your computer and use it in GitHub Desktop.
Shell script to move emails from wrong folders
#!/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