Add message JSON to the delivery report.

This commit is contained in:
Tristan B. Kildaire 2020-07-20 20:05:16 +02:00
parent 1fcbd5b8f9
commit c711ad7b19
1 changed files with 3 additions and 2 deletions

View File

@ -582,7 +582,6 @@ public final class ButterflyClient : Thread
if(!Mailbox.isMailbox(username))
{
goto deliveryFailed;
}
/* Get the Mailbox of a given user */
@ -688,7 +687,9 @@ public final class ButterflyClient : Thread
deliveryReport["recipients"] = mailbox.username~"@"~server.domain;
/* TODO: Make more indepth, and have copy of the mail that was tried to be sent */
deliveryReport["message"] = "There was an error delivery the mail to: "~to!(string)(recipients);
string errorMessage = "There was an error delivery the mail to: "~to!(string)(recipients)~"\n";
errorMessage ~= "\nThe message was:\n\n"~mailBlock.toPrettyString();
deliveryReport["message"] = errorMessage;
/* Deliver the error message */
deliverMail(deliveryReport);