MAXAGE=1 # search for files with GnuPG pattern files=`find /home/user/.qmf/mail/ -mtime -$MAXAGE | xargs grep -l GnuPG` nr_files=`echo $files | wc -w` # search successful? if [ $nr_files -gt 0 ] then # we found OpenPGP encryted files echo "$nr_files encrypted emails found." # loop through all of them for mail in $files do # handle current file #echo "Found "$mail # check if encryption is inline PGP or PGP/MIME attachment if [ `echo $mail | grep parts` ] then # found PGP/MIME # determine main email file by removing -part/2 suffix mainfile=`echo $mail | cut -d'-' -f 1` grep -i -e from: -e subject: $mainfile else # found inline PGP email grep -i -e from: -e subject: $mail fi # ask user whether we decrypt this file read -p "Take this email (Y|n)?" -n1 choice if [ $choice != "n" ] then gpg -d $mail | less exit fi done else echo "No GnuPG encrypted emails found during last $MAXAGE days." | less fi
[Desktop Entry] Encoding=UTF-8 Type=Application Name=Decrypt Exec=/usr/bin/meego-terminal -n -e sh /home/user/decrypt Icon=icon-l-terminal