Issue Details (XML | Word | Printable)

Key: JRA-11452
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Andreas Knecht [Atlassian]
Reporter: Jeff Turner [Atlassian]
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JIRA

-Dmail.debug property does not work for POP/IMAP

Created: 06/Nov/06 06:30 PM   Updated: 07/Aug/08 01:40 AM
Component/s: Email integration
Affects Version/s: 3.6.5
Fix Version/s: 3.7.2

Time Tracking:
Not Specified

Issue Links:
Blocker
 
Cause
 
Cloners
 

Participants: Abhishek Tripathi, Andreas Knecht [Atlassian], Anton Mazkovoi [Atlassian] and Jeff Turner [Atlassian]
Since last comment: 1 year, 5 weeks, 5 days ago
Resolution Date: 08/Jan/07 07:25 PM
Labels:


 Description  « Hide
For debugging mail problems (POP, IMAP, SMTP), the JavaMail library provides the mail.debug property. When set to true, this prints protocol-level logs showing what is happening.

This works for SMTP, but does not work for POP or IMAP (eg. creating issues/comments from mail). In the library, we instead initialise the JavaMail properties from the WEB-INF/classes/atlassian-mail.properties file. So to get debug logs for POP and IMAP, you'd need to create WEB-INF/classes/atlassian-mail.properties and add the line:

mail.debug=true

and then restart.

JIRA should allow command-line properties to override those in atlassian-mail.properties, so that people don't have to set properties in a text file in a .war.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Anton Mazkovoi [Atlassian] added a comment - 07/Nov/06 03:53 PM
Any idea how to do that? Do we need to manually read all mail properties from command line and then pass them through to Java Mail? I hoped Java Mail was smart enough to do that itself.

Jeff Turner [Atlassian] added a comment - 07/Nov/06 09:22 PM
The JavaMail session takes a Properties object. We give it one populated just with atlassian-mail.properties content. Instead we should do:
Properties p = new Properties(System.getProperties());
Properties newProps = new Properties(..."atlassian-mail.properties"...);
foreach (newProp in newProps) {
  p.setProperty(newProp.key, newProp,value);
}

so that atlassian-mail.properties overrides the defaults, but the defaults still apply.


Jeff Turner [Atlassian] added a comment - 07/Nov/06 09:24 PM
The code is all in atlassian-mail, com/atlassian/mail/config/PropertiesLoader.java. Actually this problem applies to JIRA and Confluence.

Anton Mazkovoi [Atlassian] added a comment - 06/Jan/07 02:48 PM
The code sniplet will make the properties inside the file override the system properties which is not what we want (as far as I can tell).

Need to either reverse the loop to go over system properties, or check for existence of the property in system properties before overriding it from the file properties, and only override if the system property is not set.


Andreas Knecht [Atlassian] added a comment - 08/Jan/07 07:25 PM
Updated PropertiesLoader to also put all the sytem properties, such that properties from the mail config file get overriden.

Abhishek Tripathi added a comment - 28/Aug/07 11:23 AM
Hi,

I'm using Jira 3.10.1 version.
Should I make these changes for this Jira version.

Regards,


Anton Mazkovoi [Atlassian] added a comment - 28/Aug/07 10:19 PM
Abhishek,

I am not sure what changes you are referring to. If you have a problem with getting JIRA to send or receive e-mail, please create a support request in our support system:
http://support.atlassian.com

Cheers,
Anton