{"action":"created","issue":{"url":"https://api.github.com/repos/linagora/james-project/issues/1831","repository_url":"https://api.github.com/repos/linagora/james-project","labels_url":"https://api.github.com/repos/linagora/james-project/issues/1831/labels{/name}","comments_url":"https://api.github.com/repos/linagora/james-project/issues/1831/comments","events_url":"https://api.github.com/repos/linagora/james-project/issues/1831/events","html_url":"https://github.com/linagora/james-project/pull/1831","id":372395350,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NTkwMDUz","number":1831,"title":"JAMES-2557 Mail::getSenderAsOptional & MailAddress::nullSender() deprecation","user":{"login":"chibenwa","id":6928740,"node_id":"MDQ6VXNlcjY5Mjg3NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6928740?v=4","gravatar_id":"","url":"https://api.github.com/users/chibenwa","html_url":"https://github.com/chibenwa","followers_url":"https://api.github.com/users/chibenwa/followers","following_url":"https://api.github.com/users/chibenwa/following{/other_user}","gists_url":"https://api.github.com/users/chibenwa/gists{/gist_id}","starred_url":"https://api.github.com/users/chibenwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibenwa/subscriptions","organizations_url":"https://api.github.com/users/chibenwa/orgs","repos_url":"https://api.github.com/users/chibenwa/repos","events_url":"https://api.github.com/users/chibenwa/events{/privacy}","received_events_url":"https://api.github.com/users/chibenwa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/linagora/james-project/milestones/10","html_url":"https://github.com/linagora/james-project/milestone/10","labels_url":"https://api.github.com/repos/linagora/james-project/milestones/10/labels","id":3722816,"node_id":"MDk6TWlsZXN0b25lMzcyMjgxNg==","number":10,"title":"polish_2018_10","description":"","creator":{"login":"chibenwa","id":6928740,"node_id":"MDQ6VXNlcjY5Mjg3NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6928740?v=4","gravatar_id":"","url":"https://api.github.com/users/chibenwa","html_url":"https://github.com/chibenwa","followers_url":"https://api.github.com/users/chibenwa/followers","following_url":"https://api.github.com/users/chibenwa/following{/other_user}","gists_url":"https://api.github.com/users/chibenwa/gists{/gist_id}","starred_url":"https://api.github.com/users/chibenwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibenwa/subscriptions","organizations_url":"https://api.github.com/users/chibenwa/orgs","repos_url":"https://api.github.com/users/chibenwa/repos","events_url":"https://api.github.com/users/chibenwa/events{/privacy}","received_events_url":"https://api.github.com/users/chibenwa/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":24,"state":"open","created_at":"2018-10-09T02:38:31Z","updated_at":"2018-10-23T09:39:30Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-10-22T05:02:32Z","updated_at":"2018-10-23T09:40:59Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/linagora/james-project/pulls/1831","html_url":"https://github.com/linagora/james-project/pull/1831","diff_url":"https://github.com/linagora/james-project/pull/1831.diff","patch_url":"https://github.com/linagora/james-project/pull/1831.patch"},"body":"## Why\r\n\r\n - 1. The usage of null values requires implicit knowledge on the caller side. The unaware caller then fails to handle special values.\r\n - 2. In some context the meaning of 'null' can refer to diffent things:\r\n    - A not yet specified sender\r\n    - A specified null sender\r\n\r\n## Proposed solution\r\n\r\nUsing an optional to represent a sender allows the 'null case' to be **explicit**. The caller has to handle it in order to access the underlying mail address.\r\n\r\n## API impact\r\n\r\nHere are the impacted models:\r\n\r\n - Mail (mailet-api): getSender deprecation + new getSenderAsOptional method + Mail::duplicate (see below)\r\n - MailEnvelope (protocols-smtp): getSender deprecation + new getSenderAsOptional method\r\n - MailAddress (core): nullSender deprecation + getMailSender deprecation + new getMailSenderAsOptional method\r\n\r\nHere are the impacted APIs:\r\n - SMTP MailHook (Called upon `MAIL FROM` command) \r\n - SMTP RcptHook  (Called upon `RCPT TO` command)\r\n\r\nThe APIs are retro-compatible for caller and implementers using the double default method cross call:\r\n - The caller can call any of both method\r\n - The implementer only needs to implement one of the methods, the over one will be inferred from the interface.\r\n - The main drawback of this technique is that an implemented will not get compile-time checks forcing him to implement at least one of these methods, and if he forgets to do so, he creates an infinite recursive call loop...\r\n\r\nThe type of one SMTPSession attachment had been changed. The users explicitly relying on this rather than on the explicit APIs parameters will get failure upon the upgrade.\r\n\r\n## Implementation difficulties\r\n\r\n - Need to call MailetContext::sendMail with a null sender. Rather than adding yet-another-set of send* methods there, I prefered slightly correcting sendMail(Mail mail), and implementing a Mail::duplicate method."},"comment":{"url":"https://api.github.com/repos/linagora/james-project/issues/comments/432175375","html_url":"https://github.com/linagora/james-project/pull/1831#issuecomment-432175375","issue_url":"https://api.github.com/repos/linagora/james-project/issues/1831","id":432175375,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjE3NTM3NQ==","user":{"login":"trantienduchn","id":39297818,"node_id":"MDQ6VXNlcjM5Mjk3ODE4","avatar_url":"https://avatars1.githubusercontent.com/u/39297818?v=4","gravatar_id":"","url":"https://api.github.com/users/trantienduchn","html_url":"https://github.com/trantienduchn","followers_url":"https://api.github.com/users/trantienduchn/followers","following_url":"https://api.github.com/users/trantienduchn/following{/other_user}","gists_url":"https://api.github.com/users/trantienduchn/gists{/gist_id}","starred_url":"https://api.github.com/users/trantienduchn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trantienduchn/subscriptions","organizations_url":"https://api.github.com/users/trantienduchn/orgs","repos_url":"https://api.github.com/users/trantienduchn/repos","events_url":"https://api.github.com/users/trantienduchn/events{/privacy}","received_events_url":"https://api.github.com/users/trantienduchn/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T09:40:59Z","updated_at":"2018-10-23T09:40:59Z","author_association":"MEMBER","body":"```\r\n[c34ec78e3f6f31b45af8901dd11ed3ec29b584fb] [INFO] There is 1 error reported by Checkstyle 8.5 with checkstyle.xml ruleset.\r\n[c34ec78e3f6f31b45af8901dd11ed3ec29b584fb] [ERROR] src/main/java/org/apache/james/webadmin/dto/MailQueueItemDTO.java:[28,8] (imports) UnusedImports: Unused import - org.apache.james.queue.api.MailQueue.MailQueueException.\r\n```"}}
{"actor":{"display_login":"trantienduchn"}}