Your description suggests that rotten framing and/or not enough fasteners has caused the rail to let go, and water will seep in through the screw holes. Try first to add extra fasteners then seal over the top with elastomeric caulk (the cheap solution). The correct fix might be to seek warranty remedy, if the awning was factory installed. If not, fingerpointing will blame the other guy. All said, it might be early enough to save and I doubt that much framing damage occured in a year, but it is possible. Good luck.