Skip to content

Commit

Permalink
Merge pull request #279 from ndeloof/JENKINS-11209
Browse files Browse the repository at this point in the history
[FIXED JENKINS-11209] clarify the notification sender email vs system adm
  • Loading branch information
olamy committed Oct 7, 2011
2 parents 829ccf0 + 06f88e0 commit 5470411
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 41 deletions.
39 changes: 21 additions & 18 deletions core/src/main/java/hudson/tasks/Mailer.java
Expand Up @@ -24,28 +24,30 @@
*/
package hudson.tasks;

import static hudson.Util.fixEmptyAndTrim;

import hudson.EnvVars;
import hudson.Extension;
import hudson.Functions;
import hudson.Launcher;
import hudson.RestrictedSince;
import hudson.Util;
import static hudson.Util.fixEmptyAndTrim;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.model.User;
import hudson.model.UserPropertyDescriptor;
import jenkins.model.Jenkins;
import hudson.util.FormValidation;
import hudson.util.Secret;
import org.apache.tools.ant.types.selectors.SelectorUtils;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.export.Exported;

import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
Expand All @@ -56,15 +58,15 @@
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.servlet.ServletException;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.net.InetAddress;
import java.net.UnknownHostException;

import org.apache.tools.ant.types.selectors.SelectorUtils;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.export.Exported;

import jenkins.model.Jenkins;
import net.sf.json.JSONObject;

