Merge "Fixed SMTP settigns enforcing"
diff --git a/_states/jenkins_smtp.py b/_states/jenkins_smtp.py
index 98bbd6d..969019c 100644
--- a/_states/jenkins_smtp.py
+++ b/_states/jenkins_smtp.py
@@ -5,7 +5,8 @@
 def result = ""
 for(desc in [Jenkins.getInstance().getDescriptor("hudson.plugins.emailext.ExtendedEmailPublisher"),Jenkins.getInstance().getDescriptor("hudson.tasks.Mailer")]){{
     if(desc.getSmtpServer().equals("{host}") &&
-       desc.getSmtpAuthUsername().equals("{username}") &&
+       ((desc instanceof hudson.plugins.emailext.ExtendedEmailPublisherDescriptor && desc.getSmtpAuthUsername().equals("{username}")) ||
+        (desc instanceof hudson.tasks.Mailer$DescriptorImpl && desc.getSmtpAuthUserName().equals("{username}"))) &&
        desc.getSmtpAuthPassword().toString().equals("{password}") &&
        desc.getSmtpPort().equals("{port}") &&
        desc.getUseSsl() == {ssl} &&