You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Steen Jansdal <sj...@buanco.dk> on 2003/03/07 11:20:09 UTC

Missing Carriage Return

Hi,

This has possibly been asked before, but I cannot
find it in the mail archieve.

It seems as there are missing some Carriage Returns
after some of the lines in a mail. My Outlook users
are getting strange looking mails.

Is this a configuration options that I simply hasn't
found?

Steen


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Redirect Mailet

Posted by Danny Angus <da...@apache.org>.
static=true tells the mailet that it can reuse all the initial parameters (to, from, etc)  without re-calculating their values, it is there to boost performance where a redirect task doesn't contain any dynamic values, when it's true the mailet simply short circuits the whole process.

Where you use magic words, (sender, and I forget what else) you should have static=false to make redirect re-calculate them everytime.

Redirect is actually a dual purpose thing. As well as its basic functionality it is intended to provide mailet developers with a lot of pretty standard redirection functionality which they can extend to provide custom mailets, like list-servers, because of this we don't calculate, or make any assumptions about the value of static.

I suppose we could tidy it up as no-one seems to get what it's for and a recently posted bug caused by incorrect static setting took Noel and I both to work out what was wrong, and we wrote the damned thing.. :-D :-D.

d.

> -----Original Message-----
> From: Damian Minkov [mailto:damian@space-comm.com]
> Sent: 12 March 2003 09:06
> To: James Users List
> Subject: Redirect Mailet
> 
> 
> Can you explain me what is the use of static option (<static>) in the
> Redirect mailet?
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Redirect Mailet

Posted by Damian Minkov <da...@space-comm.com>.
Can you explain me what is the use of static option (<static>) in the
Redirect mailet?



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: web access to emails...

