do not replace new lines in error message

This forum contains features that has been archived. This section contains implemented features, duplicate requests, and requests which we have decided not to implement.
Post Reply
terifo
New user
New user
Posts: 7
Joined: 2014-09-03 12:08

do not replace new lines in error message

Post by terifo » 2014-09-03 12:31

Hi,

I am suffering to make our bounce management working and found out that the original hMailServer bounce management is not sufficient.
The problem is that it does not include original headers in the body of the mailer daemon message - more specifically Message-ID header.

I found this script viewtopic.php?f=20&t=18029 that is fixing this problem.
However, before hMailServer calls this script, it damages the error message content, which is done by this code in hmailserver\source\Server\Common\Scripting\Events.cpp:

Code: Select all

         if (sScriptLanguage == _T("VBScript"))
         {
            sRecipientCopy.Replace(_T("\""), _T(""));
            sErrorMessageCopy.Replace(_T("\""), _T(""));

            sErrorMessageCopy.Replace(_T("\r"), _T(""));
            sErrorMessageCopy.Replace(_T("\n"), _T(""));

            sErrorMessageCopy.TrimLeft();
            sErrorMessageCopy.TrimRight();

            sEventCaller.Format(_T("OnDeliveryFailed(HMAILSERVER_MESSAGE, \"%s\", \"%s\")"), sRecipientCopy, sErrorMessageCopy);
         }
This removes formating of the error message - it removes new lines and thus in VBS script we have only a one liner from which the original error message is impossible to restore.

Those lines remove \r and \n are the problem.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: do not replace new lines in error message

Post by percepts » 2014-09-03 12:47

enhancement requests should now be placed in Github at:

https://github.com/hmailserver/hmailser ... =is%3Aopen

terifo
New user
New user
Posts: 7
Joined: 2014-09-03 12:08

Re: do not replace new lines in error message

Post by terifo » 2014-09-03 16:25

ok, will try to post it there, thanks

User avatar
martin
Developer
Developer
Posts: 6831
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: do not replace new lines in error message

Post by martin » 2014-10-10 12:53

Implemented in 5.6.
Martin Knafve
martin@hmailserver.com
https://twitter.com/knafve

Post Reply