Hi Edwin
My glue of choice for this job is Evostik. It is a forgiving glue. If you go wrong, you can gently peel off the rubber, rub off the dry glue with your hand (no damage to the paint) and start again. Even after years of adherence, you can remove the rubber, rub off the old glue and no damage to the paint. Obviously, the metal surface and rubber need to be meticulously clean before you start (removal of old bits of rubber, grime, rust etc). Apply glue to both surfaces, allow to become tacky, offer up rubber seal and secure with masking tape. Leave overnight to fully cure.