title: How to move jenkins email from Junk to Inbox folder?
body: <p>I'm trying to set up mail (outlook 365) notification by writing script in 'jenkinsfile' once our test automation execution completes. The mail trigger script looks like below:</p>
  <pre><code>post {
       failure
       {
        script
        {
         mail (to: 'abc@xyz.com',
         subject: &quot;Job '${env.JOB_NAME}' (${env.BUILD_NUMBER}) - failed.&quot;,
         body: &quot;Please visit to ${env.BUILD_URL} for further details.&quot;);
        }
      }
      success
      {
        script
        {
           mail (to: 'abc@xyz.com',
           subject: &quot;Job '${env.JOB_NAME}' (${env.BUILD_NUMBER}) - success.&quot;,
           body: &quot;Please visit to ${env.BUILD_URL} for further details.&quot;);
        }
       }
  }
  </code></pre>
  <p>The above script is working fine and I'm able to get the mail but it stores into 'Junk' folder. I also tried with below script after creating webhook thru Teams.</p>
  <pre><code>post {
       always {
              mail(to: 'abc@xyz.com', subject: &quot;Pipeline Notification&quot;, body: &quot;Job '${env.JOB_NAME} [${env.BRANCH_NAME}]' (${env.BUILD_URL})&quot;)
              office365ConnectorSend color: '#00FF00', message: &quot;SUCCESSFUL&quot;, status: &quot;Build 
              Success&quot;, webhookUrl: 'URL'
              cleanWs()
              }
  }
  </code></pre>
  <p>This is too triggering email but mail is sitting into 'Junk' mail box only. <br>
  Could you please help me how can I get the mails from jenkins pipeline (<b>using jenkinsfile</b> script, not using jenkins UI) and store it into 'Inbox' or 'Custom Folder' (i.e. created new folder called 'Jenkins' ) ?</p>
  <p>Thanks, <br>
  Karunagara Pandi G</p>