How can I configure sendmail (or another mail server) to accept outbound mail, but to not send it out?

You can do that in sendmail by modifying rule set 0. Edit your /etc/mail/sendmail.mc to include (at the bottom):

LOCAL_RULE_0 
R$* < @ $=w . > $*       $#local $: $1
R$* < @ $* . > $*        $#local $: user

Rule set 0 selects a delivery agent for each recipient. The first line checks whether the recipient is a local user. If the recipient is a local user then the right hand side of the email address is included in class $=w then the recipient is considered local and the checks stop. If it is not included, then the mail is delivered to local user user (you may change this to any user of the system you like).

If you want to discard instead of delivering to user change the second line to:

R$* < @ $* . > $*        $#local $: bit-bucket

Where bit-bucket is an alias defined in /etc/mail/aliases:

bit-bucket: /dev/null

Do not forget to run newaliases after editing the /etc/mail/aliases file. Note: You cannot use $#discard in rule set 0.

Do not copy-paste the above code snippet. The left hand side and the right hand side of the rules are separated with tabs, not spaces. So it is better to type it in yourself.

After editing sendmail.mc you have to produce sendmail.cf and then restart the sendmail daemon. On Debian systems this is done by running sendmailconfig.