I wanted to use sendmail to test the sending of some messages in one of my apps. The command I wanted to run was:

yo:~ $ sendmail -t < y

I got this error:

yo:~ $ sendmail -t < y
sendmail: fatal: chdir /Library/Server/Mail/Data/spool: No such file or directory

Fixed with:

yo:~ $ sudo mkdir -p /Library/Server/Mail/Data/spool
Password:
yo:~ $ sudo /usr/sbin/postfix set-permissions
chown: /usr/share/man/man1/postalias.1.gz: No such file or directory
yo:~ $ sudo /usr/sbin/postfix start
postfix/postfix-script: warning: group or other writable: /Library/Server/Mail/Data/mta
postfix/postfix-script: starting the Postfix mail system 

Now the sendmail -t command works as expected.

Contents of the file y:

yo:~ $ more y
To:  me@example.com
Subject: Thanks!
Content-Type: text/plain; charset='UTF-8'

Dear Me,

Thank you for doing whatever it is that I'm thanking you for.  It's been a pleasure.

Sincerely,
Me