/**
Expand Down Expand Up @@ -439,7 +441,8 @@ public FormValidation doCheckDefaultSuffix(@QueryParameter String value) {
public FormValidation doSendTestMail(
@QueryParameter String smtpServer, @QueryParameter String adminAddress, @QueryParameter boolean useSMTPAuth,
@QueryParameter String smtpAuthUserName, @QueryParameter String smtpAuthPassword,
@QueryParameter boolean useSsl, @QueryParameter String smtpPort) throws IOException, ServletException, InterruptedException {
@QueryParameter boolean useSsl, @QueryParameter String smtpPort,
@QueryParameter String sendTestMailTo) throws IOException, ServletException, InterruptedException {
try {
if (!useSMTPAuth) smtpAuthUserName = smtpAuthPassword = null;

Expand All @@ -448,7 +451,7 @@ public FormValidation doSendTestMail(
msg.setContent("This is test email #" + testEmailCount + " sent from " + Jenkins.getInstance().getDisplayName(), "text/plain");
msg.setFrom(new InternetAddress(adminAddress));
msg.setSentDate(new Date());
msg.setRecipient(Message.RecipientType.TO, new InternetAddress(adminAddress));
msg.setRecipient(Message.RecipientType.TO, new InternetAddress(sendTestMailTo));

Transport.send(msg);
return FormValidation.ok(Messages.Mailer_EmailSentSuccessfully());
Expand Down
9 changes: 7 additions & 2 deletions core/src/main/resources/hudson/tasks/Mailer/global.jelly
Expand Up @@ -36,7 +36,7 @@ THE SOFTWARE.
<f:entry title="${%Default user e-mail suffix}" field="defaultSuffix">
<f:textbox />
</f:entry>
<f:entry title="${%System Admin E-mail Address}" field="adminAddress">
<f:entry title="${%Sender E-mail Address}" field="adminAddress">
<f:textbox />
</f:entry>
<f:advanced>
Expand All @@ -59,6 +59,11 @@ THE SOFTWARE.
<f:textbox />
</f:entry>
</f:advanced>
<f:validateButton method="sendTestMail" title="${%Test configuration by sending e-mail to System Admin Address}" with="smtpServer,adminAddress,useSMTPAuth,smtpAuthUserName,smtpAuthPassword,useSsl,smtpPort,charset" />
<f:optionalBlock title="${%Test configuration by sending test e-mail}">
<f:entry title="${%Test e-mail recipient}">
<f:textbox name="sendTestMailTo"/>
</f:entry>
<f:validateButton method="sendTestMail" title="${%Test configuration}" with="sendTestMailTo,smtpServer,adminAddress,useSMTPAuth,smtpAuthUserName,smtpAuthPassword,useSsl,smtpPort,charset" />
</f:optionalBlock>
</f:section>
</j:jelly>
Expand Up @@ -30,5 +30,5 @@ SMTP\ server=SMTP Server
User\ Name=Brugernavn
System\ Admin\ E-mail\ Address=Systemadministratorens E-mail adresse
Charset=Karakters\u00e6t
Test\ configuration\ by\ sending\ e-mail\ to\ System\ Admin\ Address=Test konfigurationen ved at sende en e-mail til systemadministratorens adresse
Test\ configuration\ by\ sending\ e-mail=Test konfigurationen ved at sende en e-mail
Jenkins\ URL=Jenkins URL
Expand Up @@ -21,9 +21,9 @@
# THE SOFTWARE.

E-mail\ Notification=E-Mail Benachrichtigung
Test\ configuration\ by\ sending\ e-mail\ to\ System\ Admin\ Address=E-Mail an Systemadministrator versenden, um Konfiguration zu testen
Test\ configuration\ by\ sending\ e-mail=E-Mail versenden, um Konfiguration zu testen
SMTP\ server=SMTP-Server
Default\ user\ e-mail\ suffix=Standardendung für E-Mail-Adressen
Default\ user\ e-mail\ suffix=Standardendung f\u00b8r E-Mail-Adressen
System\ Admin\ E-mail\ Address=E-Mail-Adresse des Systemadministrators
Jenkins\ URL=Jenkins URL
User\ Name=Benutzername
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/resources/hudson/tasks/Mailer/global_es.properties
Expand Up @@ -20,15 +20,15 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

E-mail\ Notification=Notificación por correo electrónico
E-mail\ Notification=Notificaci\u00dbn por correo electr\u00dbnico
SMTP\ server=Servidor de correo saliente (SMTP)
Default\ user\ e-mail\ suffix=sufijo de email por defecto
System\ Admin\ E-mail\ Address=Dirección del administrador
Jenkins\ URL=Dirección web de Jenkins
Use\ SMTP\ Authentication=Usar autenticación SMTP
System\ Admin\ E-mail\ Address=Direcci\u00dbn del administrador
Jenkins\ URL=Direcci\u00dbn web de Jenkins
Use\ SMTP\ Authentication=Usar autenticaci\u00dbn SMTP
User\ Name=Nombre de usuario
Password=Contraseña
Password=Contrase\u00d2a
Use\ SSL=Usar seguridad SSL
SMTP\ Port=Puerto de SMTP
Test\ configuration\ by\ sending\ e-mail\ to\ System\ Admin\ Address=Probar la configuración enviando un correo a la dirección del administrador
Test\ configuration\ by\ sending\ e-mail=Probar la configuraci\u00dbn enviando un correo
Charset=Juego de caracteres
Expand Up @@ -21,11 +21,12 @@
# THE SOFTWARE.

E-mail\ Notification=Notification par email
Test\ configuration\ by\ sending\ e-mail\ to\ System\ Admin\ Address=Tester la configuration en envoyant un email à l''administrateur système.
Test\ configuration\ by\ sending\ e-mail=Tester la configuration en envoyant un email
Test\ e-mail\ recipient=Destinataire du email de test
SMTP\ server=Serveur SMTP
Charset=Jeu de caract\u00E8res
Default\ user\ e-mail\ suffix=Suffixe par défaut des emails des utilisateurs
System\ Admin\ E-mail\ Address=Adresse email de l''administrateur système
Charset=Jeu de caract\u00e8res
Default\ user\ e-mail\ suffix=Suffixe par d\u00c8faut des emails des utilisateurs
System\ Admin\ E-mail\ Address=Adresse email de l''administrateur syst\u00cbme
Jenkins\ URL=URL de Jenkins
User\ Name=Nom d''utilisateur
Password=Mot de passe
Expand Down
Expand Up @@ -21,7 +21,7 @@
# THE SOFTWARE.

E-mail\ Notification=E-mail \u901a\u77e5
Test\ configuration\ by\ sending\ e-mail\ to\ System\ Admin\ Address=\u7ba1\u7406\u8005\u306b\u30e1\u30fc\u30eb\u9001\u4fe1\u3057\u3066\u8a2d\u5b9a\u3092\u78ba\u8a8d
Test\ configuration\ by\ sending\ e-mail=\u7ba1\u7406\u8005\u306b\u30e1\u30fc\u30eb\u9001\u4fe1\u3057\u3066\u8a2d\u5b9a\u3092\u78ba\u8a8d
SMTP\ server=SMTP\u30b5\u30fc\u30d0\u30fc
Default\ user\ e-mail\ suffix=E-mail\u306e\u30b5\u30d5\u30a3\u30c3\u30af\u30b9
System\ Admin\ E-mail\ Address=\u7ba1\u7406\u8005\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9
Expand Down
Expand Up @@ -21,7 +21,7 @@
# THE SOFTWARE.

E-mail\ Notification=E-mail
Test\ configuration\ by\ sending\ e-mail\ to\ System\ Admin\ Address=Test configuratie door een e-mail te versturen naar de systeemadministrator
Test\ configuration\ by\ sending\ e-mail=Test configuratie door een e-mail te versturen
SMTP\ Port=SMTP Poort
SMTP\ server=SMTP server
Default\ user\ e-mail\ suffix=Standaard e-mail suffix
Expand Down
Expand Up @@ -21,10 +21,10 @@
# THE SOFTWARE.

E-mail\ Notification=Notifica\u00e7\u00e3o de E-mail
Test\ configuration\ by\ sending\ e-mail\ to\ System\ Admin\ Address=Configura\u00e7\u00e3o de teste para enviar e-mail para o endere\u00e7o do Administrador do Sistema
Test\ configuration\ by\ sending\ e-mail=Configura\u00e7\u00e3o de teste para enviar e-mail
SMTP\ server=Servidor SMTP
Default\ user\ e-mail\ suffix=Sufixo padr\u00e3o para e-mail de usu\u00e1rio
System\ Admin\ E-mail\ Address=Endere\u00E7o de E-mail do Administrador do Sistema
System\ Admin\ E-mail\ Address=Endere\u00e7o de E-mail do Administrador do Sistema
Jenkins\ URL=URL do Jenkins
User\ Name=Nome do Usu\u00e1rio
Password=Senha
Expand Down
Expand Up @@ -21,8 +21,8 @@
# THE SOFTWARE.

E-mail\ Notification=\u0423\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u043e\u0439
Test\ configuration\ by\ sending\ e-mail\ to\ System\ Admin\ Address=\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443
SMTP\ Port=\u041F\u043E\u0440\u0442 SMTP
Test\ configuration\ by\ sending\ e-mail=\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443
SMTP\ Port=\u041f\u043e\u0440\u0442 SMTP
SMTP\ server=\u0421\u0435\u0440\u0432\u0435\u0440 SMTP
Default\ user\ e-mail\ suffix=\u0421\u0443\u0444\u0444\u0438\u043a\u0441 \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e
System\ Admin\ E-mail\ Address=\u0410\u0434\u0440\u0435\u0441 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430
Expand Down
Expand Up @@ -21,7 +21,7 @@
# THE SOFTWARE.

E-mail\ Notification=E-posta Bilgilendirmesi
Test\ configuration\ by\ sending\ e-mail\ to\ System\ Admin\ Address=Sistem\ Admin\ adresine\ e-posta\ atarak\ konfig\u00fcrasyonu\ test\ et
Test\ configuration\ by\ sending\ e-mail=atarak konfig\u00fcrasyonu test et
SMTP\ server=SMTP\ sunucusu
Default\ user\ e-mail\ suffix=Varsay\u0131lan kullan\u0131c\u0131 e-posta soneki
System\ Admin\ E-mail\ Address=Sistem\ Admin\ e-posta\ Adresi
Expand Down
Expand Up @@ -21,7 +21,7 @@
# THE SOFTWARE.

E-mail\ Notification=\u90ae\u4ef6\u901a\u77e5
Test\ configuration\ by\ sending\ e-mail\ to\ System\ Admin\ Address=\u7528\u7cfb\u7edf\u7ba1\u7406\u5458\u6d4b\u8bd5\u90ae\u4ef6\u914d\u7f6e
Test\ configuration\ by\ sending\ e-mail=\u7528\u7cfb\u7edf\u7ba1\u7406\u5458\u6d4b\u8bd5\u90ae\u4ef6\u914d\u7f6e
SMTP\ server=SMTP\u670d\u52a1\u5668
Default\ user\ e-mail\ suffix=\u7528\u6237\u9ed8\u8ba4\u90ae\u4ef6\u540e\u7f00
System\ Admin\ E-mail\ Address=\u7cfb\u7edf\u7ba1\u7406\u5458\u90ae\u4ef6\u5730\u5740
Expand Down

0 comments on commit 5470411

Please sign in to comment.