Re: [xmail] XMail 1.26-Pre05 prepends a white char to original header lines

2009-02-09 Thread Bart Mortelmans

Hi,

I think there still is a problem somewhere. An other destination 
mailserver responds with this (not sure what they're running):

 550 Requested action not taken: Nonstandard SMTP line terminator.

It seems there still is a wrong linefeed in there?

Again: tested without any filters.

I hope you can figure out what is causing this

Sincerely,
Bart Mortelmans


Davide Libenzi schreef:

On Mon, 9 Feb 2009, Bart Mortelmans wrote:

  

OK, lets try as attachment ...

  

That seems to have done the trick! I tested with an e-mail to Hotmail, and
that one did now correctly display.
I'll also test with Exim a.s.a.p.

Thanks again!



OK, thanks for testing. I'll make pre06 tomorrow...


- Davide


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail

  


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.26-Pre05 prepends a white char to original header lines

2009-02-09 Thread Bart Mortelmans

Hi,

I've been using
tcpdump -X -q -s 2048 host XXX.XXX.XXX.XXX
to check out what might be going on. I'm rather sure that the second  
linebreak to make the empty line between the headers and the body  
consists only of a LF, no CR. In Hex I'm seeing 0d0a0a instead of the  
expected 0d0a0d0a.


I hope this helps you to solve this.

Sincerely,
Bart Mortelmans




On 9-feb-09, at 16:48, Bart Mortelmans wrote:


Hi,

I think there still is a problem somewhere. An other destination  
mailserver responds with this (not sure what they're running):

 550 Requested action not taken: Nonstandard SMTP line terminator.

It seems there still is a wrong linefeed in there?

Again: tested without any filters.

I hope you can figure out what is causing this

Sincerely,
Bart Mortelmans


Davide Libenzi schreef:


On Mon, 9 Feb 2009, Bart Mortelmans wrote:



OK, lets try as attachment ...


That seems to have done the trick! I tested with an e-mail to  
Hotmail, and

that one did now correctly display.
I'll also test with Exim a.s.a.p.

Thanks again!


OK, thanks for testing. I'll make pre06 tomorrow...


- Davide


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail




___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.26-Pre05 prepends a white char to original header lines

2009-02-09 Thread Davide Libenzi
On Mon, 9 Feb 2009, Bart Mortelmans wrote:

 Hi,
 
 I've been usingĀ 
 tcpdump -X -q -s 2048 host XXX.XXX.XXX.XXX
 to check out what might be going on. I'm rather sure that the second 
 linebreak to make the empty line between
 the headers and the body consists only of a LF, no CR. In Hex I'm seeing 
 0d0a0a instead of the expected
 0d0a0d0a.
 
 I hope this helps you to solve this.

With this debugging you do, it's not hard to solve problems. Thanks.
Try the attached diff, on top of the one I sent you yesterday...



- Davide

diff --git a/SMAILUtils.cpp b/SMAILUtils.cpp
index 6deef5d..71e21e1 100644
--- a/SMAILUtils.cpp
+++ b/SMAILUtils.cpp
@@ -935,13 +935,13 @@ int USmlGetMsgFileSection(SPLF_HANDLE hFSpool, FileSection FSect)
 int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile, bool bMBoxFile)
 {
 	SpoolFileData *pSFD = (SpoolFileData *) hFSpool;
+	const char *pszLF = bMBoxFile ? SYS_EOL: \r\n;
 
 	/* Dump message tags */
-	if (USmlDumpHeaders(pMsgFile, pSFD-hTagList,
-			bMBoxFile ? SYS_EOL: \r\n)  0)
+	if (USmlDumpHeaders(pMsgFile, pSFD-hTagList, pszLF)  0)
 		return ErrGetErrorCode();
 
-	fputs(SYS_EOL, pMsgFile);
+	fputs(pszLF, pMsgFile);
 
 	/* Dump message data */
 	FILE *pMessFile = fopen(pSFD-szMessFilePath, rb);
___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


[xmail] XMail 1.26-Pre05 prepends a white char to original header lines

2009-02-08 Thread Bart Mortelmans

Hi,

When using XMail 1.26-Pre05 with redirect in the mailproc.tab to 
forward mails, the header lines that where in the e-mail before delivery 
at XMailserver, seem to be prepended with something that very much looks 
like a white space. At least that's what it looks like when delivered to 
an Exim mailserver.
Mails redirected to a hotmail address are interpreted incorrectly by 
hotmail. Hotmail shows parts of the headers of such an e-mail in the body.


The problem occurs with mails delivered by XMail 1.26-Pre05 to an Exim 
or hotmail mailserver (maybe also to other MTA's?)
The problem doesn't occur with mails delivered by XMail 1.26-Pre05 to an 
older version of XMail, to GMail, to QMail or to mails stored in the mailbox
The problem also doesn't occur with mails delivered by XMail 1.24 with 
the exact same configuration


The mails didn't pass by any filters or other plug-ins.

Could this have something to do with the change to the line endings, but 
I thought that only changed things when storing mails in the mailbox?


Is anybody else seeing this? Has anyone used this version for delivery 
to Hotmail or to a server running Exim?


Davide, do let me know if you need any more information to be able to 
investigate this.


Thanks!

Sincerely,
Bart Mortelmans


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.26-Pre05 prepends a white char to original header lines

2009-02-08 Thread Davide Libenzi
On Sun, 8 Feb 2009, Bart Mortelmans wrote:

 Hi,
 
 When using XMail 1.26-Pre05 with redirect in the mailproc.tab to forward
 mails, the header lines that where in the e-mail before delivery at
 XMailserver, seem to be prepended with something that very much looks like a
 white space. At least that's what it looks like when delivered to an Exim
 mailserver.
 Mails redirected to a hotmail address are interpreted incorrectly by hotmail.
 Hotmail shows parts of the headers of such an e-mail in the body.
 
 The problem occurs with mails delivered by XMail 1.26-Pre05 to an Exim or
 hotmail mailserver (maybe also to other MTA's?)
 The problem doesn't occur with mails delivered by XMail 1.26-Pre05 to an older
 version of XMail, to GMail, to QMail or to mails stored in the mailbox
 The problem also doesn't occur with mails delivered by XMail 1.24 with the
 exact same configuration
 
 The mails didn't pass by any filters or other plug-ins.
 
 Could this have something to do with the change to the line endings, but I
 thought that only changed things when storing mails in the mailbox?
 
 Is anybody else seeing this? Has anyone used this version for delivery to
 Hotmail or to a server running Exim?
 
 Davide, do let me know if you need any more information to be able to
 investigate this.

Thank you Bart. I think I found the problem. Can you try the patch below 
on top of 1.26-pre05?

$ cd XMAIL_SOURCE
$ patch -p1  PATCH_FILE
$ make -f MAKEFILE



- Davide



diff --git a/SMAILUtils.cpp b/SMAILUtils.cpp
index f7f5dba..6deef5d 100644
--- a/SMAILUtils.cpp
+++ b/SMAILUtils.cpp
@@ -932,12 +932,13 @@ int USmlGetMsgFileSection(SPLF_HANDLE hFSpool, 
FileSection FSect)
return 0;
 }
 
-int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile)
+int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile, bool bMBoxFile)
 {
SpoolFileData *pSFD = (SpoolFileData *) hFSpool;
 
/* Dump message tags */
-   if (USmlDumpHeaders(pMsgFile, pSFD-hTagList, SYS_EOL)  0)
+   if (USmlDumpHeaders(pMsgFile, pSFD-hTagList,
+   bMBoxFile ? SYS_EOL: \r\n)  0)
return ErrGetErrorCode();
 
fputs(SYS_EOL, pMsgFile);
@@ -949,19 +950,26 @@ int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile)
ErrSetErrorCode(ERR_FILE_OPEN, pSFD-szMessFilePath);
return ERR_FILE_OPEN;
}
+
+   bool bWantCRLF = !bMBoxFile;
+
 #ifdef SYS_CRLF_EOL
