camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tide08 <>
Subject Camel Mail Component: "|" in email causes message to fail
Date Wed, 14 Oct 2009 00:06:13 GMT

It looks like there is minor bug in regex used in, it causes
"|" to act as delimiter, splitting email address into 2 parts.  

For ex: Using email address as - first| causes it to split into
two parts:
1) first

"|" is acceptable character in email as per wikipedia
[]. I did not bother to read RFC

Here is snippet of code causing issue:

 private static void appendRecipientToMimeMessage(MimeMessage mimeMessage,
String type, String recipient)
        throws MessagingException {

        // we support that multi recipient can be given as a string
seperated by comma or semi colon
        String[] lines = recipient.split("[,|;]");
        for (String line : lines) {

Regex above should either be "[,;]" or ";|," 

Also, having email addresses separate out by , or ; seems to be issue as it
can be part of name. ex: "firstName, I like comma <>" is
valid. Above code will still cause failure for such messages. Can camel
support addresses as List/Array rather than comma delimited string?
View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message