maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   reading GnuPG / OpenPGP encrypted emails on the N9 / N950 (https://talk.maemo.org/showthread.php?t=83229)

roman4 2012-03-24 20:26

reading GnuPG / OpenPGP encrypted emails on the N9 / N950
 
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...

wirwe 2012-04-12 18:54

Re: reading GnuPG / OpenPGP encrypted emails on the N9 / N950
 
does this also work for the n9?
i didn't find a usable gpg-mail-decrypt-app for the n9 either.

roman4 2012-04-12 19:13

Re: reading GnuPG / OpenPGP encrypted emails on the N9 / N950
 
Quote:

Originally Posted by wirwe (Post 1191313)
does this also work for the n9?

Yes, it should also work for the N9.

Dead1nside 2012-04-14 11:25

Re: reading GnuPG / OpenPGP encrypted emails on the N9 / N950
 
Thanks for this. I was looking for a solution.

benny1967 2012-05-03 18:36

Re: reading GnuPG / OpenPGP encrypted emails on the N9 / N950
 
Can I GPG-sign mails before i send them?


All times are GMT. The time now is 07:04.

vBulletin® Version 3.8.8