Which macOS processes handle iMessage network communications? I am trying to identify the macOS Catalina processes which handle network communication with Apple's iMessage servers. 

If you have iMessage enabled and quit the Messages app, incoming messages are still delivered to your computer. 

I've tried killing the imagent and IMDPersistenceAgent processes because they sounded related to messaging, but the former seems to be related to FaceTime only and killing the latter did not stop incoming iMessages.

To be clear: I am not simply trying to disable iMessage. I am trying to identify the processes that handle communication with iMessage. This is for two reasons:


The termination of these processes needs to be able to be executed in an automated bash script using pkill or something similar, and deactivation of iMessage cannot be done in such a way.
The computer needs to remain activated with the iMessage service so that when the processes are restarted (or the computer is restarted and the processes are launched on their own), any pending incoming iMessages are delivered. If iMessage were to be deactivated and then later activated, any messages during the period of time which it was deactivated would not be delivered.
iMessage message delivery is not as such handled seperately in a specific process for that single purpose.

Instead the generic apsd (Apple Push Notification Service Daemon) process handles the network communication. apsd handles Apple's push notification service in general.

The imagent process that you have already identified is indeed involved in iMessage, and not only Facetime. It is there to receive the notifications forwarded by the apsd process.

In addition there's a special case for iMessage attachments (i.e. very large iMessage messages in general). Their content is not transferred using push notificcations via apsd, but are rather downloaded from iCloud. That process is initiated via a notification from apsd however.

All in all this means that you can kill the apsd process, and keep it from restarting, and thereby stop iMessage messages from coming in (without "deactivating"). However it would also stop any other push notification from arriving at your computer.