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

[Feature Request] Is it possible to create single parsed JSON file? #22

Closed
hiroyuki-sato opened this issue Jan 27, 2016 · 3 comments
Closed
Labels

Comments

@hiroyuki-sato
Copy link
Contributor

Is it possible to create single parsed JSON file?
If not, please add those methods.

I would like to create JSON object per mails.

Example.

https://github.com/hiroyuki-sato/embulk-parser-sisimai_analyzer/blob/master/lib/embulk/parser/sisimai_analyzer.rb#L33

{"subject":"キジトラ","replycode":"550","action":"failed","lhost":"192.0.2.31","diagnosticcode":"550 Unknown user recipient-address-does-not-exist@docomo.ne.jp","timestamp":1240874268,"deliverystatus":"5.1.1","addresser":"user2@example.jp","smtpcommand":"DATA","reason":"userunknown","smtpagent":"Sendmail","alias":"","recipient":"recipient-address-does-not-exist@docomo.ne.jp","token":"1e86ae85ee6075211a5cb514c312c5a89193268d","feedbacktype":"","softbounce":0,"rhost":"mfsmax.docomo.ne.jp","listid":"","messageid":"E9E9449A-4918-4B8B-8589-435230D67AC7@example.jp","diagnostictype":"SMTP","destination":"docomo.ne.jp","timezoneoffset":"+0900","senderdomain":"example.jp"}
{"subject":"キジトラ","replycode":"550","action":"failed","lhost":"192.0.2.97","diagnosticcode":"550 Host unknown","timestamp":1221728044,"deliverystatus":"5.1.2","addresser":"user1@example.jp","smtpcommand":"","reason":"hostunknown","smtpagent":"Sendmail","alias":"","recipient":"domain-does-not-exist@example.gov","token":"d059e55e074333fe59001b1d30d27da85a1a9c1d","feedbacktype":"","softbounce":0,"rhost":"example.gov","listid":"","messageid":"AA406E7E18714AB2927DAACC24B47C4A@USER-PC97","diagnostictype":"SMTP","destination":"example.gov","timezoneoffset":"+0900","senderdomain":"example.jp"}
@azumakuniyuki
Copy link
Member

@hiroyuki-sato Sisimai.make() method always return parsed results as Array. Because the number of bounces in a single email file is NOT always limited to one.

For example, https://github.com/sisimai/set-of-emails/blob/master/maildir/bsd/postfix-02.eml, https://github.com/sisimai/set-of-emails/blob/master/maildir/bsd/sendmail-02.eml, and https://github.com/sisimai/set-of-emails/blob/master/maildir/bsd/qmail-02.eml are including 2 or more bounce records in a email file.

Therefore, Sisima.make() method always return the results as an Array if there is only one bounce record in a email file.

@hiroyuki-sato
Copy link
Contributor Author

I see, Thanks!.

@hiroyuki-sato
Copy link
Contributor Author

@azumakuniyuki I've forgotten to close this issue. Thanks!

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

No branches or pull requests

2 participants