View Single Post
Posts: 5 | Thanked: 8 times | Joined on Jun 2010
#1
Since there is no native support and I could not find any other way to read my PGP encrypted emails on my N950 I like to share the work-around solution I find useful for me:
  • install less by apt-get install less (not sure if it is already pre-installed?)
  • put your OpenPGP keys into /home/user/.gnupg
  • put the following script to /home/user/decrypt:
    Code:
    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
  • create a desktop icon by putting the following content into /usr/share/applications/decrypt.desktop:
    Code:
    [Desktop Entry]
    Encoding=UTF-8
    Type=Application
    Name=Decrypt
    Exec=/usr/bin/meego-terminal -n -e sh /home/user/decrypt
    Icon=icon-l-terminal

The script searches for all encrypted email you received during the last day. If you want to increase the period, just change MAXAGE in /home/user/decrypt.

I hope this is useful for somebody else...
 

The Following 6 Users Say Thank You to roman4 For This Useful Post: