How to make a spam rule

Yes, you can do this in Proxmox Mail Gateway: create a What → Match Field EV trend charts object, select Message-ID, match the required value/regex, then attach a Mark Spam or Quarantine action. PMG supports matching Message-ID headers directly.