-   if (MscCopyFile(pMsgFile, pMessFile, pSFD-llMailDataOffset,
-   (SYS_OFF_T) -1)  0) {
-   fclose(pMessFile);
-   return ErrGetErrorCode();
-   }
-#else
-   Sys_fseek(pMessFile, pSFD-llMailDataOffset, SEEK_SET);
-   if (MscDos2UnixFile(pMsgFile, pMessFile)  0) {
-   fclose(pMessFile);
-   return ErrGetErrorCode();
-   }
+   if (!bWantCRLF)
+   bWantCRLF = true;
 #endif
+   if (bWantCRLF) {
+   if (MscCopyFile(pMsgFile, pMessFile, pSFD-llMailDataOffset,
+   (SYS_OFF_T) -1)  0) {
+   fclose(pMessFile);
+   return ErrGetErrorCode();
+   }
+   } else {
+   Sys_fseek(pMessFile, pSFD-llMailDataOffset, SEEK_SET);
+   if (MscDos2UnixFile(pMsgFile, pMessFile)  0) {
+   fclose(pMessFile);
+   return ErrGetErrorCode();
+   }
+   }
fclose(pMessFile);
 
return 0;
@@ -1120,7 +1128,7 @@ int USmlCreateMBFile(UserInfo *pUI, const char 
*pszFileName, SPLF_HANDLE hFSpool
SysFree(pszReturnPath);
 
/* Write mail file */
-   if (USmlWriteMailFile(hFSpool, pMBFile)  0) {
+   if (USmlWriteMailFile(hFSpool, pMBFile, true)  0) {
ErrorPush();
fclose(pMBFile);
SysRemove(pszFileName);
diff --git a/SMAILUtils.h b/SMAILUtils.h
index 74c0f77..3e1bf73 100644
--- a/SMAILUtils.h
+++ b/SMAILUtils.h
@@ -77,7 +77,7 @@ const char *USmlSendRcptTo(SPLF_HANDLE hFSpool);
 SYS_OFF_T USmlMessageSize(SPLF_HANDLE hFSpool);
 int USmlSyncChanges(SPLF_HANDLE hFSpool);
 int USmlGetMsgFileSection(SPLF_HANDLE hFSpool, FileSection FSect);
-int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile);
+int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile, bool bMBoxFile = 
false);
 char *USmlGetTag(SPLF_HANDLE hFSpool, const char *pszTagName, TAG_POSITION 
TagPosition);
 int USmlAddTag(SPLF_HANDLE hFSpool, const char *pszTagName,
   const char *pszTagData, int iUpdate = 0);
___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.26-Pre05 prepends a white char to original header lines

2009-02-08 Thread Bart Mortelmans

Hi Davide,

That was quick! :-)


