Allow me to guess at the structure of your application. It receives email from an external source, and somehow creates the "MIME Entity" object. This object is expected to contain a valid URL (part of a valid HTML link??). Your application tries to link to that URL. Sometimes that link fails. You believe that the URL is missing the required 'dot', but have not explained how you know it. If this is true, it is reasonable to suspect a problem with "dot stuffing". Your example has nothing to do with this. It is crafted such that the 'as_string' method word wraps the line at the dot. There is only one line and it does not start with a dot.
The first thing you must determine is whether the original error occurred in sending, receiving, or processing the mail. It may be helpful if you could read an offending mail with a commercial email client. If that reads it correctly, you would know for sure that the mail was sent correctly. If not, it is highly likely that the mail was sent incorrectly.
In my earlier posts, I was guessing that you extract the URL from the as_string output and that fails in special cases. Sorry I cannot offer more help.