Accessing custom settings from Groovy

does anyone know a way to read keys in "System Manager -> Settings" (i.e. the smtp stuff) from either web macro PHP or ETL Groovy jobs? From a web report it can be accessed with CONFIG.GET(), but i need it from code.