diff --git a/ChangeLog b/ChangeLog index 4535c84..0498542 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,162 +1 @@ -Feed2Imap 1.0 (18/04/2010) -========================== -* Removed patch from Haegar as it's no longer needed with the new - rubyimap.rb (see discussion in https://gna.org/bugs/?13977) -* Support writing to maildirs instead of through IMAP -* Use Message-ID instead of X-CacheIndex -* Do not use acme.com -* Update rubyimap.rb -* Provide a way to disable SSL certification verification when - connecting to IMAPS accounts - -Feed2Imap 0.9.4 (27/07/2009) -============================ -* Warn (INFO level, so only displayed with feed2imap -v) if fetching a - feed takes more than 10s, as this might cause massive delays - in feed2imap run times. -* Fix encoding of email headers -* Only include images once when used several times in the same item -* New version of Net::Imap -* Use Message-Id instead of X-CacheIndex -* Fix MIME formatting when including images -* Require ruby-feedparser 0.7, better email formatting -* Made it possible to re-use substrings in targets -* Fix buffering problem with filters -* Added a patch from Haegar to fix problem with dovecot 1.2.1 - -Feed2Imap 0.9.3 (23/07/2008) -============================ -* Check the return code from external commands, and warn if != 0. Fixes - Gna bug #10516. -* Support for including images in the mails (see include-images config - option). Based on a patch by Pavel Avgustinov, and with help from - Arnt Gulbrandsen. -* Dropped rubymail_patch.rb -* Added option to wrap text output. Thanks to Maxime Petazzoni for - the patch. -* When updating an email, remove the Recent flag. -* You need to use ruby-feedparser 0.6 or greater with that release. - -Feed2Imap 0.9.2 (28/10/2007) -============================ -* resynchronized rubyimap.rb with stdlib, and fixed send! -> send. -* upload items in reverse order, to upload the older first - Closes Gna bug #8986. Thanks go do Rial Juan for the patch. -* Don't allow more than 16 fetchers to run at the same time. - 16 should be a reasonable default for everybody. - Closes Gna #9032. -* Reduce the default HTTP timeout to 30s. -* Don't update the cache if uploading items failed (should avoid - missing some items). -* Safer cache writing. Should avoid some cache corruption problems. -* Now exits when we receive an IMAP error, instead of trying to recover. We - shouldn't receive IMAP errors anyway. Closes Debian #405070. -* Fixed content-type-encoding in HTML emails. Reported by Arnt Gulbrandse. - -Feed2Imap 0.9.1 (15/05/2007) -============================ -* Fixed bug with folder creation. - -Feed2Imap 0.9 (15/05/2007) -============================ -* Folder creation moved to upload. This should make feed2imap run - slightly faster. -* Per-feed dumpdir option (helps debugging) -* Now uses Content-Transfer-Encoding: 8bit (thanks Arnt Gulbrandsen - ) -* Now supports Snowscripts, using the 'execurl' and 'filter' config - keywords. For more information, see the example configuration file. -* Slightly better option parsing. Thanks to Paul van Tilburg for the - patch. -* A debug mode was added, and the normal mode was improved, so it is - no longer necessary to redirect feed2imap output to /dev/null: - transient errors are only reported after they have happened a - certain number of times (default 10). -* An ignore-hash option was added for feeds whose content change all - the time. - -Feed2Imap 0.8 (28/06/2006) -============================ -* Uses the http_proxy environment variable to determine the proxy server - if available. (fixes gna bug #5820, all credits go to Boyd Adamson - ) -* Fixes flocking on Solaris (fixes gna bug #5819). Again, all credits go to - Boyd Adamson . -* Rewrite of the "find updated and new items" code. It should work much better - now. Also, a debug-updated configuration variable was added to make it - easier to debug those issues. -* New always-new flag in the config file to consider all items as new (for - feeds where items are wrongly marked as updated, e.g mediawiki feeds). - See example configuration file for more information (fixes Debian bug - #366878). -* When disconnecting from the IMAP server, don't display an exception in - non-verbose mode if the "connection is reset by peer" (fixes Debian bug - #367282). -* Handling of exceptions in needMIME (fixes gna bug #5872). - -Feed2Imap 0.7 (17/02/2006) -============================ -* Fixes the IMAPS disconnection problem (patch provided by Gael Utard - ) (fixes gna bug #2178). -* Fixes some issues regarding parallel fetching of feeds. -* Now displays the feed creator as sender of emails. (fixes gna bug #5043). -* Don't display the password in error messages (fixes debian bug #350370). -* Upload mail with the Item's time, not the upload's time (fixes debian - bug #350371). - -Feed2Imap 0.6 (11/01/2006) -============================ -* Moved the RSS/Atom parser to a separate library (ruby-feedparser). -* Locks the Cache file to avoid concurrent instances of feed2imap. -* Issue a warning if the config file is world readable. -* Fixed a small bug in Atom feeds parsing. -* Fix another bug related to escaped HTML. -* Minor fixes. - -Feed2Imap 0.5 (19/09/2005) -============================ -* Fixed a parser problem with items with multiple children in the description. -* Mails were upload with \n only, but \r\n are needed. -* Feed2Imap can now work without libopenssl. -* Fixed a bug in the HTML2Text converter with tags without href. -* Reserved characters (eg @) can now be included in the login, password or - folder. You just need to escape them. -* Feed2Imap is now included in Debian (package name: feed2imap). -* Much better handling of feeds with escaped HTML (LinuxFR for example). - -Feed2Imap 0.4 (25/07/2005) -============================ -* now available as a Debian package. -* added manpages for everything. -* added min-frequency and disable config options. Added doc in example config. -* You can now use WordPress's feed:http://something urls in feed2imaprc. -* Switched to a real SGML parser for the text version. -* Much better output for the text version of emails. -* New feed2imap-cleaner to remove old mails seen but not flagged -* Feed2Imap version number wasn't displayed in the User-Agent -* Better exception handling when parsing errors occur -* added feed2imap's RSS feed to the default feeds in the config file - -Feed2Imap 0.3 (04/06/2005) -============================ -* New releases are now advertised using a RSS feed -* Cleaner way to manage duplicate IDs (#1773) -* Fixed a problem with pseudo-duplicate entries from Mediawiki -* Fixed a problem with updated items being seen as updated at each update. -* Fixed a problem when the disconnection from the IMAP server failed. - reported by Ludovic Gomez - -Feed2Imap 0.2 (30/04/2005) -============================ -* Fixed a problem with feeds with strange caching bugs (old items going away - and coming back) -* The text version is now encoded in iso-8859-1 instead of utf-8. -* The subject is now MIME-encoded in utf-8. It works with mutt & evo. -* No longer overwrite mail flags (Read, Important,..) when updating an item. -* HTTP fetching is now multithreaded and is much faster (about 300%). -* Fetching over HTTPS works. -* HTTP fetching is fully unit-tested. - -Feed2Imap 0.1 (02/04/2005) -========================== -* first public release. +See the git history diff --git a/README b/README index 08d3115..f8c6d2f 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ Currently, all the information is provided on - http://home.gna.org/feed2imap + https://github.com/feed2imap/feed2imap Copyright (c) 2005-2010 Lucas Nussbaum diff --git a/Rakefile b/Rakefile index 1b9ad00..fb67d32 100644 --- a/Rakefile +++ b/Rakefile @@ -3,11 +3,12 @@ require 'rake/packagetask' require 'rake' require 'find' +require_relative "lib/feed2imap/version" task :default => [:test] PKG_NAME = 'feed2imap' -PKG_VERSION = `ruby -Ilib -rfeed2imap/feed2imap -e 'print F2I_VERSION'` +PKG_VERSION = Feed2Imap::VERSION PKG_FILES = [ 'ChangeLog', 'README', 'COPYING', 'setup.rb', 'Rakefile'] Find.find('bin/', 'lib/', 'test/', 'data/') do |f| if FileTest.directory?(f) and f =~ /\.svn/ @@ -65,3 +66,10 @@ rescue LoadError puts "Will not generate gem." end + +task :release => :repackage do + sh 'git', 'tag', 'v' + PKG_VERSION + sh 'git', 'push' + sh 'git', 'push', '--tags' + sh 'gem', 'push', "pkg/#{PKG_NAME}/#{PKG_VERSION}.gem" +end diff --git a/bin/feed2imap b/bin/feed2imap index 663d661..daaf8ab 100755 --- a/bin/feed2imap +++ b/bin/feed2imap @@ -43,7 +43,7 @@ end if version - puts "Feed2Imap v.#{F2I_VERSION}" + puts "Feed2Imap v.#{Feed2Imap::VERSION}" else Feed2Imap::new(verbose, cacherebuild, configf) end diff --git a/feed2imap.gemspec b/feed2imap.gemspec new file mode 100644 index 0000000..13afe39 --- /dev/null +++ b/feed2imap.gemspec @@ -0,0 +1,32 @@ +######################################################### +# This file has been automatically generated by gem2tgz # +######################################################### +# -*- encoding: utf-8 -*- +# stub: feed2imap 1.2.6 ruby lib + +Gem::Specification.new do |s| + s.name = "feed2imap".freeze + s.version = "1.2.6" + + s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= + s.require_paths = ["lib".freeze] + s.authors = ["Lucas Nussbaum".freeze] + s.date = "2021-01-14" + s.description = "RSS/Atom feed aggregator".freeze + s.executables = ["feed2imap".freeze, "feed2imap-cleaner".freeze, "feed2imap-dumpconfig".freeze, "feed2imap-opmlimport".freeze] + s.files = ["COPYING".freeze, "ChangeLog".freeze, "README".freeze, "Rakefile".freeze, "bin/feed2imap".freeze, "bin/feed2imap-cleaner".freeze, "bin/feed2imap-dumpconfig".freeze, "bin/feed2imap-opmlimport".freeze, "data/doc/feed2imap/examples/feed2imaprc".freeze, "data/man/man1/feed2imap-cleaner.1".freeze, "data/man/man1/feed2imap-dumpconfig.1".freeze, "data/man/man1/feed2imap-opmlimport.1".freeze, "data/man/man1/feed2imap.1".freeze, "data/man/man5/feed2imaprc.5".freeze, "lib/feed2imap.rb".freeze, "lib/feed2imap/cache.rb".freeze, "lib/feed2imap/config.rb".freeze, "lib/feed2imap/feed2imap.rb".freeze, "lib/feed2imap/html2text-parser.rb".freeze, "lib/feed2imap/httpfetcher.rb".freeze, "lib/feed2imap/imap.rb".freeze, "lib/feed2imap/itemtomail.rb".freeze, "lib/feed2imap/maildir.rb".freeze, "lib/feed2imap/rexml_patch.rb".freeze, "lib/feed2imap/sgml-parser.rb".freeze, "lib/feed2imap/version.rb".freeze, "setup.rb".freeze, "test/maildir/cur/1376317520.15784_1.debian:2,S".freeze, "test/maildir/cur/1376317520.15789_1.debian:2,S".freeze, "test/maildir/cur/1376319137.17850_1.debian:2,".freeze, "test/maildir/cur/1376320022.18396_5.debian:2,FS".freeze, "test/maildir/new/1376320099.18396_7.debian".freeze, "test/tc_cache.rb".freeze, "test/tc_config.rb".freeze, "test/tc_httpfetcher.rb".freeze, "test/tc_maildir.rb".freeze] + s.rubygems_version = "2.5.2.1".freeze + s.summary = "RSS/Atom feed aggregator".freeze + + if s.respond_to? :specification_version then + s.specification_version = 4 + + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + s.add_runtime_dependency(%q.freeze, [">= 0.9"]) + else + s.add_dependency(%q.freeze, [">= 0.9"]) + end + else + s.add_dependency(%q.freeze, [">= 0.9"]) + end +end diff --git a/lib/feed2imap/config.rb b/lib/feed2imap/config.rb index 3b77c15..50d6d2e 100644 --- a/lib/feed2imap/config.rb +++ b/lib/feed2imap/config.rb @@ -17,6 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =end +require 'cgi' require 'yaml' require 'uri' require 'feed2imap/imap' @@ -71,7 +72,7 @@ f['name'] = f['name'].to_s if f['disable'].nil? uri = URI::parse(Array(f['target']).join('')) - path = URI::unescape(uri.path) + path = CGI::unescape(uri.path) if uri.scheme == 'maildir' @feeds.push(ConfigFeed::new(f, maildir_account, path, self)) else diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb index 36c71bf..c7add8e 100644 --- a/lib/feed2imap/feed2imap.rb +++ b/lib/feed2imap/feed2imap.rb @@ -17,10 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =end -# Feed2Imap version -F2I_VERSION = '1.2.5' F2I_WARNFETCHTIME = 10 +require 'feed2imap/version' require 'feed2imap/config' require 'feed2imap/cache' require 'feed2imap/httpfetcher' @@ -32,7 +31,7 @@ class Feed2Imap def Feed2Imap.version - return F2I_VERSION + return Feed2Imap::VERSION end def initialize(verbose, cacherebuild, configfile) @@ -45,7 +44,7 @@ else @logger.level = Logger::WARN end - @logger.info("Feed2Imap V.#{F2I_VERSION} started") + @logger.info("Feed2Imap V.#{Feed2Imap::VERSION} started") # reading config @logger.info('Reading configuration file ...') if not File::exist?(configfile) diff --git a/lib/feed2imap/imap.rb b/lib/feed2imap/imap.rb index 2e796f6..593a965 100644 --- a/lib/feed2imap/imap.rb +++ b/lib/feed2imap/imap.rb @@ -23,6 +23,7 @@ require 'openssl' rescue LoadError end +require 'cgi' require 'uri' # This class is a container of IMAP accounts. @@ -77,7 +78,7 @@ # use given port if port given port = uri.port if uri.port @connection = Net::IMAP::new(uri.host, port, usessl, nil, !@@no_ssl_verify) - user, password = URI::unescape(uri.userinfo).split(':',2) + user, password = CGI::unescape(uri.userinfo).split(':',2) @connection.login(user, password) self end diff --git a/lib/feed2imap/itemtomail.rb b/lib/feed2imap/itemtomail.rb index 455a136..b9b2208 100644 --- a/lib/feed2imap/itemtomail.rb +++ b/lib/feed2imap/itemtomail.rb @@ -25,6 +25,7 @@ require 'feedparser' require 'feedparser/text-output' require 'feedparser/html-output' +require 'feed2imap/version' require 'base64' require 'rmail' require 'digest/md5' @@ -65,7 +66,7 @@ else message.header['Date'] = item.date.rfc2822 end - message.header['X-Feed2Imap-Version'] = F2I_VERSION if defined?(F2I_VERSION) + message.header['X-Feed2Imap-Version'] = Feed2Imap::VERSION message.header['Message-Id'] = id message.header['X-F2IStatus'] = "Updated" if updated # treat subject. Might need MIME encoding. @@ -100,24 +101,8 @@ # $2 contains url, $3 the image name, $4 the image extension begin fetcher = HTTPFetcher.new - image = Base64.encode64(fetcher.fetch($2, Time.at(0)).chomp) + "\n" - cid = "#{Digest::MD5.hexdigest($2)}@#{config.hostname}" - if not cids.include?(cid) - cids << cid - imgpart = RMail::Message.new - imgpart.header.set('Content-ID', "<#{cid}>") - type = $4 - type = 'jpeg' if type.downcase == 'jpg' # hack hack hack - imgpart.header.set('Content-Type', "image/#{type}", 'name' => $3) - imgpart.header.set('Content-Disposition', 'attachment', 'filename' => $3) - imgpart.header.set('Content-Transfer-Encoding', 'base64') - imgpart.body = image - imgs << imgpart - end - # now to specify what to replace with - newtag = "#{$1}src=\"cid:#{cid}\"#{$5}" - #print "#{cid}: Replacing '#{$&}' with '#{newtag}'...\n" - newtag + image = Base64.encode64(fetcher.fetch($2, Time.at(0)).chomp) + "#{$1}src=\"data:image/#{$4};base64,#{image}\"#{$5}" rescue #print "Error while fetching image #{$2}: #{$!}...\n" $& # don't modify on exception diff --git a/lib/feed2imap/maildir.rb b/lib/feed2imap/maildir.rb index 7335f03..7ca42bc 100644 --- a/lib/feed2imap/maildir.rb +++ b/lib/feed2imap/maildir.rb @@ -39,7 +39,6 @@ dir = folder_dir(folder) guarantee_maildir(dir) mail_files = find_mails(dir, idx) - flags = nil if mail_files.length > 0 # get the info from the first result and delete everything info = maildir_file_info(mail_files[0]) @@ -123,7 +122,7 @@ File.link tmp_path, new_path stored = true ensure - File.unlink tmp_path if File.exists? tmp_path + File.unlink tmp_path if File.exist? tmp_path end end diff --git a/lib/feed2imap/version.rb b/lib/feed2imap/version.rb new file mode 100644 index 0000000..b13c7c1 --- /dev/null +++ b/lib/feed2imap/version.rb @@ -0,0 +1,3 @@ +class Feed2Imap + VERSION = "1.2.6" +end