Domain Keys Identified Mail (DKIM) is one way of detecting spoofed emails. Receiving servers check that all sent mail is authorised by the owner of the domain.
This is done using DKIM signatures. A public key is published in the Domain Name System (DNS) record of the domain owner. The domain then digitally signs all outgoing mail using this public key. The signature is attached and verified by email servers, and is not visible to recipients.
Once the signature is validated, it guarantees that the emails have not changed since the signature was attached by the sending server. DKIMs non-repudiation feature prevents senders from credibly denying having sent an email.