code: def dkim_sign(message, dkim_domain=None, dkim_key=None, dkim_selector=None, dkim_headers=None):
      
      try:
          import dkim
      except ImportError:
          pass
      else:
          if dkim_domain and dkim_key:
              sig = dkim.sign(message,
                              dkim_selector,
                              dkim_domain,
                              dkim_key,
                              include_headers=dkim_headers)
              message = sig + message
      return message
docs: Return signed email message if dkim package and settings are available.