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

New accessor "origin" in Sisimai::Data object #383

Merged
merged 6 commits into from Apr 15, 2020

Conversation

azumakuniyuki
Copy link
Member

  • Add path accessor at Sisimai::Mail::Memory
    • returns the fixed string <MEMORY>
  • Add origin accessor at Sisimai::Data
    • Sisimai::Data->origin returns the path to the original email file of the parsed results
    • Sisimai::Data->make receives origin key and its value as an arguments
  • For example, the parsed results of set-of-emails/maildir/bsd/lhost-barracuda-*.eml are the following JSON formatted data:
[
  {
    "origin": "set-of-emails/maildir/bsd/lhost-barracuda-01.eml",
    "subject": "Nyaan",
    "diagnostictype": "SMTP",
    "timestamp": 1177889685,
    "softbounce": 1,
    "action": "failed",
    "replycode": "550",
    "deliverystatus": "5.7.1",
    "messageid": "ad4be1052982bf7aa5558be760abbf74@neko.example.com",
    "token": "97efb3278821c5eac776066a7f56f1cad123d31d",
    "destination": "example.org",
    "catch": {
      "queie-id": "",
      "sender": "",
      "x-mailer": ""
    },
    "listid": "",
    "diagnosticcode": "550 5.7.1 Message content rejected, UBE, id=00000-22-225",
    "timezoneoffset": "+0900",
    "senderdomain": "example.org",
    "recipient": "kijitora@example.org",
    "rhost": "barracuda.cat.example.jp",
    "lhost": "barracuda.cat.example.jp",
    "feedbacktype": "",
    "reason": "spamdetected",
    "smtpagent": "Barracuda",
    "smtpcommand": "",
    "addresser": "neko@example.org",
    "alias": ""
  },
  {
    "smtpagent": "Barracuda",
    "feedbacktype": "",
    "reason": "spamdetected",
    "alias": "",
    "addresser": "neko-nyaan@example.jp",
    "smtpcommand": "",
    "timezoneoffset": "+0000",
    "senderdomain": "example.jp",
    "diagnosticcode": "550 5.7.1 Message content rejected, UBE, id=22220-02-222",
    "listid": "",
    "lhost": "mail.neko.example.org",
    "rhost": "mail.neko.example.org",
    "recipient": "kijitora@example.jp",
    "destination": "example.jp",
    "token": "08f99ccce01ad9058b6b4c743d7380e5413cf015",
    "messageid": "201104292334545.62412C6FD0F1@email-4.example.jp",
    "catch": {
      "sender": "",
      "queie-id": "",
      "x-mailer": ""
    },
    "replycode": "550",
    "action": "failed",
    "softbounce": 1,
    "timestamp": 1304152485,
    "diagnostictype": "SMTP",
    "subject": "Nenko Nyaan",
    "origin": "set-of-emails/maildir/bsd/lhost-barracuda-02.eml",
    "deliverystatus": "5.7.1"
  }
]

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 95.152% when pulling bc78ab7 on new-accessor-origin-in-sisimai-data into d83b615 on master.

@coveralls
Copy link

coveralls commented Mar 19, 2020

Coverage Status

Coverage increased (+0.005%) to 95.149% when pulling 4305fed on new-accessor-origin-in-sisimai-data into d83b615 on master.

azumakuniyuki added a commit to sisimai/rb-sisimai that referenced this pull request Apr 14, 2020
…::Data.origin for keeping a path to email as a data source
@azumakuniyuki azumakuniyuki merged commit 9fc5b1b into master Apr 15, 2020
azumakuniyuki added a commit that referenced this pull request Apr 15, 2020
@azumakuniyuki azumakuniyuki deleted the new-accessor-origin-in-sisimai-data branch June 3, 2020 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants