There are a number of ways to do this. Perhaps the easiest way is to simply edit the
postbit_attachment template and change:
Code:
<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>$attachment[filename]</a>
to...
Code:
<a href="http://your.cdn.com/attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>$attachment[filename]</a>
You could also do this with RRs, but you would need to be careful not to replace the code which uploads the attachment; so I advise you to just edit the template that displays the attachment (above).