From 34963a00abbd92d4fec6d062fd9e9239996e41a3 Mon Sep 17 00:00:00 2001 From: lnu Date: Thu, 25 Aug 2005 16:13:13 +0000 Subject: reserved chars are unescaped git-svn-id: svn+ssh://svn.gna.org/svn/feed2imap/trunk/feed2imap@55 f70e237a-67f3-0310-a06c-d2b8a7116972 --- ChangeLog | 1 + data/doc/feed2imap/examples/feed2imaprc | 3 +++ lib/feed2imap/imap.rb | 2 +- manpages/feed2imaprc.xml | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3e71619..93d50f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Feed2Imap 0.5 (XX/XX/2005) ============================ +* Reserved characters (eg @) can now be included in the login/password. * Feed2Imap is now included in Debian (package name: feed2imap). * Much better handling of feeds with escaped HTML (LinuxFR for example). diff --git a/data/doc/feed2imap/examples/feed2imaprc b/data/doc/feed2imap/examples/feed2imaprc index f27e671..13ac3c2 100644 --- a/data/doc/feed2imap/examples/feed2imaprc +++ b/data/doc/feed2imap/examples/feed2imaprc @@ -4,6 +4,9 @@ # min-frequency (in HOURS) is the minimum frequency with which this particular # feed will be fetched # disable: if set to something, the feed will be ignored +# +# If your login contains an @ character, replace it with %40. Other reserved +# characters can be escaped in the same way (see man ascii to get their code) feeds: - name: feed2imap url: http://home.gna.org/feed2imap/feed2imap.rss diff --git a/lib/feed2imap/imap.rb b/lib/feed2imap/imap.rb index 5317eb9..dca2ed4 100644 --- a/lib/feed2imap/imap.rb +++ b/lib/feed2imap/imap.rb @@ -70,7 +70,7 @@ class ImapAccount # use given port if port given port = uri.port if uri.port @connection = Net::IMAP::new(uri.host, port, usessl) - user, password = uri.userinfo.split(':',2) + user, password = URI::unescape(uri.userinfo).split(':',2) @connection.login(user, password) self end diff --git a/manpages/feed2imaprc.xml b/manpages/feed2imaprc.xml index b2289b3..6731f6e 100644 --- a/manpages/feed2imaprc.xml +++ b/manpages/feed2imaprc.xml @@ -37,6 +37,10 @@ EXAMPLE See /usr/share/doc/feed2imap/examples/feed2imaprc. + + RESERVED CHARACTERS + Some characters are reserved in RFC2396 (URI). If you need to include a reserved character in the login/password part of your target URI, replace it with its hex code. For example, @ can be replaced by %40. + BUGS This manpage should probably give more details. -- cgit v1.2.3-54-g00ecf