The chemical reactions and pathways involving polyamines, any organic compound containing two or more amino groups.