Returning alternate HTTP codes for unpublished content
I haven't tried this myself, but I think the main problem is that in your cases, the "unpublished status" means two things.

I think your best bet is to use something like Workbench Moderation, and defined a "retired" state.  Then, in a hoot_init(), check the status, and generate the 410.

Something like:

function mymodule_init ()
{
   $node = menu_get_object();
   if (isset($node-&gt;nid) &amp;&amp; this_is_a_retired_node($node)) {
     drupal_add_http_header('Status', '410 Gone');
     drupal_exit(); // may want exit instead; not sure of other hook_inits()s should run
   }
}


I think you have to take the sledgehammer approach so that you don't get too far into the request where you may have a race condition with other modules.