I get this response when applying the patch:
===
patching file SMAILUtils.cpp
patch:  malformed patch at line 7: }
===

I didn't continue, because I assume that patch didn't do anything.
I've never tried to patch something, so it's a bit new to me. I  
simply copy-pasted the code to a file which I hapenned to name  
PATCH_FILE, placed it in the sourcode folder and then ran patch -p1   
PATCH_FILE within that folder...


If it's not something in the patch-code, could you maybe try to ad the  
code as an attachment, so I'm sure it's not my e-mail client  
malformatting the code.


Thanks!

Sincerely,
Bart Mortelmans



On 8-feb-09, at 21:20, Davide Libenzi wrote:


On Sun, 8 Feb 2009, Bart Mortelmans wrote:


Hi,

When using XMail 1.26-Pre05 with redirect in the mailproc.tab to  
forward

mails, the header lines that where in the e-mail before delivery at
XMailserver, seem to be prepended with something that very much  
looks like a
white space. At least that's what it looks like when delivered to  
an Exim

mailserver.
Mails redirected to a hotmail address are interpreted incorrectly  
by hotmail.

Hotmail shows parts of the headers of such an e-mail in the body.

The problem occurs with mails delivered by XMail 1.26-Pre05 to an  
Exim or

hotmail mailserver (maybe also to other MTA's?)
The problem doesn't occur with mails delivered by XMail 1.26-Pre05  
to an older
version of XMail, to GMail, to QMail or to mails stored in the  
mailbox
The problem also doesn't occur with mails delivered by XMail 1.24  
with the

exact same configuration

The mails didn't pass by any filters or other plug-ins.

Could this have something to do with the change to the line  
endings, but I

thought that only changed things when storing mails in the mailbox?

Is anybody else seeing this? Has anyone used this version for  
delivery to

Hotmail or to a server running Exim?

Davide, do let me know if you need any more information to be able to
investigate this.


Thank you Bart. I think I found the problem. Can you try the patch  
below

on top of 1.26-pre05?

$ cd XMAIL_SOURCE
$ patch -p1  PATCH_FILE
$ make -f MAKEFILE



- Davide



diff --git a/SMAILUtils.cpp b/SMAILUtils.cpp
index f7f5dba..6deef5d 100644
--- a/SMAILUtils.cpp
+++ b/SMAILUtils.cpp
@@ -932,12 +932,13 @@ int USmlGetMsgFileSection(SPLF_HANDLE hFSpool,  
FileSection FSect)

return 0;
}

