public void removeMailServer ( String hostName , String username ) throws SecurityException { checkWriteAccess ( ) ; Element mail = _getRootElement ( "mail" ) ; Element [ ] children = XMLConfigWebFactory . getChildren ( mail , "server" ) ; String _hostName , _username ; if ( children . length > 0 ) { for ( int i = 0 ; i < children . length ; i ++ ) { Element el = children [ i ] ; _hostName = el . getAttribute ( "smtp" ) ; _username = el . getAttribute ( "username" ) ; if ( StringUtil . emptyIfNull ( _hostName ) . equalsIgnoreCase ( StringUtil . emptyIfNull ( hostName ) ) && StringUtil . emptyIfNull ( _username ) . equalsIgnoreCase ( StringUtil . emptyIfNull ( username ) ) ) { mail . removeChild ( children [ i ] ) ; } } } }
removes a mailserver from system