Yes, exactly. This is why real-world systems additionally include some kind of authentication protocol.
Reference: https://en.wikipedia.org/wiki/Man-in-the-middle_attack#Authe...
Reference: https://en.wikipedia.org/wiki/Man-in-the-middle_attack#Authe...
That is, how email exchange can be guaranteed to work properly, and MITM won't insert his email in the middle of the process?