I am using the following code:cat - emailbody.txt <<EOF | /usr/sbin/sendmail -oi -tFrom: <PersonB@xyz.com>To: <PersonA@xyz.com>Subject: TestmailContent-Type: text/html; charset=us-asciiContent-Transfer-Encoding: 7bitMIME-Version: 1.0EOFwhere emailbody.txt is a file with the contents of the email and PersonB@xyz.com and PersonA@xyz.com are both valid email addresses. My question is, that when I run this command, sendmail executes successfully and sends a mail to PersonA@xyz.com. However at no point does it ask for the credentials of PersonB@xyz.com. Shouldn't that check be executed before the mail is sent out? What prevents me from impersonating another person's email address to send out false mails. Is there a rationale for this behavior?
Why doesn't sendmail validate credentials before sending out a mail
sendmail