Plugin Information
This plugin allows you to configure every aspect of email notifications. You can customize when an email is sent, who should receive it, and what the email says. GeneralThis plugin extends Hudson's built in email notification functionality by giving you more control. It provides customization of 3 areas.
ConfigurationGlobal ConfigurationBefore using email-ext on a project, you must configure some global settings. Go to Hudson's System configuration page. Manage Hudson -> Configure System The section titled Extended E-mail Notification is where you can configure global email-ext properties. The properties here should match the settings for your smtp mail server. This section is set up to mirror Hudson's own email publisher, however there are a few additions. The inputs labeled Default Subject and Default Content, allow you to configure the email content on a global level. This can be used to greatly simplify the configuration you need to do for all projects. Project ConfigurationFor a project to use the email-ext plugin, you need to enable it in the project configuration page. Select the checkbox labeled "Editable Email Notification" in the "Post-build Actions" section. Basic ConfigurationThere are three fields that you can edit when the plugin is enabled.
Advanced ConfigurationTo see the advanced configuration for the plugin, click the "Advanced" button. This section allows you to specify recipients for each type of email trigger. By default, the only trigger configured is the "Failure" trigger. To add more triggers, select one from the dropdown, and it will be added to the list. Once you have added a trigger, you have several options. If you click "?" (question mark) next to a trigger, it will tell you what conditions must be met for it to send an email.
Email TokensThe email-ext plugin uses tokens to allow dynamic data to be inserted into an email subject line or body. A token is a string that starts with a $ (dollar sign) and is terminated by whitespace. When an email is triggered, any tokens in the subject or content fields will be replaced dynamically by the actual value that it represents. Also, the "value" of a token can contain other tokens, that will themselves be replaced by actual content. For instance, the $DEFAULT_SUBJECT token is replaced by the text (and other tokens) that is in the Default Subject field from the global configuration page. Similarly, the $PROJECT_DEFAULT_SUBJECT token will be replaced by the value of the Default Subject field from the project configuration page. The email-ext plugin sets the email content fields with default values when you enable it for your project. The Default Subject and Content fields on the project config page default to $DEFAULT_SUBJECT and $DEFAULT_CONTENT (respectively), so that it will automatically use the global configuration. Similarly, the per-trigger content fields default to $PROJECT_DEFAULT_SUBJECT and $PROJECT_DEFAULT_CONTENT, so that they will automatically use the project's configuration. Since the value of a token can contain other tokens, this provides different points of configuration that can allow you to quickly make changes at the broadest level (all projects), the narrowest level (individual email), and in between (individual project). To see a list of all available email tokens and what they display, you can click the "?" (question mark) at the top of the email-ext section on the project configuration screen. Extend Email-extMake sure you have installed Maven 2 (why?) and JDK 5.0 or later. Make also sure you have properly configured your ~/.m2/settings.xml as explained in the Plugin Tutorial. This is needed to build properly any Hudson plugin. TODO Check out and buildEmail-ext plugin How to check out the source and build: svn co https://svn.dev.java.net/svn/hudson/trunk/hudson/plugins/email-ext cd email-ext mvn
Version History2.6 (Jul 20, 2010)
2.5 (Jan 20, 2010)
2.4 (Jan 7, 2010)
2.3 (Jan 6, 2010)
2.2.1 (Dec 23, 2008) |
Comments (33)
Apr 15, 2009
Frank says:
How do I create a contiguous string out of tokens, if each token is delimited by...How do I create a contiguous string out of tokens, if each token is delimited by whitespace?
For example, I want to have the following in my email text:
FindBugs - http://mycompany.com/myproject/findbugsResult/
so would like to use the following template
FindBugs - $BUILD_URLfindbugsResult/
as the BUILD_URL token would be substituted by
http://mycompany.com/myproject/
Of course, this does not work as there is no trailing whitespace after the token reference. I think it would be better to have the token references start and end with a dollar sign, so that this kind of thing is achievable.
May 01, 2009
Mohamed Osman says:
Can you actually include the files that changed with the $CHANGES token? From w...Can you actually include the files that changed with the $CHANGES token?
From what i can see in the code
${CHANGES, showPaths=true}should work, however it doesn't so i assume im doing it wrong or it's still a work in progress.
Anyone got it to work?
Jun 04, 2009
Pramod Reddy Chinthapalli says:
How to use build parameters as tokens? For example, I have defined PROJECT_BUI...How to use build parameters as tokens?
For example, I have defined PROJECT_BUILD_NAME as build parameter When I use $PROJECT_BUILD_NAME, it does not print the value in the parameter, instead it prints parameter name.
Jan 18, 2010
Andrea Salicetti says:
I've the same problem!I've the same problem!
Jul 06, 2009
Jason says:
Anyone have any luck with, ${CHANGES, showPaths=true} Also, what is the us...Anyone have any luck with,
${CHANGES, showPaths=true}Also, what is the username and password for accessing the source code?
Jul 07, 2009
jvizueta says:
I would also like to know how to add the files changed, I think it's a very impo...I would also like to know how to add the files changed, I think it's a very important feature, does anybody know how to get this done? the code mentioned doesn't work for me either, I get the same behavior than the one described by KC Baltz in the following thread http://www.nabble.com/Sending-emails-with-detailed-changes--td22252613.html
Should I use the hpi published in the next address, or does email-ext plugin has this feature natively? http://techkriti.wordpress.com/2008/08/30/using-groovy-with-hudson-to-send-rich-text-email/
Oct 02, 2009
Kfir Shay says:
is there an email token for the list of Committers, I would like to have the use...is there an email token for the list of Committers, I would like to have the user name as part of the blame email subject
Dec 31, 2009
yunshan says:
When I use Email-ext plugin to send mail, the following error come up: BUILD SUC...When I use Email-ext plugin to send mail, the following error come up:
BUILD SUCCESSFUL
Total time: 0 seconds
Email was triggered for: Success
There are 1 triggered emails.
Sending email for trigger: Success
Sending e-mails to: xxxxxxx
ERROR: Could not send email as a part of the post-build publishers.
com.sun.mail.smtp.SMTPSendFailedException: 454 5.7.3 Client does not have permission to submit mail to this server.
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
at javax.mail.Transport.send0(Transport.java:169)
at javax.mail.Transport.send(Transport.java:98)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:256)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:241)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:199)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:583)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:564)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:551)
at hudson.model.Build$RunnerImpl.cleanUp(Build.java:158)
at hudson.model.Run.run(Run.java:1221)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:122)
Finished: SUCCESS
Dec 31, 2009
yunshan says:
I want debug the email process, so Is there any way to put the com.sun.mail pac...I want debug the email process, so
Is there any way to put the com.sun.mail package under debug traces?
Jan 03, 2010
yunshan says:
It would be a bug with Email-ext plugin, with the same configuration, the basic ...It would be a bug with Email-ext plugin, with the same configuration, the basic E-mail Notification works all right, but the Email-ext works failed.
Anyone can help?
Thanks!
Jan 07, 2010
yunshan says:
I followed the "Using Groovy with Hudson to send rich text email" to ...I followed the "Using Groovy with Hudson to send rich text email" to config and send mail.
and I found when the content contains Chinese characters, it would presented as ?????,
I have tried many time, to change configurations, but it still get better.
Is it a bug of Email-ext when handle utf-8 characters?
Jan 18, 2010
Andrea Salicetti says:
Same problem as the one highlighted by Pramod Reddy Chinthapalli on June 04, 200...Same problem as the one highlighted by Pramod Reddy Chinthapalli on June 04, 2009.
It seems to be impossible to use build parameters as tokens - Look also at Issue 2413
It would be very very useful, instead!
Jan 19, 2010
Mark Hughes says:
To use build parameters as tokens, it seems the syntax is: ${ENV,var="parameter...To use build parameters as tokens, it seems the syntax is:
${ENV,var="parametername"}
e.g., for a parameter named SRC_BUILD_BRANCH:
${ENV,var="SRC_BUILD_BRANCH"}
It's just taken me a good little while to go through all the possible permutations and find the exact syntax that works!
Jan 19, 2010
Andrea Salicetti says:
Thank you very much Mark! With your hint, I changed also the issue above an...Thank you very much Mark!
With your hint, I changed also the issue above and marked as Fixed.
Apr 21
Pramod Reddy Chinthapalli says:
Thanks Mark and Andrea.Thanks Mark and Andrea.
Feb 17
Mark Wolff says:
Can this method be used in the "Recipient list" as well? I'm not having an...Can this method be used in the "Recipient list" as well? I'm not having any luck using an environment variable with this method. I can use the same variable in the subject/content text and it works fine. I have a tool where a user can submit "pre-checkin" code to be built, like a try server for Hudson. So, the recipient name can change every build. But I just can't think of a way to make that happen.
Mar 02
SPQR says:
How do I insert newlines into the Default Content field? I've tried \n /n </p...How do I insert newlines into the Default Content field? I've tried \n /n </p> ?
Thanks.
Mar 02
SPQR says:
I figured it out. With HTML/text formatted emails, <br> works properly.I figured it out. With HTML/text formatted emails, <br> works properly.
May 27
Steven Nemetz says:
Just started using this and love the features. But it is not created URLs correc...Just started using this and love the features. But it is not created URLs correctly.
I have the server defined in the the hudson configuration. Other things use it fine. All the variables are correct in the environment.
But this plugin is returning http://localhost:8080/... for all urls instead of the correct hudson server
Using Hudson 1.353 and current plugin
Thanks,
Steven
Fixed. Was config issue. Didn't realize the server had to be set in this plugin.
May 28
Bruce Wobbe says:
I had this problem when I switched servers. My original address was something li...I had this problem when I switched servers. My original address was something like this server2.myco.com. I then moved hudson from that server by copying the hold hudson directory over to the new server which was server.myco.com. I then went into the hudson config and changed the server. However each email still had the old server address. I double and triple verified I made the change and restarted hudson, all kinds of things, still the wrong address. Finally I grep'ed for the wrong address and found it in the email-ext config file and changed it there. It then worked. I suspect it reads this address when the plugin is installed , then never again, so if you change the hudson server address , it never recognizes the change and never updates it's config.
Hope this helps
Apr 22
Deepak Chavan says:
i am unable to get mails from hudson, got below error ----------- Email...i am unable to get mails from hudson, got below error -----------
Email was triggered for: Failure
Sending email for trigger: Failure
Failed to create e-mail address for Sending email to: buildmaster@ebix.com devteam@premiertechnologygroup.com
ERROR: Could not send email as a part of the post-build publishers.
javax.mail.SendFailedException: Invalid Addresses;
nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
at javax.mail.Transport.send0(Transport.java:169)
at javax.mail.Transport.send(Transport.java:98)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:234)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:219)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:180)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:582)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:563)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:550)
at hudson.model.Build$RunnerImpl.cleanUp(Build.java:158)
at hudson.model.Run.run(Run.java:1285)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:122)
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
... 15 more Finished: FAILURE
May 28
Bruce Wobbe says:
This may be a similar problem to what I had. The standard email report uses a sp...This may be a similar problem to what I had. The standard email report uses a space separated list. email-ext uses a comma separated list. I saw a similar error to this when I had them both set up and used the same format(Comma separated ) for both.
May 28
Johnny Kauffman says:
I'm convinced that I've run into a rather simple bug with the email mechanisms: ...I'm convinced that I've run into a rather simple bug with the email mechanisms:
I have a project where I've only configured "Success" and "Failure" every night. According to the help texts, I should never see any other types of email. However, I still get emails about "Still Failing!", which threw me off since I'd set my inbox rules to look for "Failure!". I don't believe there's a way to work around the issue.
May 28
Tracy Davis says:
I am running Hudson 1.358 under Apache/Tomcat on Redhat 5.2 (Tikanga). &nbs...I am running Hudson 1.358 under Apache/Tomcat on Redhat 5.2 (Tikanga). I have setup Email to log broken builds including:
Upon testing email I receive: Failed to send out email
javax.mail.NoSuchProvider.Exception: smtp
Sendmail does work on this box.
Do I need to configure the /var/lib/tomcat5/.../server.xml file to include a SMTP server to correct ?
May 28
Bruce Wobbe says:
I have this set up and working great, however the only problem I have is where d...I have this set up and working great, however the only problem I have is where does the plugin get the email addresses? I have one user who has no email address and I don't know where to put it in? I am using ldap with subversion. I have email-ext set up to send out to culprits on failure. It works for the one user for which is says no email set up for user xxxx Does it use ldap or subversion to get the email address? I don't see where we have emails assigned under subversion so I am guessing ldap, however I don't know where to assign the addresses for that. If you can let me know how the plugin ddetermines email address in this scenario I'll look further, right now I haven't figured it out yet.
May 28
Steven Nemetz says:
It uses the user names from the revision control system. I'm using perforce and ...It uses the user names from the revision control system. I'm using perforce and it gets the entire email addresses from it. I believe if the version control only has a user name, it takes it and tacks on the domain that you put in the plugin config
Jun 09
Tim Voet says:
I didn't see a feature request page, or a roadmap, but i would like to request a...I didn't see a feature request page, or a roadmap, but i would like to request a feature, to have a token for REPOSITORY URL, we have SVN_REVISION, but i would like the url as well.
we have jobs setup that are similar with only the SVN URL changing. i would like to automatically include the SVN url in the emails, so that people can quickly know what version has just been deployed.
Jul 01
Daniel Triphaus says:
Hi, I would like to use Java-properties in the Mails. Is it already possible or ...Hi, I would like to use Java-properties in the Mails. Is it already possible or can you implement that?
Thanks!
Jul 02
Adam A says:
Hi, in version 2.2 there was a checkbox "this mail is a script" and "this mail i...Hi, in version 2.2 there was a checkbox "this mail is a script" and "this mail is html". Now there is a select with "plain text" or "text\html". Does this mean that groovy scripts in mails are no longer supported?
Jul 06
Brian Ketterer says:
Hey, Could we get a release date, or could you make a release of 2.6. I am exci...Hey,
Could we get a release date, or could you make a release of 2.6. I am excited to use the ${BUILD_LOG_REGEX feature and would like it to be available now or at least get a rough idea about when it will be available.
Thanks
Jul 23
Shen Liu says:
how use BUILD_LOG_REGEX to filter ant build file execute and result in build log...how use BUILD_LOG_REGEX to filter ant build file execute and result in build log?
my build has several ant file, and i use this:
${BUILD_LOG_REGEX, regex="(?i)\b(Buildfile|BUILD|FAILED)\b", linesAfter=1}but this only generate the "[...truncated XXX lines...]" content.
Jul 24
Shen Liu says:
i see. it is necessary to escape backslash('\'). so it is: ${BUILD_LOG_REGEX, r...i see. it is necessary to escape backslash('\'). so it is:
${BUILD_LOG_REGEX, regex="\\b(Buildfile|BUILD)\\b", linesAfter=1}Jul 26
Arnaud Héritier says:
Hi, Is it supposed to work with the LDAP plugin to retrieve emails of committe...Hi,
Is it supposed to work with the LDAP plugin to retrieve emails of committers from an external LDAP ?
http://wiki.hudson-ci.org/display/HUDSON/LDAP+Email+Plugin
Thx?