Remove previous content from incoming email from Jira server in Microsoft Outlook

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

When replying to a received HTML format notification from an issue, the old reply data does not strip out properly when using Outlook as the email client.

原因

For the Incoming Mail Handler, the "stripquotes=true" option does not strip the old reply data properly when using Outlook. This is due to   JRA-14543 - Getting issue details... STATUS

回避策

Customisations to Velocity templates or other JIRA files are not included in the scope of Atlassian Support.

Deploying Velocity Templates without a Restart

In a development instance, you can play with picking up velocity file changes without a restart.
From <jira-install>/atlassian-jira/WEB-INF/classes/velocity.properties:

  1. Change class.resource.loader.cache from true to false
  2. Uncomment (remove the # sign) from

    #velocimacro.library.autoreload=true

    to

    velocimacro.library.autoreload=true

Keep in mind that the next time you upgrade JIRA – or need a new installation for any reason – you will have to manually copy any changes you have made to the JSPs or tempates into the new installation of JIRA. If the JSPs or templates have changed in the newer version, you will have to port your customization into them.

  1. JIRA 管理者グローバル権限を持つユーザーとしてログインします。
  2. Choose  > System. Select Mail > Incoming Mail to open the Incoming Mail page.
    Keyboard shortcut: g + g + start typing incoming mail
  3. Edit the Mail Handler.
  4. The Handler dropdown menu has several options:


  • Method 1: The method below will only trim everything below the "---- Original Message ----" using the mail handler 'Create a new issue or add a comment to an existing issue'.
ここをクリックして展開...

This method can be used with mail handler: 'Create a new issue or add a comment to an existing issue'

  1. Open the file: <install directory>\atlassian-jira\WEB-INF\classes\templates\email\html\includes\header.vm
  2. Add this line just after the <html*> tag at the beginning of the file:

    <span style="display:none">---- Original Message ----</span>
    
  3. In the handler configuration, set the Strip Quotes option to be true.


  • Method 2: The method below will trim anything below the line "---- Original Message ----" using the mail handler 'Add a comment before a specified marker or separator in the email body'.
ここをクリックして展開...
  1. Open the file: <install directory>\atlassian-jira\WEB-INF\classes\templates\email\html\includes\header.vm
  2. Add this line at the end of file:

    <span style="display:none">---- Original Message ----</span>
    
  3. Add this parameter line to the Split Regex field:

    Using Regex Comment Handler
    splitregex=/-+\s*Original Message\s*-+/

This method can be used with the mail handler: 'Add a comment before a specified marker or separator in the email body'


  • Method 3: The method below will strip anything after "From: " in a reply message, using the mail handler 'Add a comment before a specified marker or separator in the email body'.
ここをクリックして展開...
  • Add this parameter line to the 'Split Regex' field:

    /From: |> /
  • Alternative; for example split after both "From: " or a signature like "Sent from my iPhone", use the following parameter in the 'Split Regex' field:

    /From: |> /|Sent\sfrom\smy\siPhone

    This method can be used with the mail handler: 'Add a comment before a specified marker or separator in the email body'


  • Method 4: The method will strip anything after "From:" in using the mail handler 'Create a new issue or add a comment to an existing issue'. 
ここをクリックして展開...
  • Add this parameter line to $JIRA_INSTALL\atlassian-jira\WEB-INF\classes\outlook-email.translations

    From:
  • In the handler configuration, set the Strip Quotes option to be true.


  • Method 5: The method will use a broader regular expression to catch content, using the mail handler 'Add a comment before a specified marker or separator in the email body'. 
ここをクリックして展開...
  • Add this line to the 'Split Regex' field:

    /From: *|___.*|On .*wrote:|----Orig.*|On .*(JIRA).*/


For further tips regarding other workarounds take a look at the comments below.

最終更新日 2019 年 9 月 25 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.