Can someone explain to me how "としまして" is formed?


Could someone help me by explaining how this is formed?

The question here refers to an answer to my question (second comment on
answer), but I don't understand it: [Could someone help with the gramatical
construction of this
phrase?](https://japanese.stackexchange.com/questions/42780/could-someone-
help-with-the-gramatical-construction-of-this-phrase)

Answer (3-㋒): <https://dictionary.goo.ne.jp/jn/120514/meaning/m0u/>

It looks like someone transformed a masu-form verb to a "masu-te"-form, which
I never heared of:

> する、します、しまして  
>  たべる、たべます、たべまして

If I am not mistaken, the referenced answer also talks about the potential
form. How does this relate? Furthermore, is this construction in any way
related to はじめまして?