Posted by Huu Phuoc <ph...@ssp.com.vn>.
You should try  using jwebmail
(http://www.sourceforge.net/projects/jwebmail)
Good luck !
Nguyen Huu Phuoc
----- Original Message -----
From: "Mr. King" <ki...@yahoo.com>
To: "James Users List" <ja...@jakarta.apache.org>
Sent: Tuesday, March 11, 2003 10:20 AM
Subject: web access to emails...


> Hi Friends,
>
> I am looking for a software package (jsp-servlets-beans) which can give
web
> based access to the emails of james email server. is there any ?
>
> Thanks very much to all eGroup users.
>
> -RDX
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online
> http://webhosting.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


web access to emails...

Posted by "Mr. King" <ki...@yahoo.com>.
Hi Friends,

I am looking for a software package (jsp-servlets-beans) which can give web
based access to the emails of james email server. is there any ?

Thanks very much to all eGroup users.

-RDX

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Missing Carriage Return

Posted by Steen Jansdal <sj...@buanco.dk>.
Steen Jansdal wrote:
> Hi,
> 
> This has possibly been asked before, but I cannot
> find it in the mail archieve.
> 
> It seems as there are missing some Carriage Returns
> after some of the lines in a mail. My Outlook users
> are getting strange looking mails.
> 
> Is this a configuration options that I simply hasn't
> found?
> 
> Steen
> 

Now I've found out that this occurs when HTML-mails or mails
with attachments are fetchPOP'ed. Each line in a mail should
be terminated with a CR LF (according to RFC2821), but in
some cases these are only terminated by a LF.

The mail-server (James 2.1.2) is running on a Linux platform.

Steen





---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re[2]: Missing Carriage Return

Posted by Miroslav Nachev <mi...@space-comm.com>.
   Dear Steen,

   We have the same problem and we fixed with the following code:
public class MailServer
{

    public static void main(String[] args)
        throws Exception
    {
        String value = new String(new byte[]{'\r', '\n'});
        System.setProperty("line.separator", value);

        Main.main(args);
    }                                                                                                                              
} 

   After compiling of the above code I put it in phoenix.sh:
   ...
# Get the run cmd
RUN_CMD="$JAVA_HOME/bin/java $JVM_OPTS \
    $DEBUG \
    -Djava.security.policy=jar:file:$PHOENIX_HOME/bin/phoenix-loader.jar!/META-INF/java.policy \
    $PHOENIX_JVM_OPTS \
    -Dphoenix.home="$PHOENIX_HOME" \
    -Djava.io.tmpdir="$PHOENIX_TMPDIR" \
    MailServer $*"
#    -jar "$PHOENIX_HOME/bin/phoenix-loader.jar" $*"   


   Best Regards,
   Miroslav Nachev



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re[2]: Missing Carriage Return

Posted by Miroslav Nachev <mi...@space-comm.com>.
   Dear Steen,

SJ> Thank you for answering, I was feeling a little lonely, and
SJ> thought I was the only one seeing this problem.

   Me too, becuase we have some problems with the Mailets.


SJ> Doesn't your solution affect other files too. For example log
SJ> files? 

   Yes, for this server. In our case MailServer.
   

   Best Regards,
   Miroslav Nachev



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Missing Carriage Return

Posted by "Noel J. Bergman" <no...@devtech.com>.
Gentlemen,

I will review this change later (after some sleep), but it appears that the
proposed solutions consist of converting \n to \r\n.  This would be covered
by RFC 2821, section 2.3.7, which mandates that the line termination is
CRLF, and that CR and LF must not be transmitted except in that pairing.

Is that a correct assessment of the issue that the two of you are raising?

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Missing Carriage Return

Posted by Steen Jansdal <sj...@buanco.dk>.
Miroslav Nachev wrote:
>    Dear Steen,
> 
>    We have the same problem and we fixed with the following code:
> public class MailServer
> {
> 
>     public static void main(String[] args)
>         throws Exception
>     {
>         String value = new String(new byte[]{'\r', '\n'});
>         System.setProperty("line.separator", value);
> 
>         Main.main(args);
>     }                                                                                                                              
> } 
> 
>    After compiling of the above code I put it in phoenix.sh:
>    ...
> # Get the run cmd
> RUN_CMD="$JAVA_HOME/bin/java $JVM_OPTS \
>     $DEBUG \
>     -Djava.security.policy=jar:file:$PHOENIX_HOME/bin/phoenix-loader.jar!/META-INF/java.policy \
>     $PHOENIX_JVM_OPTS \
>     -Dphoenix.home="$PHOENIX_HOME" \
>     -Djava.io.tmpdir="$PHOENIX_TMPDIR" \
>     MailServer $*"
> #    -jar "$PHOENIX_HOME/bin/phoenix-loader.jar" $*"   
> 
> 
>    Best Regards,
>    Miroslav Nachev
> 

Thank you for answering, I was feeling a little lonely,
and thought I was the only one seeing this problem.

Doesn't your solution affect other files too. For
example log files?

Steen




---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


IMAP

Posted by Gregory Bonk <gr...@gregorybonk.com>.
Anyone trying to use IMAP?  I'm interested in trying and I know I can get a
development version.

- Greg


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Missing Carriage Return

Posted by "Noel J. Bergman" <no...@devtech.com>.
Gentlemen,

> Now I've found out that this occurs when HTML-mails or mails
> with attachments are fetchPOP'ed

As I mentioned earlier, I'm more interested to find out from where these
improperly formatted messages are coming.  Is this problem occuring only
with FetchPOP?

FWIW, FetchPOP is being deprecated, and is being replaced by a new
JavaMail-based FetchMail service, which is already present in HEAD.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Missing Carriage Return

Posted by "Noel J. Bergman" <no...@devtech.com>.
Steen,

How's this work for you?

    public void write(int b) throws IOException {
        switch (b) {
            case '.':
                if (countLast0A0D == 2) {
                    out.write('.');
                }
                countLast0A0D = 0;
                break;
            case '\r':
                countLast0A0D = 1;
                break;
            case '\n':
                if (countLast0A0D == 1) {
                    countLast0A0D = 2;
                } else {
                    out.write('\r');
                    countLast0A0D = 0;
                }
                break;
            default:
                countLast0A0D = 0;
                break;
        }
        out.write(b);
    }

The problem that I have with it now is that although it converts a naked LF
to CRLF, it won't double the '.' after a line that improperly begins with
just LF.

	--- Noel

-----Original Message-----
From: Steen Jansdal [mailto:sja@buanco.dk]
Sent: Monday, March 10, 2003 4:08
To: James Users List
Subject: Re: Missing Carriage Return


Steen Jansdal wrote:
> Steen Jansdal wrote:
>
>> Hi,
>>
>> This has possibly been asked before, but I cannot
>> find it in the mail archieve.
>>
>> It seems as there are missing some Carriage Returns
>> after some of the lines in a mail. My Outlook users
>> are getting strange looking mails.
>>
>> Is this a configuration options that I simply hasn't
>> found?
>>
>> Steen
>>
>
> Now I've found out that this occurs when HTML-mails or mails
> with attachments are fetchPOP'ed. Each line in a mail should
> be terminated with a CR LF (according to RFC2821), but in
> some cases these are only terminated by a LF.
>
> The mail-server (James 2.1.2) is running on a Linux platform.
>
> Steen
>
>

Now I have a patch that fixes the problem. I don't know
if it's the right place to fix the problem, but it works.

In the ExtraDotOutputStream class (package org.apache.james.util)
the method "write" are patched as follows:

     public void write(int b) throws IOException {
//        out.write(b);                   // Remove this line

         switch (b) {
             case '.':
                 out.write(b);             // Add this line
                 if (countLast0A0D == 2) {
                     // add extra dot
                     out.write('.');
                 }
                 countLast0A0D = 0;
                 break;
             case '\r':
                 out.write(b);             // Add this line
                 countLast0A0D = 1;
                 break;
             case '\n':
                 if (countLast0A0D == 1) {
                     out.write(b);         // Add this line
                     countLast0A0D = 2;
                 } else {
                     out.write('\r');      // Add this line

                     out.write(b);
                     countLast0A0D = 0;
                 }
                 break;
             default:
                 out.write(b);             // Add this line
                 // we're  no longer at the start of a line
                 countLast0A0D = 0;
                 break;
         }
     }


Steen


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Missing Carriage Return

Posted by Steen Jansdal <sj...@buanco.dk>.
Steen Jansdal wrote:
> Steen Jansdal wrote:
> 
>> Hi,
>>
>> This has possibly been asked before, but I cannot
>> find it in the mail archieve.
>>
>> It seems as there are missing some Carriage Returns
>> after some of the lines in a mail. My Outlook users
>> are getting strange looking mails.
>>
>> Is this a configuration options that I simply hasn't
>> found?
>>
>> Steen
>>
> 
> Now I've found out that this occurs when HTML-mails or mails
> with attachments are fetchPOP'ed. Each line in a mail should
> be terminated with a CR LF (according to RFC2821), but in
> some cases these are only terminated by a LF.
> 
> The mail-server (James 2.1.2) is running on a Linux platform.
> 
> Steen
> 
> 

Now I have a patch that fixes the problem. I don't know
if it's the right place to fix the problem, but it works.

In the ExtraDotOutputStream class (package org.apache.james.util)
the method "write" are patched as follows:

     public void write(int b) throws IOException {
//        out.write(b);                   // Remove this line

         switch (b) {
             case '.':
                 out.write(b);             // Add this line
                 if (countLast0A0D == 2) {
                     // add extra dot
                     out.write('.');
                 }
                 countLast0A0D = 0;
                 break;
             case '\r':
                 out.write(b);             // Add this line
                 countLast0A0D = 1;
                 break;
             case '\n':
                 if (countLast0A0D == 1) {
                     out.write(b);         // Add this line
                     countLast0A0D = 2;
                 } else {
                     out.write('\r');      // Add this line 

                     out.write(b);
                     countLast0A0D = 0;
                 }
                 break;
             default:
                 out.write(b);             // Add this line
                 // we're  no longer at the start of a line
                 countLast0A0D = 0;
                 break;
         }
     }


Steen


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org