{"action":"created","issue":{"url":"https://api.github.com/repos/openhab/openhab/issues/3338","labels_url":"https://api.github.com/repos/openhab/openhab/issues/3338/labels{/name}","comments_url":"https://api.github.com/repos/openhab/openhab/issues/3338/comments","events_url":"https://api.github.com/repos/openhab/openhab/issues/3338/events","html_url":"https://github.com/openhab/openhab/issues/3338","id":113079276,"number":3338,"title":"Bugs in sendMail action","user":{"login":"Dan1001","id":4541543,"avatar_url":"https://avatars.githubusercontent.com/u/4541543?v=3","gravatar_id":"","url":"https://api.github.com/users/Dan1001","html_url":"https://github.com/Dan1001","followers_url":"https://api.github.com/users/Dan1001/followers","following_url":"https://api.github.com/users/Dan1001/following{/other_user}","gists_url":"https://api.github.com/users/Dan1001/gists{/gist_id}","starred_url":"https://api.github.com/users/Dan1001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dan1001/subscriptions","organizations_url":"https://api.github.com/users/Dan1001/orgs","repos_url":"https://api.github.com/users/Dan1001/repos","events_url":"https://api.github.com/users/Dan1001/events{/privacy}","received_events_url":"https://api.github.com/users/Dan1001/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-23T18:52:26Z","updated_at":"2015-10-23T19:57:01Z","closed_at":null,"body":" There are at least two bugs in the sendMail action\r\n\r\nFirst, image attachments arrive as a file called \"Attachment\" without a suffix/extension, and hence can't be opened on many systems.\r\n\r\nSecond, urls with basic authentication aren't accepted (i.e. username:password@), and give the error log I've copied below. Obviously a problem when using sendMail with webcam images.\r\n\r\n(Opening up a new issue because the old one was closed, and I'm not sure it's monitored; apologies if that's wrong and I'm just duplicating posts)\r\n\r\nthank you!\r\n\r\nDan\r\n\r\n18:02:29.826 ERROR o.o.action.mail.internal.Mail[:97]- Error adding attachment to email.\r\norg.apache.commons.mail.EmailException: Invalid URL set:http://admin:MYPASSWORD@192.168.1.145:80/dms.jpg\r\nat org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:367)\r\nat org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:311)\r\nat org.openhab.action.mail.internal.Mail.sendMail(Mail.java:93)\r\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\nCaused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://admin:MYPASSWORD@192.168.1.145:80/dms.jpg\r\nat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1627)\r\nat java.net.URL.openStream(URL.java:1037)\r\nat org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:362)\r\nat org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:311)\r\nat org.openhab.action.mail.internal.Mail.sendMail(Mail.java:93)\r\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)"},"comment":{"url":"https://api.github.com/repos/openhab/openhab/issues/comments/150675120","html_url":"https://github.com/openhab/openhab/issues/3338#issuecomment-150675120","issue_url":"https://api.github.com/repos/openhab/openhab/issues/3338","id":150675120,"user":{"login":"9037568","id":9916473,"avatar_url":"https://avatars.githubusercontent.com/u/9916473?v=3","gravatar_id":"","url":"https://api.github.com/users/9037568","html_url":"https://github.com/9037568","followers_url":"https://api.github.com/users/9037568/followers","following_url":"https://api.github.com/users/9037568/following{/other_user}","gists_url":"https://api.github.com/users/9037568/gists{/gist_id}","starred_url":"https://api.github.com/users/9037568/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/9037568/subscriptions","organizations_url":"https://api.github.com/users/9037568/orgs","repos_url":"https://api.github.com/users/9037568/repos","events_url":"https://api.github.com/users/9037568/events{/privacy}","received_events_url":"https://api.github.com/users/9037568/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T19:57:01Z","updated_at":"2015-10-23T19:57:01Z","body":"And from RFC3986:\n\n   *Use of the format \"user:password\" in the userinfo field is\n   deprecated.  Applications should not render as clear text any data\n   after the first colon (\":\") character found within a userinfo\n   subcomponent unless the data after the colon is the empty string\n   (indicating no password).  Applications may choose to ignore or\n   reject such data when it is received as part of a reference and\n   should reject the storage of such data in unencrypted form.*\n\n\n\nOn Fri, Oct 23, 2015 at 3:49 PM, Chris Carman <namraccr@gmail.com> wrote:\n\n> It appears some browsers have removed or deprecated the ability to pass\n> credentials in this way:\n>\n> http://serverfault.com/questions/371907/can-you-pass-user-pass-for-http-basic-authentication-in-url-parameters\n>      https://code.google.com/p/chromium/issues/detail?id=123150\n>\n>\n> On Fri, Oct 23, 2015 at 2:52 PM, Dan1001 <notifications@github.com> wrote:\n>\n>> There are at least two bugs in the sendMail action\n>>\n>> First, image attachments arrive as a file called \"Attachment\" without a\n>> suffix/extension, and hence can't be opened on many systems.\n>>\n>> Second, urls with basic authentication aren't accepted (i.e.\n>> username:password@), and give the error log I've copied below. Obviously\n>> a problem when using sendMail with webcam images.\n>>\n>> (Opening up a new issue because the old one was closed, and I'm not sure\n>> it's monitored; apologies if that's wrong and I'm just duplicating posts)\n>>\n>> thank you!\n>>\n>> Dan\n>>\n>> 18:02:29.826 ERROR o.o.action.mail.internal.Mail[:97]- Error adding\n>> attachment to email.\n>> org.apache.commons.mail.EmailException: Invalid URL set:\n>> http://admin:MYPASSWORD@192.168.1.145:80/dms.jpg\n>> at org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:367)\n>> at org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:311)\n>> at org.openhab.action.mail.internal.Mail.sendMail(Mail.java:93)\n>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n>> at\n>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n>> at\n>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n>> Caused by: java.io.IOException: Server returned HTTP response code: 401\n>> for URL: http://admin:MYPASSWORD@192.168.1.145:80/dms.jpg\n>> at\n>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1627)\n>> at java.net.URL.openStream(URL.java:1037)\n>> at org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:362)\n>> at org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:311)\n>> at org.openhab.action.mail.internal.Mail.sendMail(Mail.java:93)\n>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n>>\n>> —\n>> Reply to this email directly or view it on GitHub\n>> <https://github.com/openhab/openhab/issues/3338>.\n>>\n>\n>\n"}}