[PATCH] dmime: Move finding a track to a help function