#NEWLINE# def ex_update_mail_redirect( self , mail_r , destination , source = None ) : #NEWLINE# #INDENT# '\n        :param mail_r: Mail redirect to update\n        :type mail_r: :class:`MailRedirect`\n\n        :param destination: The destination address of mail redirect.\n        :type destination: ``str``\n\n        :param source: The source address of mail redirect. (optional)\n        :type source: ``str``\n\n        :rtype: ``list`` of :class:`MailRedirect`\n        ' #NEWLINE# zone_id = response . zone . id #NEWLINE# r_json = { #NEWLINE# #INDENT# 'destination_address' : destination , #NEWLINE# #UNINDENT# } #NEWLINE# if ( source is not None ) : #NEWLINE# #INDENT# r_json [ 'source_address' ] = source #NEWLINE# #UNINDENT# r_data = json . dumps ( { #NEWLINE# #INDENT# 'zone_redirect' : r_json , #NEWLINE# #UNINDENT# } ) #NEWLINE# try : #NEWLINE# #INDENT# response = self . connection . request ( ( '/zones/%s/mail_redirects/%s' % ( zone_id , mail_r . id ) ) , method = 'PUT' , data = r_data ) #NEWLINE# #UNINDENT# except ( BaseHTTPError , MalformedResponseError ) : #NEWLINE# #INDENT# e = sys . exc_info ( ) [ 1 ] #NEWLINE# if ( isinstance ( e , MalformedResponseError ) and ( e . body == 'Not found' ) ) : #NEWLINE# #INDENT# raise PointDNSException ( value = "Couldn't found mail redirect" , http_code = httplib . NOT_FOUND , driver = self ) #NEWLINE# #UNINDENT# raise PointDNSException ( value = e . message , http_code = e . code , driver = self ) #NEWLINE# #UNINDENT# mail_redirect = self . _to_mail_redirect ( response . object , zone = mail_r . zone ) #NEWLINE# return mail_redirect