Extra dot characters when using drop folder

Discussion for developers using MailEnable.
Post Reply
merravid
Posts: 1
Joined: Thu Oct 21, 2021 12:34 pm

Extra dot characters when using drop folder

Post by merravid »

I'm using the .NET SmtpClient to prepare messages for delivery using Mailenable. I'm dropping the .eml files into the Mailenable drop folder and this for the most part works well for us.

It appears that when SmtpClient encounters a message which, when the text is wrapped, has a dot character (.) at the beginning of a line, it adds an extra dot character. I believe this is per RFC 2821 (4.5.2).

I am guessing that Mailenable is re-processing the content and adding a further dot character, which results in the final email having a double dot character.

On the other hand, If the same email is sent via direct connection to the MailEnable server, the email turns out well.

When sending via the IIS SMTP pickup folder, the issue does not manifest itself either, so I am inclined to think this is a bug in Mailenable.

Below is an example of an email message that has been received with a double dot because of this issue. This can have a particularly undesirable effect if the extra dot character happens to be inserted in the text of a URL or IP address.


MIME-Version: 1.0
From: (redacted)
To: (redacted)
Date: 21 Oct 2021 14:02:48 +0100
Subject: Test
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Return-Path: (redacted)

This is a sentence in an email message that is of specific length=
.. The period at the end of the last string will be repeated if se=
nt through the Mailenable Drop folder.

MailEnable-Ian
Site Admin
Posts: 9738
Joined: Mon Mar 22, 2004 4:44 am
Location: Melbourne, Victoria, Australia

Re: Extra dot characters when using drop folder

Post by MailEnable-Ian »

Hi,

The SmtpClient class is fairly basic and stores the email ready to send via SMTP, which adds a . if the first character of a line has . So if you are trying to save its message it will not be the exact raw message data. But the drop folder requires that the email is the actual email contents. You would need to remove the extra ., simply done by removing the first . from each line if the second character is also a .

You also could possibly move to using MailKit which is much better than the SmtpClient class:

https://github.com/jstedfast/MailKit
Regards,

Ian Margarone
MailEnable Support

Post Reply