{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/comments/243892802","pull_request_review_id":187772591,"id":243892802,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0Mzg5MjgwMg==","diff_hunk":"@@ -257,14 +257,34 @@ private String sendMail(MailOutTransportInfo outInfo, MessageContext msgContext)\n         }\n \n         WSMimeMessage message = null;\n-        if (outInfo.getFromAddress() != null) {\n+        Map trpHeaders = (Map) msgContext.getProperty(MessageContext.TRANSPORT_HEADERS);\n+        if (trpHeaders != null\n+                && trpHeaders.containsKey(MailConstants.MAIL_HEADER_FROM)\n+                && trpHeaders.containsKey(MailConstants.MAIL_SMTP_PASSWORD)\n+                && trpHeaders.containsKey(MailConstants.MAIL_SMTP_USERNAME)) {\n+            Properties prop = (Properties) session.getProperties().clone();\n+            final String from = (String) trpHeaders.get(MailConstants.MAIL_HEADER_FROM);\n+            final String password = (String) trpHeaders.get(MailConstants.MAIL_SMTP_PASSWORD);\n+            final String userName = (String) trpHeaders.get(MailConstants.MAIL_SMTP_USERNAME);\n+            prop.setProperty(MailConstants.MAIL_HEADER_FROM, from);\n+            prop.setProperty(MailConstants.MAIL_SMTP_USERNAME, userName);\n+            prop.setProperty(MailConstants.MAIL_SMTP_PASSWORD, password);\n+\n+            Session sessionCurrent = Session.getInstance(prop, new Authenticator() {\n+                public PasswordAuthentication getPasswordAuthentication() {\n+\n+                    return new PasswordAuthentication(userName, password);\n+                }\n+            });\n+\n+            message = new WSMimeMessage(sessionCurrent, (String) trpHeaders.get(MailConstants.MAIL_HEADER_FROM));\n+        } else if (outInfo.getFromAddress() != null) {\n             message = new WSMimeMessage(session, outInfo.getFromAddress().getAddress());\n         } else {\n             message = new WSMimeMessage(session, \"\");","path":"modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java","position":29,"original_position":29,"commit_id":"d6ac7471bc7d4a2cd4ca51904ee960223683cac6","original_commit_id":"d6ac7471bc7d4a2cd4ca51904ee960223683cac6","user":{"login":"abeykoon","id":4967046,"node_id":"MDQ6VXNlcjQ5NjcwNDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4967046?v=4","gravatar_id":"","url":"https://api.github.com/users/abeykoon","html_url":"https://github.com/abeykoon","followers_url":"https://api.github.com/users/abeykoon/followers","following_url":"https://api.github.com/users/abeykoon/following{/other_user}","gists_url":"https://api.github.com/users/abeykoon/gists{/gist_id}","starred_url":"https://api.github.com/users/abeykoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abeykoon/subscriptions","organizations_url":"https://api.github.com/users/abeykoon/orgs","repos_url":"https://api.github.com/users/abeykoon/repos","events_url":"https://api.github.com/users/abeykoon/events{/privacy}","received_events_url":"https://api.github.com/users/abeykoon/received_events","type":"User","site_admin":false},"body":"Is this a valid use-case? Should we throw an error if input are not provided? ","created_at":"2018-12-25T09:16:21Z","updated_at":"2018-12-25T09:16:21Z","html_url":"https://github.com/wso2/wso2-axis2-transports/pull/185#discussion_r243892802","pull_request_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/185","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/comments/243892802"},"html":{"href":"https://github.com/wso2/wso2-axis2-transports/pull/185#discussion_r243892802"},"pull_request":{"href":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/185"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/185","id":208628047,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NjI4MDQ3","html_url":"https://github.com/wso2/wso2-axis2-transports/pull/185","diff_url":"https://github.com/wso2/wso2-axis2-transports/pull/185.diff","patch_url":"https://github.com/wso2/wso2-axis2-transports/pull/185.patch","issue_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/issues/185","number":185,"state":"closed","locked":false,"title":"Dynamic support for from address in Proxy #2538","user":{"login":"shyabithd","id":33624222,"node_id":"MDQ6VXNlcjMzNjI0MjIy","avatar_url":"https://avatars0.githubusercontent.com/u/33624222?v=4","gravatar_id":"","url":"https://api.github.com/users/shyabithd","html_url":"https://github.com/shyabithd","followers_url":"https://api.github.com/users/shyabithd/followers","following_url":"https://api.github.com/users/shyabithd/following{/other_user}","gists_url":"https://api.github.com/users/shyabithd/gists{/gist_id}","starred_url":"https://api.github.com/users/shyabithd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shyabithd/subscriptions","organizations_url":"https://api.github.com/users/shyabithd/orgs","repos_url":"https://api.github.com/users/shyabithd/repos","events_url":"https://api.github.com/users/shyabithd/events{/privacy}","received_events_url":"https://api.github.com/users/shyabithd/received_events","type":"User","site_admin":false},"body":"## Purpose\r\n\r\nDynamic support to FROM address in proxy.\r\n\r\nGIT Issue: Dynamic support for from address in Proxy #2538\r\n \r\n## Goals\r\n\r\nMade from address and password dynamic.\r\n\r\n## Approach\r\nNA\r\n## User stories\r\nNA\r\n## Release note\r\nNA\r\n\r\n## Documentation\r\n\r\nhttps://docs.google.com/document/d/1j8NWJ5dDWDPUMQGQvKX_vQ48WP_Vvy1NCjO21gZhd5s/edit?usp=sharing\r\nFrom address and password can be set dynamically and user can set properties as follows:\r\nEx:\r\n<property name=\"From\" value=\"isham.d123@gmail.com\" scope=\"transport\"/>\r\n<property name=\"mail.smtp.password\" value=\"0774195305_shabi\" scope=\"transport\"/>\r\n\r\n## Training\r\n> Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable\r\n\r\n## Certification\r\n> Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.\r\n\r\n## Marketing\r\n> Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable\r\n\r\n## Automation tests\r\n - Unit tests \r\n   > Code coverage information\r\n - Integration tests\r\n   > Details about the test cases and coverage\r\n\r\n## Security checks\r\n - Followed secure coding standards in http://wso2.com/technical-reports/wso2-secure-engineering-guidelines? yes/no\r\n - Ran FindSecurityBugs plugin and verified report? yes/no\r\n - Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets? yes/no\r\n\r\n## Samples\r\n> Provide high-level details about the samples related to this feature\r\n\r\n## Related PRs\r\n> List any other related PRs\r\n\r\n## Migrations (if applicable)\r\n> Describe migration steps and platforms on which migration has been tested\r\n\r\n## Test environment\r\n> List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested\r\n \r\n## Learning\r\n> Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.","created_at":"2018-08-15T17:30:40Z","updated_at":"2018-12-25T09:16:21Z","closed_at":"2018-08-22T05:46:16Z","merged_at":"2018-08-22T05:46:15Z","merge_commit_sha":"52ca0e28495d36d9610c713cb0264092c24a9108","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/185/commits","review_comments_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/185/comments","review_comment_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/issues/185/comments","statuses_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/statuses/d6ac7471bc7d4a2cd4ca51904ee960223683cac6","head":{"label":"shyabithd:feature/rrt/email_from","ref":"feature/rrt/email_from","sha":"d6ac7471bc7d4a2cd4ca51904ee960223683cac6","user":{"login":"shyabithd","id":33624222,"node_id":"MDQ6VXNlcjMzNjI0MjIy","avatar_url":"https://avatars0.githubusercontent.com/u/33624222?v=4","gravatar_id":"","url":"https://api.github.com/users/shyabithd","html_url":"https://github.com/shyabithd","followers_url":"https://api.github.com/users/shyabithd/followers","following_url":"https://api.github.com/users/shyabithd/following{/other_user}","gists_url":"https://api.github.com/users/shyabithd/gists{/gist_id}","starred_url":"https://api.github.com/users/shyabithd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shyabithd/subscriptions","organizations_url":"https://api.github.com/users/shyabithd/orgs","repos_url":"https://api.github.com/users/shyabithd/repos","events_url":"https://api.github.com/users/shyabithd/events{/privacy}","received_events_url":"https://api.github.com/users/shyabithd/received_events","type":"User","site_admin":false},"repo":{"id":143273724,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMyNzM3MjQ=","name":"wso2-axis2-transports","full_name":"shyabithd/wso2-axis2-transports","private":false,"owner":{"login":"shyabithd","id":33624222,"node_id":"MDQ6VXNlcjMzNjI0MjIy","avatar_url":"https://avatars0.githubusercontent.com/u/33624222?v=4","gravatar_id":"","url":"https://api.github.com/users/shyabithd","html_url":"https://github.com/shyabithd","followers_url":"https://api.github.com/users/shyabithd/followers","following_url":"https://api.github.com/users/shyabithd/following{/other_user}","gists_url":"https://api.github.com/users/shyabithd/gists{/gist_id}","starred_url":"https://api.github.com/users/shyabithd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shyabithd/subscriptions","organizations_url":"https://api.github.com/users/shyabithd/orgs","repos_url":"https://api.github.com/users/shyabithd/repos","events_url":"https://api.github.com/users/shyabithd/events{/privacy}","received_events_url":"https://api.github.com/users/shyabithd/received_events","type":"User","site_admin":false},"html_url":"https://github.com/shyabithd/wso2-axis2-transports","description":null,"fork":true,"url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports","forks_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/forks","keys_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/teams","hooks_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/hooks","issue_events_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/issues/events{/number}","events_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/events","assignees_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/assignees{/user}","branches_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/branches{/branch}","tags_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/tags","blobs_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/git/refs{/sha}","trees_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/statuses/{sha}","languages_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/languages","stargazers_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/stargazers","contributors_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/contributors","subscribers_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/subscribers","subscription_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/subscription","commits_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/commits{/sha}","git_commits_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/git/commits{/sha}","comments_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/comments{/number}","issue_comment_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/issues/comments{/number}","contents_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/contents/{+path}","compare_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/merges","archive_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/downloads","issues_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/issues{/number}","pulls_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/pulls{/number}","milestones_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/milestones{/number}","notifications_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/labels{/name}","releases_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/releases{/id}","deployments_url":"https://api.github.com/repos/shyabithd/wso2-axis2-transports/deployments","created_at":"2018-08-02T09:35:07Z","updated_at":"2018-08-02T09:35:10Z","pushed_at":"2018-09-03T07:51:50Z","git_url":"git://github.com/shyabithd/wso2-axis2-transports.git","ssh_url":"git@github.com:shyabithd/wso2-axis2-transports.git","clone_url":"https://github.com/shyabithd/wso2-axis2-transports.git","svn_url":"https://github.com/shyabithd/wso2-axis2-transports","homepage":null,"size":1430,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wso2:master","ref":"master","sha":"6af2c7def33f1b330f840c7a2ca0f275bc5b5f18","user":{"login":"wso2","id":533043,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzMzA0Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/533043?v=4","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":25507523,"node_id":"MDEwOlJlcG9zaXRvcnkyNTUwNzUyMw==","name":"wso2-axis2-transports","full_name":"wso2/wso2-axis2-transports","private":false,"owner":{"login":"wso2","id":533043,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzMzA0Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/533043?v=4","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wso2/wso2-axis2-transports","description":null,"fork":false,"url":"https://api.github.com/repos/wso2/wso2-axis2-transports","forks_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/forks","keys_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/teams","hooks_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/hooks","issue_events_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/events","assignees_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/tags","blobs_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/languages","stargazers_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/stargazers","contributors_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/contributors","subscribers_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/subscribers","subscription_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/subscription","commits_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/merges","archive_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/downloads","issues_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/labels{/name}","releases_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/wso2-axis2-transports/deployments","created_at":"2014-10-21T07:03:40Z","updated_at":"2018-11-26T09:00:26Z","pushed_at":"2018-11-26T09:00:23Z","git_url":"git://github.com/wso2/wso2-axis2-transports.git","ssh_url":"git@github.com:wso2/wso2-axis2-transports.git","clone_url":"https://github.com/wso2/wso2-axis2-transports.git","svn_url":"https://github.com/wso2/wso2-axis2-transports","homepage":null,"size":1442,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":114,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":114,"open_issues":4,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/185"},"html":{"href":"https://github.com/wso2/wso2-axis2-transports/pull/185"},"issue":{"href":"https://api.github.com/repos/wso2/wso2-axis2-transports/issues/185"},"comments":{"href":"https://api.github.com/repos/wso2/wso2-axis2-transports/issues/185/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/185/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/wso2-axis2-transports/pulls/185/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/wso2-axis2-transports/statuses/d6ac7471bc7d4a2cd4ca51904ee960223683cac6"}},"author_association":"NONE"}}
{"actor":{"display_login":"abeykoon"}}