Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usable for http://externals.io? #28

Closed
mnapoli opened this issue Dec 7, 2016 · 5 comments
Closed

Usable for http://externals.io? #28

mnapoli opened this issue Dec 7, 2016 · 5 comments

Comments

@mnapoli
Copy link
Contributor

mnapoli commented Dec 7, 2016

Hi! I'm currently considering moving http://externals.io from using IMAP (to fetch the mailing list's emails) to using NNTP. I figured that before jumping into it it might be better to ask your opinion: do you think your library is ready/stable and could cover that need? (i.e. getting the list of posts by date, fetching the thread of message, fetching each message individually)

One important feature in externals.io is that messages are displayed as thread (for example): http://externals.io/thread/539 To do that I use a feature in IMAP that allows to know which emails answers to which other email (so I can rebuild the tree). Is that possible with NNTP?

Thanks for your advice

@mnapoli
Copy link
Contributor Author

mnapoli commented Dec 7, 2016

For reference, the issue: mnapoli/externals#3

@robinvdvleuten
Copy link
Owner

hi @mnapoli! Thanks for showing interest in using the php-nntp package! I consider the package as reasonably stable (I know some uses of it currently in similar applications as yours) and haven't made a 1.0 release yet because the client is not implementing all functionality mentioned in the RFC. Also the yenc encoded responses returned by NZB servers isn't fully tested yet in real use cases, but this isn't used by the news.php.net server.

If you look at the output when listing articles for a specific group;

array(9) {
    'number' =>
    string(9) "969332412"
    'subject' =>
    string(39) "RE: [PHP-DEV] Conference Materials Site"
    'from' =>
    string(30) "jmoore@php.net ("James Moore")"
    'date' =>
    string(30) "Mon, 9 Oct 2000 23:19:34 +0100"
    'message_id' =>
    string(45) "<FFEIKBOCABIMELPMCNFNIEPMDIAA.jmoore@php.net>"
    'references' =>
    string(33) "<20001009235659.09597@s.netic.de>"
    'bytes' =>
    string(0) ""
    'lines' =>
    string(2) "18"
    'xref' =>
    string(31) "php.dev:34531 php.doc:969332412"
  }

It looks like the news server is implementing RFC 5536 and therefore you can get a thread of messages by iterating on the 'references' value.

If you need any help in the externals project, missing some functionality in my library or stumbled on any issues. Please let me know as I like to help wherever I can 😄

@mnapoli
Copy link
Contributor Author

mnapoli commented Dec 8, 2016

Ohhh that's great thanks. So if I get this right references points to another's message message_id right? Should be easy then. Maybe the from doesn't have a consistent formatting between email clients, I'll see (if so parsing that will be a little harder but should be ok).

@robinvdvleuten
Copy link
Owner

I mostly used the library for NZB handling and parsing and in that case the references points to linked messages, so I guess that in this case you can build a thread from it.

@robinvdvleuten
Copy link
Owner

I close the issue for now. If you need any help or stumble upon any issues, please open a new one 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants