Necoro/feed2imap-go

Identical target per feed/group

Necoro opened this issue · 7 comments

target is a field that is defined globally, per feed, and per group.
In my world they were used to define the folder structure.

Turns out: In feed2imap, it was always possible to specify full URIs there, thus actually sending different feeds to different mailboxes.

I'm not sure if this is still needed -- normally you'd probably have multiple configs then.

As shown below, in feed2imap it was not uncommon to repeat the server target for each feed. This shall be supported. Different servers will remain unsupported.

X41 commented

This is how i have laid out my old feed2imap config.
The example configuration states # Instead of the verbose target, specifiying a URI is also legitimate. Be sure to properly url-encode user and password., but specifying a URI in any feeds target will just result in the tool trying to use the URI as a path under the original target root. am i just setting something wrong or has this not been implemented for feeds themselves?

Hi @X41,

yes, currently there can only be one target (i.e. mail server) on the global level. As stated in my original comment, I'm still missing the use case for different servers on a feed level. In my opinion, one would just use different configs (and caches!) then.

Would you mind elaborating your use case?

X41 commented

In my old feed2imap config i provided the full uri for every single feed to sort everything into the correct folder (which sat in the imap root, not INBOX, but feed2imap-go unfortunately won't let me do that).

i have rewritten my whole config now and was forced to wipe the mail account i was using for my feeds (the mail server did not appreciate me trying to move thousands of things into INBOX all of a sudden) to make things work with feed2imap-go (which is such a life saver btw, i can't thank you enough for releasing me from ruby hell 🙃), but being compatible with the old feed2imaprc style config would save people lot of time, headscratching and, in cases like this, loss of data when switching over and allow for more flexibility overall.

thanks

Would you mind sharing your old config (or the important parts) with me?
My intention really is to be backwards compatible with old feed2imaprcs, so when there is some more compatibility efforts needed, I'm all for it.
Regarding INBOX: feed2imap-go should not require INBOX at all, you have to explicitly specify it. Else it's a bug.

X41 commented

My config looked something like this

feeds:
  - name: Feed-1
    url: https://Feed-1.com/rss.xml
    target: imaps://feeds%40mail.server.com:password@mail.server.com/News/Feed-1
  - name: Feed-2
    url: https://Feed-2.com/rss.xml
    target: imaps://feeds%40mail.server.com:password@mail.server.com/News/Feed-2
  - name: Feed-3
    url: https://Feed-3.com/rss.xml
    target: imaps://feeds%40mail.server.com:password@mail.server.com/News/Feed-3
  - name: Feed-4
    url: https://Feed-4.com/rss.xml
    target: imaps://feeds%40mail.server.com:password@mail.server.com/Blogs/Feed-4
  - name: Feed-5
    url: https://Feed-5.com/rss.xml
    target: imaps://feeds%40mail.server.com:password@mail.server.com/Blogs/Feed-5
  - name: Feed-6
    url: https://Feed-6.com/rss.xml
    target: imaps://feeds%40mail.server.com:password@mail.server.com/Comics/Feed-6
  - name: Feed-7
    url: https://Feed-7.com/rss.xml
    target: imaps://feeds%40mail.server.com:password@mail.server.com/Comics/Feed-7
  - name: Feed-8
    url: https://Feed-8.com/rss.xml
    target: imaps://feeds%40mail.server.com:password@mail.server.com/Comics/Feed-8
  - name: Feed-9
    url: https://Feed-9.com/rss.xml
    target: imaps://feeds%40mail.server.com:password@mail.server.com/Comics/Feed-9

also not adding INBOX causes feed2imap-go to output this
2021/10/17 03:34:33 ERROR: creating folder '': Invalid mailbox name: Name is empty (0.001 + 0.000 secs).
should i create an issue for that?

For the INBOX-Bug: Yes, please open an issue.
The target: This is how I expected it from your description. Good :). Supporting this is reasonable.

@X41: I've now merged support for target connection strings on feed level.
If you want, and still have your original config, you may test that it works as intended.