{"action":"created","issue":{"url":"https://api.github.com/repos/privacyidea/privacyidea/issues/350","repository_url":"https://api.github.com/repos/privacyidea/privacyidea","labels_url":"https://api.github.com/repos/privacyidea/privacyidea/issues/350/labels{/name}","comments_url":"https://api.github.com/repos/privacyidea/privacyidea/issues/350/comments","events_url":"https://api.github.com/repos/privacyidea/privacyidea/issues/350/events","html_url":"https://github.com/privacyidea/privacyidea/issues/350","id":144210455,"number":350,"title":"sending test email for email server raises authentication error using plain auth","user":{"login":"mgisbers","id":372340,"avatar_url":"https://avatars.githubusercontent.com/u/372340?v=3","gravatar_id":"","url":"https://api.github.com/users/mgisbers","html_url":"https://github.com/mgisbers","followers_url":"https://api.github.com/users/mgisbers/followers","following_url":"https://api.github.com/users/mgisbers/following{/other_user}","gists_url":"https://api.github.com/users/mgisbers/gists{/gist_id}","starred_url":"https://api.github.com/users/mgisbers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgisbers/subscriptions","organizations_url":"https://api.github.com/users/mgisbers/orgs","repos_url":"https://api.github.com/users/mgisbers/repos","events_url":"https://api.github.com/users/mgisbers/events{/privacy}","received_events_url":"https://api.github.com/users/mgisbers/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/privacyidea/privacyidea/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/privacyidea/privacyidea/milestones/24","html_url":"https://github.com/privacyidea/privacyidea/milestones/2.12%20Nitrokey","labels_url":"https://api.github.com/repos/privacyidea/privacyidea/milestones/24/labels","id":1664586,"number":24,"title":"2.12 Nitrokey","description":"We should start to support the nitrokey.\r\nThe library is no extracted from the App.","creator":{"login":"cornelinux","id":1908620,"avatar_url":"https://avatars.githubusercontent.com/u/1908620?v=3","gravatar_id":"","url":"https://api.github.com/users/cornelinux","html_url":"https://github.com/cornelinux","followers_url":"https://api.github.com/users/cornelinux/followers","following_url":"https://api.github.com/users/cornelinux/following{/other_user}","gists_url":"https://api.github.com/users/cornelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/cornelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cornelinux/subscriptions","organizations_url":"https://api.github.com/users/cornelinux/orgs","repos_url":"https://api.github.com/users/cornelinux/repos","events_url":"https://api.github.com/users/cornelinux/events{/privacy}","received_events_url":"https://api.github.com/users/cornelinux/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":1,"state":"open","created_at":"2016-03-24T19:20:41Z","updated_at":"2016-03-29T10:51:12Z","due_on":"2016-05-04T22:00:00Z","closed_at":null},"comments":3,"created_at":"2016-03-29T09:37:01Z","updated_at":"2016-03-29T11:00:52Z","closed_at":"2016-03-29T10:51:12Z","body":"When trying to test a smtpserver configuration using git trunk version, I always get an authorization error on the mailserver and in privacyidea.log when using an plain auth.\r\n\r\nI made sure credentials are correct and logging in 'by hand' works as expected.\r\n\r\nprivacyidea.log:\r\n```\r\nSMTPAuthenticationError: (535, '5.7.8 Error: authentication failed:')\r\n[2016-03-28 19:55:39,479][30338][140453494273792][WARNING][privacyidea.lib.crypto:326] 'NoneType' object has no attribute 'find'\r\n[2016-03-28 19:55:41,528][30338][140453494273792][ERROR][privacyidea.app:1423] Exception on /smtpserver/send_test_email [POST]\r\nTraceback (most recent call last):\r\n  File \"/opt/privacyidea/venv/local/lib/python2.7/site-packages/flask/app.py\", line 1817, in wsgi_app\r\n    response = self.full_dispatch_request()\r\n  File \"/opt/privacyidea/venv/local/lib/python2.7/site-packages/flask/app.py\", line 1477, in full_dispatch_request\r\n    rv = self.handle_user_exception(e)\r\n  File \"/opt/privacyidea/venv/local/lib/python2.7/site-packages/flask/app.py\", line 1381, in handle_user_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/opt/privacyidea/venv/local/lib/python2.7/site-packages/flask/app.py\", line 1475, in full_dispatch_request\r\n    rv = self.dispatch_request()\r\n  File \"/opt/privacyidea/venv/local/lib/python2.7/site-packages/flask/app.py\", line 1461, in dispatch_request\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"/opt/privacyidea/privacyidea/api/lib/prepolicy.py\", line 96, in policy_wrapper\r\n    return wrapped_function(*args, **kwds)\r\n  File \"/opt/privacyidea/privacyidea/lib/log.py\", line 125, in log_wrapper\r\n    f_result = func(*args, **kwds)\r\n  File \"/opt/privacyidea/privacyidea/api/smtpserver.py\", line 146, in test\r\n    \"The configuration %s is working.\" % identifier)\r\n  File \"/opt/privacyidea/privacyidea/lib/smtpserver.py\", line 93, in test_email\r\n    mail.login(config.username, password)\r\n  File \"/usr/lib/python2.7/smtplib.py\", line 613, in login\r\n    raise SMTPAuthenticationError(code, resp)\r\n```\r\n\r\nmailserver (IPv6 address scrambled):\r\n```\r\nMär 28 19:58:18 mx postfix/smtpd[3491]: connect from unknown[::abcd:]\r\nMär 28 19:58:18 mx postfix/smtpd[3491]: Anonymous TLS connection established from unknown[::abcd]: TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)\r\nMär 28 19:58:20 mx postfix/smtpd[3491]: warning: unknown[::abcd]: SASL PLAIN authentication failed:\r\nMär 28 19:58:20 mx postfix/smtpd[3491]: lost connection after AUTH from unknown[::abcd]\r\n```\r\n\r\nAll packages needed for installation and requirements.txt are installed.\r\n\r\nAny hints?"},"comment":{"url":"https://api.github.com/repos/privacyidea/privacyidea/issues/comments/202831961","html_url":"https://github.com/privacyidea/privacyidea/issues/350#issuecomment-202831961","issue_url":"https://api.github.com/repos/privacyidea/privacyidea/issues/350","id":202831961,"user":{"login":"cornelinux","id":1908620,"avatar_url":"https://avatars.githubusercontent.com/u/1908620?v=3","gravatar_id":"","url":"https://api.github.com/users/cornelinux","html_url":"https://github.com/cornelinux","followers_url":"https://api.github.com/users/cornelinux/followers","following_url":"https://api.github.com/users/cornelinux/following{/other_user}","gists_url":"https://api.github.com/users/cornelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/cornelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cornelinux/subscriptions","organizations_url":"https://api.github.com/users/cornelinux/orgs","repos_url":"https://api.github.com/users/cornelinux/repos","events_url":"https://api.github.com/users/cornelinux/events{/privacy}","received_events_url":"https://api.github.com/users/cornelinux/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T11:00:52Z","updated_at":"2016-03-29T11:00:52Z","body":"You can pull the update. The fix is a 1,5-liner. (Most code are the tests ;-)\r\nWith the update the TEST should also run."}}