-int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile)
+int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile, bool  
bMBoxFile)

{
SpoolFileData *pSFD = (SpoolFileData *) hFSpool;

/* Dump message tags */
-   if (USmlDumpHeaders(pMsgFile, pSFD-hTagList, SYS_EOL)  0)
+   if (USmlDumpHeaders(pMsgFile, pSFD-hTagList,
+   bMBoxFile ? SYS_EOL: \r\n)  0)
return ErrGetErrorCode();

fputs(SYS_EOL, pMsgFile);
@@ -949,19 +950,26 @@ int USmlWriteMailFile(SPLF_HANDLE hFSpool,  
FILE *pMsgFile)

ErrSetErrorCode(ERR_FILE_OPEN, pSFD-szMessFilePath);
return ERR_FILE_OPEN;
}
+
+   bool bWantCRLF = !bMBoxFile;
+
#ifdef SYS_CRLF_EOL
-   if (MscCopyFile(pMsgFile, pMessFile, pSFD-llMailDataOffset,
-   (SYS_OFF_T) -1)  0) {
-   fclose(pMessFile);
-   return ErrGetErrorCode();
-   }
-#else
-   Sys_fseek(pMessFile, pSFD-llMailDataOffset, SEEK_SET);
-   if (MscDos2UnixFile(pMsgFile, pMessFile)  0) {
-   fclose(pMessFile);
-   return ErrGetErrorCode();
-   }
+   if (!bWantCRLF)
+   bWantCRLF = true;
#endif
+   if (bWantCRLF) {
+   if (MscCopyFile(pMsgFile, pMessFile, pSFD-llMailDataOffset,
+   (SYS_OFF_T) -1)  0) {
+   fclose(pMessFile);
+   return ErrGetErrorCode();
+   }
+   } else {
+   Sys_fseek(pMessFile, pSFD-llMailDataOffset, SEEK_SET);
+   if (MscDos2UnixFile(pMsgFile, pMessFile)  0) {
+   fclose(pMessFile);
+   return ErrGetErrorCode();
+   }
+   }
fclose(pMessFile);

