But the similarity to email is in that accounts are not federated. [email protected] is an independent email, including storage, from [email protected] - might be a different person entirely.
The 'federated' part of email is that [email protected] can send email to [email protected], practically as if both were on the same server.
This is what ActivityPub does for social networking.
The other is user identity. That's the part where email appears to be more flexible by relying on DNS to seperate user identity from email hosting (for the small minority of users who own their domain name).
Section 3.1 of the ActivityPub spec says that objects (I think this includes users) are identified by "publicly dereferencable URIs, such as HTTPS URIs, with their authority belonging to that of their originating server" [1].
Now, I wonder if an "originating server" is actually required or if it's sufficient to control the domain to which this URI belongs. It seems to me that it should be rather simple for ActivityPub implementations to support a mechanism similar to MX records. For instance, TXT records could be used to achieve the same thing.
[1] https://www.w3.org/TR/2018/REC-activitypub-20180123/#obj-id
ActivityPub servers could do something similar here and in fact Mastodon in a sense supports this, (as you point out, the Actor's identity is essentially the URL of their profile, which could change host), but the problem then becomes that old interactions with the user will have 'ghost replies'. Understandably, as far as I know to save on storage and improve response times, not every interaction a user has on the fediverse with different users is copied to his/her server, that is replies in a thread from different users on different servers are still stored on their servers. Therefore if someone in a thread deletes their server, their responses/interactions will essentially disappear to anyone viewing that thread, so I might be replying to something a user said, but you won't be able to see what I am replying to etc.
Mastodon supports import/export, so that an Actor/user should be able to move servers and as long as they import their toots+followers + use the same domain, you shouldn't notice a difference, but I don't believe this is supported by the protocol directly.
When I switch email hosters, I change that MX record. The downside is that it only works for the domain as a whole but not for individual email addresses.
Does ActivityPub have something like this as well?