From 939fcb4f4d4eaff2d1f462270afadc13a95798b4 Mon Sep 17 00:00:00 2001 From: nonamedotc Date: Feb 28 2015 23:17:44 +0000 Subject: Update to 0.10.3 - Remove upstreamed patches --- diff --git a/.gitignore b/.gitignore index ff6f91d..e36b1df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ exo-0.3.107.tar.bz2 /exo-0.5.6.tar.bz2 /exo-0.6.0.tar.bz2 -/internet-mail-24.png -/internet-mail-48.png /exo-0.6.1.tar.bz2 /exo-0.6.2.tar.bz2 /exo-0.7.2.tar.bz2 @@ -11,5 +9,4 @@ exo-0.3.107.tar.bz2 /exo-0.10.0.tar.bz2 /exo-0.10.1.tar.bz2 /exo-0.10.2.tar.bz2 -/mailtoparse.py /exo-0.10.3.tar.bz2 diff --git a/internet-mail-24.png b/internet-mail-24.png new file mode 100644 index 0000000..aeb54ec Binary files /dev/null and b/internet-mail-24.png differ diff --git a/internet-mail-48.png b/internet-mail-48.png new file mode 100644 index 0000000..d06fdf5 Binary files /dev/null and b/internet-mail-48.png differ diff --git a/mailtoparse.py b/mailtoparse.py new file mode 100644 index 0000000..63a621e --- /dev/null +++ b/mailtoparse.py @@ -0,0 +1,178 @@ +#!/usr/bin/python -tt +# skvidal@fedoraproject.org +# (c) red hat, inc 2013 +# gpl whatever +# this is a direct port of exo-compos-mail-1 from xfce +# from perl to python +# the idea is to dump the 2000000000 perl pkgs pulled in +# by this for a single item :( +# it should handle all the behaviour the same +# it probably has bugs + +# TODO: +# - figure out what the attachment parsing is trying to do +# - figure out if rebuilding the mailto for evo, sylpheed and balsa +# is actually necessary or not - feels silly but I'm not shocked by silly +# - would be nice to have an actual set of tests :) + + + +import sys +import posix +import os +import urlparse +import urllib + + +def parse_url(mailto): + urlparse.uses_query.append('mailto') + url = urlparse.urlparse(mailto) + res = {} + to = [] + query = None + + if url.query or '?' not in url.path: + if url.path: + to.append(urlparse.unquote(url.path)) + + else: + (thisto, ques, query) = url.path.partition('?') + if thisto.strip(): + to.append(urlparse.unquote(thisto)) + + if not query: + query = url.query + + q_dict = urlparse.parse_qs(query) + to.extend(q_dict.get('to', [])) + res['to'] = to + if 'to' in q_dict: + del(q_dict['to']) + + res.update(q_dict) + return res + + + +if len(sys.argv) < 3: + print >> sys.stderr, "Usage: %s