return 0;
@@ -1120,7 +1128,7 @@ int USmlCreateMBFile(UserInfo *pUI, const char  
*pszFileName, SPLF_HANDLE hFSpool

SysFree(pszReturnPath);

/* Write mail file */
-   if (USmlWriteMailFile(hFSpool, pMBFile)  0) {
+   if (USmlWriteMailFile(hFSpool, pMBFile, true)  0) {
ErrorPush();
fclose(pMBFile);
SysRemove(pszFileName);
diff --git a/SMAILUtils.h b/SMAILUtils.h
index 74c0f77..3e1bf73 100644
--- a/SMAILUtils.h
+++ b/SMAILUtils.h
@@ -77,7 +77,7 @@ const char *USmlSendRcptTo(SPLF_HANDLE hFSpool);
SYS_OFF_T USmlMessageSize(SPLF_HANDLE hFSpool);
int USmlSyncChanges(SPLF_HANDLE hFSpool);
int USmlGetMsgFileSection(SPLF_HANDLE hFSpool, FileSection FSect);
-int USmlWriteMailFile(SPLF_HANDLE hFSpool, 

Re: [xmail] XMail 1.26-Pre05 prepends a white char to original header lines

2009-02-08 Thread Davide Libenzi
On Sun, 8 Feb 2009, Bart Mortelmans wrote:

 Hi Davide,
 
 That was quick! :-)
 
 
 I get this response when applying the patch:
 ===
 patching file SMAILUtils.cpp
 patch:  malformed patch at line 7: }
 ===

OK, lets try as attachment ...


- Davide

diff --git a/SMAILUtils.cpp b/SMAILUtils.cpp
index f7f5dba..6deef5d 100644
--- a/SMAILUtils.cpp
+++ b/SMAILUtils.cpp
@@ -932,12 +932,13 @@ int USmlGetMsgFileSection(SPLF_HANDLE hFSpool, FileSection FSect)
 	return 0;
 }
 
-int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile)
+int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile, bool bMBoxFile)
 {
 	SpoolFileData *pSFD = (SpoolFileData *) hFSpool;
 
 	/* Dump message tags */
-	if (USmlDumpHeaders(pMsgFile, pSFD-hTagList, SYS_EOL)  0)
+	if (USmlDumpHeaders(pMsgFile, pSFD-hTagList,
+			bMBoxFile ? SYS_EOL: \r\n)  0)
 		return ErrGetErrorCode();
 
 	fputs(SYS_EOL, pMsgFile);
@@ -949,19 +950,26 @@ int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile)
 		ErrSetErrorCode(ERR_FILE_OPEN, pSFD-szMessFilePath);
 		return ERR_FILE_OPEN;
 	}
+
+	bool bWantCRLF = !bMBoxFile;
+
 #ifdef SYS_CRLF_EOL
-	if (MscCopyFile(pMsgFile, pMessFile, pSFD-llMailDataOffset,
-			(SYS_OFF_T) -1)  0) {
-		fclose(pMessFile);
-		return ErrGetErrorCode();
-	}
-#else
-	Sys_fseek(pMessFile, pSFD-llMailDataOffset, SEEK_SET);
-	if (MscDos2UnixFile(pMsgFile, pMessFile)  0) {
-		fclose(pMessFile);
-		return ErrGetErrorCode();
-	}
+	if (!bWantCRLF)
+		bWantCRLF = true;
 #endif
+	if (bWantCRLF) {
+		if (MscCopyFile(pMsgFile, pMessFile, pSFD-llMailDataOffset,
+(SYS_OFF_T) -1)  0) {
+			fclose(pMessFile);
+			return ErrGetErrorCode();
+		}
+	} else {
+		Sys_fseek(pMessFile, pSFD-llMailDataOffset, SEEK_SET);
+		if (MscDos2UnixFile(pMsgFile, pMessFile)  0) {
+			fclose(pMessFile);
+			return ErrGetErrorCode();
+		}
+	}
 	fclose(pMessFile);
 
 	return 0;
@@ -1120,7 +1128,7 @@ int USmlCreateMBFile(UserInfo *pUI, const char *pszFileName, SPLF_HANDLE hFSpool
 		SysFree(pszReturnPath);
 
 	/* Write mail file */
-	if (USmlWriteMailFile(hFSpool, pMBFile)  0) {
+	if (USmlWriteMailFile(hFSpool, pMBFile, true)  0) {
 		ErrorPush();
 		fclose(pMBFile);
 		SysRemove(pszFileName);
diff --git a/SMAILUtils.h b/SMAILUtils.h
index 74c0f77..3e1bf73 100644
--- a/SMAILUtils.h
+++ b/SMAILUtils.h
@@ -77,7 +77,7 @@ const char *USmlSendRcptTo(SPLF_HANDLE hFSpool);
 SYS_OFF_T USmlMessageSize(SPLF_HANDLE hFSpool);
 int USmlSyncChanges(SPLF_HANDLE hFSpool);
 int USmlGetMsgFileSection(SPLF_HANDLE hFSpool, FileSection FSect);
-int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile);
+int USmlWriteMailFile(SPLF_HANDLE hFSpool, FILE *pMsgFile, bool bMBoxFile = false);
 char *USmlGetTag(SPLF_HANDLE hFSpool, const char *pszTagName, TAG_POSITION TagPosition);
 int USmlAddTag(SPLF_HANDLE hFSpool, const char *pszTagName,
 	   const char *pszTagData, int iUpdate = 0);
___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail