From db52aeb97fcc73e3b9a3a2a6e2e9eb63fd4cb0f8 Mon Sep 17 00:00:00 2001 From: Lucas Nussbaum Date: Sat, 26 Dec 2009 01:51:37 +0100 Subject: Avoid using "acme.com" Patch from Guido Berhoerster : Hello, here is a small patch that avoids using the valid(!) domain "acme.com" for generating message ids and email addresses. It adds a new global configuration option "default-email" which will be used in case a feed does provide one, currently feed2imap resorts to "feed2imap@acme.com". If this configuration option is not given it will basically default to @ as returned by Etc.getlogin and Socket.gethostname. Yours, --- lib/feed2imap/feed2imap.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/feed2imap/feed2imap.rb') diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb index 68051c7..f23c0dc 100644 --- a/lib/feed2imap/feed2imap.rb +++ b/lib/feed2imap/feed2imap.rb @@ -244,15 +244,15 @@ class Feed2Imap if !cacherebuild fn = f.name.gsub(/[^0-9A-Za-z]/,'') updateditems.each do |i| - id = "<#{fn}-#{i.cacheditem.index}@acme.com>" - email = item_to_mail(i, id, true, f.name, f.include_images, f.wrapto) + id = "<#{fn}-#{i.cacheditem.index}@#{@config.hostname}>" + email = item_to_mail(@config, i, id, true, f.name, f.include_images, f.wrapto) f.imapaccount.updatemail(f.folder, email, id, i.date || Time::new) end # reverse is needed to upload older items first (fixes gna#8986) newitems.reverse.each do |i| - id = "<#{fn}-#{i.cacheditem.index}@acme.com>" - email = item_to_mail(i, id, false, f.name, f.include_images, f.wrapto) + id = "<#{fn}-#{i.cacheditem.index}@#{@config.hostname}>" + email = item_to_mail(@config, i, id, false, f.name, f.include_images, f.wrapto) f.imapaccount.putmail(f.folder, email, i.date || Time::new) end end -- cgit v1.2.3-54-g00ecf