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

Nested quantifiers in regex #160

Merged
merged 1 commit into from
Jan 14, 2016

Conversation

negachov
Copy link
Contributor

MIME Multipart で 特定の boundary 文字列の場合に解析に失敗します
正規表現に含まれる文字が入っているとダメなのかな

Erorr Message

Nested quantifiers in regex; marked by <-- HERE in m/\A--==_LD168/AvJO+++ <-- HERE cQTU=/LDS--\z/ at /home/foo/bar/local/lib/perl5/Sisimai/MSP/JP/EZweb.pm line 107.

Sisimai Version

$ grep VERSION local/lib/perl5/Sisimai.pm
our $VERSION = '4.14.1';
sub version { return $VERSION }

azumakuniyuki added a commit that referenced this pull request Jan 14, 2016
@azumakuniyuki azumakuniyuki merged commit 1d80e9f into sisimai:master Jan 14, 2016
@azumakuniyuki
Copy link
Member

@negachov サンプルメールのご提供有り難う御座います。未だリリースしていない手元のバージョン(v4.14.2)でも同じエラーメッセージが確認出来ました。

+++を---に手動で書き換えて解析を試みたところエラーは発生せず、下記の解析結果を得られましたので仰る通りの原因と思われます。何か良い回避策を探ってみます。

[
  {
    "token": "0d2fa1151414e8c1f04a0a0c1d0265a14b9f8526",
    "replycode": "550",
    "action": "",
    "alias": "",
    "timestamp": 1452216403,
    "smtpcommand": "RCPT",
    "destination": "ezweb.ne.jp",
    "softbounce": 0,
    "senderdomain": "example.jp",
    "addresser": "postmaster@example.jp",
    "recipient": "foobarbaz@ezweb.ne.jp",
    "diagnostictype": "SMTP",
    "diagnosticcode": "Each of the following recipients was rejected by a remote mail server. <<< 550 <foobarbaz@ezweb.ne.jp>: User unknown",
    "subject": "",
    "listid": "",
    "deliverystatus": "5.0.911",
    "rhost": "",
    "feedbacktype": "",
    "reason": "userunknown",
    "lhost": "",
    "smtpagent": "JP::EZweb",
    "timezoneoffset": "+0900",
    "messageid": ""
  }
]

@azumakuniyuki
Copy link
Member

@negachov 文字列から正規表現を生成するコードが雑であったことが原因でしたので、報告頂いたJP::EZwebに加え、他のMTA/MSPモジュールも修正しました。

@negachov
Copy link
Contributor Author

ありがとうございます

@negachov negachov deleted the nested_quantifiers_in_regex branch January 15, 2016 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants