Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Section
h2.

JEMH

Installation

#

  1. Add
  1. the
  1. JEMH
  1. JAR

  1. Get
  1. the
  1. JAR
  1. specific
  1. for
  1. your
  1. version
  1. of
  1. Jira
  1. from
  1. the
  1. top
  1. of
  1. the
  1. page
  1. and
  1. copy
  1. to
  1. the
  1. Jira
_
  1. WEB-INF/lib
_
  1. folder
#
  1. Add
  1. the
  1. ldaputils
  1. jar
  1. (if
  1. you
  1. use
  1. ldap)

  1. Get
  1. the
  1. latest
  1. ldaputils
  1. jar
  1. (currently
  1. 1.0.13)
  1. from
  1. the
[LDAP
  1. LDAP Util
  1. library
|CLDAP:LDAP Util library]
  1. page,
  1. take
  1. the
_
  1. example-ldaputil.properties
_
  1. file
  1. from
  1. the
  1. JAR
  1. and
  1. rename
  1. it
_
  1. ldaputil.properties
_
  1. ,
  1. editing
  1. it
  1. as
  1. appropriate
#
  1. Setup
  1. Logging
  1. (optional)

  1. Modify
  1. /
  1. copy-and-modify
  1. the
_
  1. WEB-INF/classes/log4j.properties
_
  1. ,
  1. this
  1. will
  1. enable
  1. logging
  1. of
  1. all
  1. EMH
  1. messages
  1. to
  1. a
  1. separate
  1. file.
  1. Default
  1. is
  1. DEBUG,
  1. other
  1. values
  1. are
  1. 'INFO',
  1. 'WARN'
  1. and
  1. 'ERROR'.
{

Column
Wiki Markup
No Format
}
  1. 
    #
    # Create a separate appender
    #
    log4j.appender.EMHFileLog=org.apache.log4j.RollingFileAppender
    log4j.appender.EMHFileLog.File=atlassian-jira-emh.log
    log4j.appender.EMHFileLog.MaxFileSize=20480KB
    log4j.appender.EMHFileLog.MaxBackupIndex=5
    log4j.appender.EMHFileLog.layout=org.apache.log4j.PatternLayout
    log4j.appender.EMHFileLog.layout.ConversionPattern=%d %t %p [%c{4}] %m%n
    log4j.appender.EMHFileLog.Threshold=DEBUG
    
    #
    # add entries for the three EMH packages
    #
    log4j.logger.com.dolby.atlassian.jira.service.util.handler=DEBUG, EMHFileLog
    log4j.additivity.com.dolby.atlassian.jira.service.util.handler=false
    
    log4j.logger.com.dolby.atlassian.jira.service.util.handler.emh=DEBUG, EMHFileLog
    log4j.additivity.com.dolby.atlassian.jira.service.util.handler.emh=false
    
    log4j.logger.com.dolby.atlassian.jira.service.util.handler.emh.processor=DEBUG, EMHFileLog
    log4j.additivity.com.dolby.atlassian.jira.service.util.handler.emh.processor=false
    
    log4j.logger.com.dolby.atlassian.jira.service.util.handler.emh.service=DEBUG, EMHFileLog
    log4j.additivity.com.dolby.atlassian.jira.service.util.handler.emh.service=false
    
{noformat} (i) Enabling detailed logging of lower level mail operations in Jira is covered in [Logging email protocol details|http://confluence.atlassian.com/display/JIRA/Logging+email+protocol+details]. {tip:title=What no log file?} Whether working on Windows or Linux, a lack of recently updated _

(info) Enabling detailed logging of lower level mail operations in Jira is covered in Logging email protocol details.

Tip
titleWhat no log file?

Whether working on Windows or Linux, a lack of recently updated atlassian-jira.log

_

and

_

atlassian-jira-emh.log

_

usually

means

*

file

permissions

*

are

at

fault....

{tip} # Make Jira aware of the new handler {info:title=POP / Imap?} This example shows how to setup with POP, Imap is equally possible, just not documented, to use Imap, reconfigure Dovecot, and instead of modifying _

  1. Make Jira aware of the new handler
    Info
    titlePOP / Imap?

    This example shows how to setup with POP, Imap is equally possible, just not documented, to use Imap, reconfigure Dovecot, and instead of modifying .../pop/popservice.xml

_
  1. modify

_
  1. .../imap/imapservice.xml

_
  1. .

{info} Update _
  1. Update WEB-INF/classes/services/com/atlassian/jira/service/services/pop/popservice.xml
_
  1. to
  1. include:
{code:xml}
  1. Code Block
    xml
    xml
    
    <value>
      <key>com.dolby.atlassian.jira.service.util.handler.CreateOrCommentHandler</key>
      <value>Extendable Mail Handler - CreateOrComment</value>
    </value>
    
{code} # Ensure a valid POP Sever is configured This is under _Global
  1. Ensure a valid POP Sever is configured
    This is under Global Settings/Mail
  1. Servers
_
  1. .
  1. If
  1. the
  1. virtual
  1. mailbox
  1. approach
  1. is
  1. used,
  1. only
  1. one
  1. mailbox
  1. needs
  1. to
  1. be
  1. setup,
  1. in
  1. the
  1. example
_
  1. shared@jira.myco.net
_: !JIRA Extendable Mail Handler^pop-server-setup.png|thumbnail! # Configure the handler Modifiy the two properties files. when done, they should be copied to
  1. :
    Image Added
  2. Configure the handler
    Modifiy the two properties files. when done, they should be copied to WEB-INF/classes:
(i) If you use

  1. (info) If you use ldap,
  1. the
  1. minimum
  1. config
  1. required
  1. is
  1. to
  1. identify
  1. a
  1. valid
  1. user
  1. which
  1. is
  1. used
  1. to
  1. validate
  1. ldap
  1. connections.
  1. If
  1. not,
  1. you
  1. don't
  1. need
  1. this
  1. file.
(i) The EMH config file is just an extension of the properties that a mail handler is given, anything you could put in the Jira UI, you can equally add here. Look at the settings, understand what they do, make changes as appropriate for your needs. (!) The contents of the configuration file changes as new features are added and refinements are made, check the

  1. (info) The EMH config file is just an extension of the properties that a mail handler is given, anything you could put in the Jira UI, you can equally add here. Look at the settings, understand what they do, make changes as appropriate for your needs.
    (warning) The contents of the configuration file changes as new features are added and refinements are made, check the 'example-emh.properties'
  1. available
  1. inside
  1. every
  1. JAR.

Some

example

properties

are:

{

}
No Format
projectAutoAssign=true, issuetype=3, configFile=emh.properties
{noformat}
*

Service

Properties:* !JIRA Extendable Mail Handler^emh-service-config.png|thumbnail! *Service listing after save:* !JIRA Extendable Mail Handler^emh-service-configured.png|thumbnail! # Restart Jira h2. JEMH Handler Configuration File The following sections describe the fields that can be used to configure JEMH. Organised by where they are used, in future I will try to expand on the documentation and provide more detailed examples. (i) as of 0.7, all 'default' fields are prefixed with _default_, eg _defaultPriority_ etc. for clarity. (i) An example configuration file is packaged in every JAR, called

Properties:
Image Added
Service listing after save:
Image Added

  1. Restart Jira

JEMH Handler Configuration File

The following sections describe the fields that can be used to configure JEMH. Organised by where they are used, in future I will try to expand on the documentation and provide more detailed examples.
(info) as of 0.7, all 'default' fields are prefixed with default, eg defaultPriority etc. for clarity.
(info) An example configuration file is packaged in every JAR, called 'example-emh.properties',

contrast

this

file

to

your

local

file

for

changes.

||Option|| Example value || Description|| | notifyUsers | _true_ | Notifies users if their accounts are created, also used to notify users on issue creation, necessary when users are anonymous and would like notification of issue details. | | notifyUsersOnIssueCreation | _none_\|_nonjira_\|_jira_\|_all_ | This provides a way for users to be notified of email driven issue creation irrespective of any other system or user configuration options | | assignNonJiraUsersOriginalEmailAddressToCustomField | afieldname | As the excessively descriptive field describes, will populate the given custom field with String value of the email address in CSV fashion. This value can *also* be populated as a directive... (!) This is a security risk, just knowing the issue key (guessing even) would enable anyone with email access to add themselves into the issue. Default is disabled. To Fix ([JEMH-51|http://studio.plugins.atlassian.com/browse/JEMH-51])| | defaultReportUsername| _abod_ | identifies a 'default' user for anonymous email submission | | defaultIssueType | _3_ or _bug_ | default issue type for created issues | | defaultPriority | _3_ or _critical_ | default priority for created issues | | defaultIssueLinkType | _relates_ | default link type for linked issues | | defaultProject | _APROJ_\|_Magic Project_\|_10002_ | an identifier for a project | | defaultComponent | _Some Component_\|_10012_ | an identifier for a component in the given project | | whitelistSenders | _(.\*)@(.\*)yourco.net_ | A regexp CSV list. If set, no other domains/accounts will succeed (implying blacklist of other domains), the blacklist can be used to further restrict within the whitelisted domains. If not set, all address will pass. Supports java5 regular expressions| | blacklistSenders | _postmaster@xyz.com,(.\*)@(.\*)otherco.net_ | A regexp CSV list of addresses that will not be processed by Jira, and will be automatically forwarded (if silently drop not set) to the configured 'forwarder' of the related Mail Service, java5 regexp supported | | blacklistRecipients | _jira-noreply@yourco.net,noemailprojectkey@yourco.net_ | as above | | silentlyDropBlacklistMatches | _true_ | If set to false, causes blacklisted mails to not be forwarded, dropping _all_ of them. Possibly useful for high volume environments, blacklisted mails will always be deleted | | greylistSenders | _

Option

Example value

Description

notifyUsers

true

Notifies users if their accounts are created, also used to notify users on issue creation, necessary when users are anonymous and would like notification of issue details.

notifyUsersOnIssueCreation

none|nonjira|jira|all

This provides a way for users to be notified of email driven issue creation irrespective of any other system or user configuration options

assignNonJiraUsersOriginalEmailAddressToCustomField

afieldname

As the excessively descriptive field describes, will populate the given custom field with String value of the email address in CSV fashion. This value can also be populated as a directive... (warning) This is a security risk, just knowing the issue key (guessing even) would enable anyone with email access to add themselves into the issue. Default is disabled. To Fix (JEMH-51)

defaultReportUsername

abod

identifies a 'default' user for anonymous email submission

defaultIssueType

3 or bug

default issue type for created issues

defaultPriority

3 or critical

default priority for created issues

defaultIssueLinkType

relates

default link type for linked issues

defaultProject

APROJ|Magic Project|10002

an identifier for a project

defaultComponent

Some Component|10012

an identifier for a component in the given project

whitelistSenders

(.*)@(.*)yourco.net

A regexp CSV list. If set, no other domains/accounts will succeed (implying blacklist of other domains), the blacklist can be used to further restrict within the whitelisted domains. If not set, all address will pass. Supports java5 regular expressions

blacklistSenders

postmaster@xyz.com,(.*)@(.*)otherco.net

A regexp CSV list of addresses that will not be processed by Jira, and will be automatically forwarded (if silently drop not set) to the configured 'forwarder' of the related Mail Service, java5 regexp supported

blacklistRecipients

jira-noreply@yourco.net,noemailprojectkey@yourco.net

as above

silentlyDropBlacklistMatches

true

If set to false, causes blacklisted mails to not be forwarded, dropping all of them. Possibly useful for high volume environments, blacklisted mails will always be deleted

greylistSenders

postmaster@yourco.net,.*@yourco.com

_ |

CSV

regexp

list

of

address

that

might

get

blocked

depending

on

subject

| | greylistSendersSubjectRegexps | _Delivery to the following recipients

greylistSendersSubjectRegexps

Delivery to the following recipients failed,.

\

*Delivery

Status

Notification.

\

*Failure.

\

*

_ |

CSV

regexp

list,

for

greylist

subject

matches

| | greylistRelatedUserBodyRegexp | _\[ \

greylistRelatedUserBodyRegexp

[ ]*to:

\

[

\

]((.

\

*)@(.

\

*))

$_ | Enables

$

Enables to:

addresses

on

system

generated

emails

to

be

extracted,

and

related

users

tested

for

being

active,

inactive

users

make

the

related

mail

a

match

| | silentlyDropGreylistSubjectMatches | _true_ | If set to false, causes blacklisted mails to not be forwarded, dropping _all_ of them, if true. | | emailFieldProcessorPriorityLowerLimit| _0_ | If set will set the lower priority limit that processors are enabled, allowing users to configure just a subset of available field processors to be executed in priority order (procPri>=lowerLimit and procPri<=upperLimit). Eg, _MailFormNgProcessor_=1000, _CSVProcessor_=10000, 'default' _Atlassian_ Processor=2147483647 | | emailFieldProcessorPriorityUpperLimit| _2147483647_ | As above, but the upper limit| h3. CommentHandler ||Option|| Example value || Description|| |stripQuotes| false | strips &gt; comment lines from included emails when Jira emails are replied to. Overrides system default settings to forward an entire email (from outside Jira) including comments, into a Jira ticket.| h3. AbstractFieldProcessor ||Option|| Example value || Description|| |debugPrintEmail |true |will print out emails as they are received for debugging| |alternateIDLookupClassList|

silentlyDropGreylistSubjectMatches

true

If set to false, causes blacklisted mails to not be forwarded, dropping all of them, if true.

emailFieldProcessorPriorityLowerLimit

0

If set will set the lower priority limit that processors are enabled, allowing users to configure just a subset of available field processors to be executed in priority order (procPri>=lowerLimit and procPri<=upperLimit). Eg, MailFormNgProcessor=1000, CSVProcessor=10000, 'default' Atlassian Processor=2147483647

emailFieldProcessorPriorityUpperLimit

2147483647

As above, but the upper limit

CommentHandler

Option

Example value

Description

stripQuotes

false

strips > comment lines from included emails when Jira emails are replied to. Overrides system default settings to forward an entire email (from outside Jira) including comments, into a Jira ticket.

AbstractFieldProcessor

Option

Example value

Description

debugPrintEmail

true

will print out emails as they are received for debugging

alternateIDLookupClassList

x.y.AClass,p.q.BClass

|

List

of

classes

used

to

do

email

->

ID

lookups

| | domainEquivalency |

domainEquivalency

my.co.uk:my.com

|

related

to

LDAP

provider,

indicates

given

domains

'are

the

same'.

_You

will

need

to

set

this

to

your

domains

'aliases'

for

ldap

alternate

lookup

to

work

| |emailFieldProcessorClassList|

emailFieldProcessorClassList

x.y.AClass,p.q.BClass

|

List

of

classes

used

to

process

emails

| |

projectAutoAssign

|

true

|

attempt

to

get

the

project

Key

from

the

to:

address

(useful

if

you

have

a

combined

destination

mailbox)

| | forceUserIdCase|true|will force the case of userids for lookups, required for case sensitive DB's| | lowercaseUserids|true| if true will force lowercase, false or missing indicates upper case| | catchEmail|

forceUserIdCase

true

will force the case of userids for lookups, required for case sensitive DB's

lowercaseUserids

true

if true will force lowercase, false or missing indicates upper case

catchEmail

xyz@jira.myco.net

|

for

use

with

the

Basic

field

processor,

enables

a

common

email

account

to

only

have

email

retrieved

for

the

given

'catch'

addressee

| | createUsers | true | enables on the fly creation of users, whether being the 'sender' or a

createUsers

true

enables on the fly creation of users, whether being the 'sender' or a 'watcher',

however

so

determined.

| | createUsersIDFrom|

createUsersIDFrom

name/email/alternate

|

enables

the

selection

of

userid

to

be

derived

from

the

name

part

of

the

email,

the

full

email,

or

via

the

alternate

ID

provider

framework

(there

is

an

AD

LDAP

provider

included

in

the

project

| | createUsersIDFromEmailDomainWhitelist | .\

createUsersIDFromEmailDomainWhitelist

.*@myco.net,.

\

*@,myco.com

|

Enables

user

creation

to

be

be

restricted

to

given

domains

| | createUsersIDFromEmailBlacklist|

createUsersIDFromEmailBlacklist

sales@atlassian.com

|

Stops

emails

from

sales@atlassian.com

(or

any

other

regexp),

from

being

used

as

a

valid

userID

| | notifyUsers | true| notify users of issue creation | | deleteEmail | true | if set to false, will prevent Jira from deleting mails from the mailbox after processing | | autoFlushMailQueue | true | will cause the Mail Queue to be flushed whenever the EMH handler is run (which only occurs when there is mail to process) | | addWatchersFromCC | true | will make _all_ valid users watchers of the created issue, in addition to anything that may be set as directive | | createUsersIDFrom | email\|name\|alternate | select mechanism for determining the userID, email is _user@someplace.com_, name is _user_@somplace.com, alternate means use the alternateID provider classes| | autoJoinGroup | email-users | enables auto-created users to be automatically joined to a given group | | indicateWhichProcessorProcessedMail | true/false | causes a one liner to be inserted at the top of the jira issue, to assist in debugging, or as an indicator for where the issue came from| | ccHandling | toWatcher\|toCustomField | will cause users to be derived from email _cc:_ entries as well as from the directive _ccusers_, to be added as watchers to the issue or to be merged into a given custom field (must be capable of accepting user type, eg MultiUserCF type| | ccHandlingTargetCustomFieldName | Some CF Name | If the _ccHandling_ field indicates a custom field should be used, this field idetifies that field by name, whitespace allowed | h2. JEMH Poker Installation !poke.gif!!http://www.atlassian.com/software/jira/images/logo_small.png! This JEMH Poker is a simple javaapplication that triggers the JEMH to do an immediate mail retrieval. The current 1.0 release of the JEMH Poker contains a simple file monitor, suitable for most Unix or Linux platforms and associated file-based mail systems. Exchange is an unknown quantity, as Microsoft products are not known for their openness - the approach I took in my organization was to use Exchange purely as a vehicle to get mail to where I could do something useful with it (see setting up Postfix smtp server and Dovecot POP server pages here). h3. Installation of the remote agent # Extract the tgz in /usr/local {noformat}

notifyUsers

true

notify users of issue creation

deleteEmail

true

if set to false, will prevent Jira from deleting mails from the mailbox after processing

autoFlushMailQueue

true

will cause the Mail Queue to be flushed whenever the EMH handler is run (which only occurs when there is mail to process)

addWatchersFromCC

true

will make all valid users watchers of the created issue, in addition to anything that may be set as directive

createUsersIDFrom

email|name|alternate

select mechanism for determining the userID, email is user@someplace.com, name is user@somplace.com, alternate means use the alternateID provider classes

autoJoinGroup

email-users

enables auto-created users to be automatically joined to a given group

indicateWhichProcessorProcessedMail

true/false

causes a one liner to be inserted at the top of the jira issue, to assist in debugging, or as an indicator for where the issue came from

ccHandling

toWatcher|toCustomField

will cause users to be derived from email cc: entries as well as from the directive ccusers, to be added as watchers to the issue or to be merged into a given custom field (must be capable of accepting user type, eg MultiUserCF type

ccHandlingTargetCustomFieldName

Some CF Name

If the ccHandling field indicates a custom field should be used, this field idetifies that field by name, whitespace allowed

JEMH Poker Installation

Image AddedImage Added

This JEMH Poker is a simple javaapplication that triggers the JEMH to do an immediate mail retrieval. The current 1.0 release of the JEMH Poker contains a simple file monitor, suitable for most Unix or Linux platforms and associated file-based mail systems. Exchange is an unknown quantity, as Microsoft products are not known for their openness - the approach I took in my organization was to use Exchange purely as a vehicle to get mail to where I could do something useful with it (see setting up Postfix smtp server and Dovecot POP server pages here).

Installation of the remote agent

  1. Extract the tgz in /usr/local
    No Format
    
    cd /usr/local
    tar xzf filename.tgz
    
{noformat} # Make the launch shell script executable {noformat}
  1. Make the launch shell script executable
    No Format
    
    cd jemh-mail-notifier-......
    chmod +x
*.sh {noformat} # Link a common name to the current version {noformat}
  1.  *.sh
    
  2. Link a common name to the current version
    No Format
    
    ln -s jemh-mail-notifier-...... jemh-mail-notifier
    
{noformat} # Ensure you have Java in your path, the following should give some version information. If not, install Java
  1. Ensure you have Java in your path, the following should give some version information. If not, install Java 1.5+
  1. or
  1. modify
  1. the
  1. script
  1. (you
  1. should
  1. know
  1. what
  1. to
  1. do)
{
  1. No Format
}
  1. 
    java
-version {noformat} # Edit the configuration file _
  1.  -version
    
  2. Edit the configuration file emh-poker.properties
_
  1. ,
  1. set
  1. the
  1. server
  1. (IP
  1. address
  1. or
  1. DNS
  1. name)
  1. and
  1. the
  1. port
  1. (default
  1. is
  1. 7777).
#
  1. Run
  1. the
  1. script
  1. as
  1. the
  1. appropriate
  1. user
  1. for
  1. your
  1. environemnt.
  1. With
  1. Postfix,
  1. you
  1. may
  1. need
  1. to
  1. be
  1. running
_
  1. as
_
  1. Postfix.
  1. Running
  1. as
  1. root
  1. is
  1. to
  1. be
  1. avoided,
  1. create
  1. a
  1. service
  1. user
  1. as
  1. follows:
{
  1. No Format
}
  1. 
    root@server:/usr/local/jemh-mail-notifier-1.1-SNAPSHOT# adduser --disabled-login --no-create-home -ingroup postfix jirapoker
    Adding user `jirapoker' ...
    Adding new user `jirapoker' (1009) with group `postfix' ...
    Not creating home directory `/home/jirapoker'.
    Changing the user information for jirapoker
    Enter the new value, or press ENTER for the default
    	Full Name []: 
    	Room Number []: 
    	Work Phone []: 
    	Home Phone []: 
    	Other []: 
    Is the information correct? [Y/n] Y
    
{noformat} h3. Create a SysV startup script in

Create a SysV startup script in /etc/init.d

Create

it

as

'jemh-mail-notifier'

{

}
No Format
#! /bin/sh
### BEGIN INIT INFO
# Provides:          jemh-mail-notifier
# Required-Start:    
# Required-Stop:
# Default-Start:     2
# Default-Stop:
# Short-Description: Monitors a mailbox and poke jira when mail arrives
### END INIT INFO

PATH=/sbin:/bin

. /lib/lsb/init-functions

case "$1" in
  start)
	cd  /usr/local/jemh-mail-notifier
	./run.sh &
	;;
  stop)
	# No-op
        echo Cant stop it from here, use 'ps -ef | grep java' at the prompt
	;;
  *)
	echo "Usage: $0 start" >&2
	exit 3
	;;
esac
{noformat}

To

make

the

service

start

at

bootup:

{

}
No Format
sudo apt-get install sysvconfig
sysvconfig
{noformat}

Now

find

the

jemh-mail-notifer

and

enable

for

startup,

click

finish

to

save.

h3.

Installing

the

Jira

JEMH

Poker

Service

The

main

JEMH

includes

everything

necessary,

the

only

thing

that's

required

is

a

bit

of

configuration:

#

  1. Login
  1. to
  1. Jira
  1. as
  1. admin
#
  1. Go
  1. to
  1. the
  1. Services
  1. screen
#
  1. Add
  1. a
  1. service:
|| Name | JEMH Poker Service | || Class |
  1. Name

    JEMH Poker Service

    Class

    com.dolby.atlassian.jira.service.util.handler.emh.service.EMHPokerService

| || Delay | 1 _
  1. Delay

    1 note:

  1. this

  1. is

  1. essentially

  1. the

  1. delay

  1. in

  1. initial

  1. startup

  1. as

  1. Jira

starts_ | # Select the default port options or change as you see fit (must fix Poker configuration, above) After configuring you should see something like: !poker-service.png! h3. Poker Sequence Diagram {gliffy:name=JEMH Poker - remote agent|space=Jira Extendable Mail Handler|page=Installation and Configuration|pageid=2752853|align=left|size=L}
  1. starts

  2. Select the default port options or change as you see fit (must fix Poker configuration, above)

After configuring you should see something like:
Image Added

Poker Sequence Diagram

Gliffy
sizeL
nameJEMH Poker - remote agent
pageInstallation and Configuration
pageid2752853
alignleft
spaceJira Extendable Mail Handler
Column

Space Map

Page Tree
rootJIRA Extendable Mail Handler
sortnatural
reversefalse
excerptfalse

Table of Contents

Table of Contents