You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org> on 2007/09/13 22:31:32 UTC
[jira] Closed: (JSIEVE-6) There is a bug while processing email
addresses in Address class
[ https://issues.apache.org/jira/browse/JSIEVE-6?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Burrell Donkin closed JSIEVE-6.
--------------------------------------
Resolution: Fixed
Forked jtt schema from Mime4J for sample and test implementations of MailAdapter. JAMES implementation will use Mime4J directly. Corrected inheritance hierarchy,
> There is a bug while processing email addresses in Address class
> ----------------------------------------------------------------
>
> Key: JSIEVE-6
> URL: https://issues.apache.org/jira/browse/JSIEVE-6
> Project: jSieve
> Issue Type: Bug
> Affects Versions: 0.2
> Reporter: Vladimir
> Assignee: Robert Burrell Donkin
> Fix For: 0.2
>
>
> An email can contain multiple recipients in header. They are separated with ",". Method match in class Address fails to parse this situation.
> Buggy method:protected boolean match(MailAdapter mail,
> String addressPart,
> String comparator,
> String matchType,
> String headerName,
> String key)
> throws SieveException
> You'd better replace it's content part:
> isMatched =
> match(addressPart,
> comparator,
> matchType,
> ((String) headerValuesIter.next()),
> key);
> with:
> final String headerValues = ((String) headerValuesIter.next());
> StringTokenizer stringTokenizer = new StringTokenizer(headerValues, ",");
> while(!isMatched && stringTokenizer.hasMoreTokens()){
> isMatched =
> match(addressPart,
> comparator,
> matchType,
> stringTokenizer.nextToken(),
> key);
> }
> You'll get such a new method:
> protected boolean match(MailAdapter mail,
> String addressPart,
> String comparator,
> String matchType,
> String headerName,
> String key)
> throws SieveException {
> Iterator headerValuesIter =
> getMatchingValues(mail, headerName).iterator();
> boolean isMatched = false;
> while (!isMatched && headerValuesIter.hasNext()) {
> final String headerValues = ((String) headerValuesIter.next());
> StringTokenizer stringTokenizer = new StringTokenizer(headerValues, ",");
> while(!isMatched && stringTokenizer.hasMoreTokens()){
> isMatched =
> match(addressPart,
> comparator,
> matchType,
> stringTokenizer.nextToken(),
> key);
> }
> }
> return isMatched;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org