As somebody else mentioned, make sure that the SMTP envelope sender is the email address to which you want to receive bounces. Ideally, you want this to be a unique user, so that as you handle emails, you can be fairly certain they're bounces
only. Most MTAs will respect that address as the originating address; you can't do much about the others.
Then, on the machine that hosts that email address, you need to put in a filter of some sort. Check to see if your server has procmail or maildrop installed. Then write a recipe for that address that processes incoming mail, searching for bounces, and searching in bounces for the original recipient -- this is where perl comes in, as you'll have your filter call a perl routine that will scan the incoming mail. The method for doing so will vary based on the MTA you use, but most have some easily identifiable block within bounced mail showing the original headers, and you can use a regex on those. Then update your database.
Always keep in mind that a message may bounce because (a) a user's account has temporarily exceeded quota, (b) a user's MTA is temporarily down (power failure, maintenance), (c) old DNS for a user's host is cached in the MTA, etc. It's best not to remove a user based on a single bounce. Where I work, we remove a user based on a formula involving consecutive bounces and frequency with which we mail the user. This means that when we update our DB, we're actually incrementing a 'bounced' count. A cronjob then goes through the list later and checks those with high bounce counts to determine if they should be removed.
Good luck!