linkcheck.checker.mailtourl

Handler for mailto: links.

Functions

getaddresses(addr)

Return list of email addresses from given field value.

is_literal(domain)

Return True iff domain string is a literal.

is_missing_quote(addr)

Return True iff mail address is not correctly quoted.

is_quoted(addr)

Return True iff mail address string is quoted.

Classes

MailtoUrl(base_url, recursion_level, aggregate)

Url link with mailto scheme.

class linkcheck.checker.mailtourl.MailtoUrl(base_url, recursion_level, aggregate, parent_url=None, base_ref=None, line=- 1, column=- 1, page=- 1, name='', url_encoding=None, extern=None)[source]

Bases: linkcheck.checker.urlbase.UrlBase

Url link with mailto scheme.

Initialize check data, and store given variables.

Parameters
  • base_url – unquoted and possibly unnormed url

  • recursion_level – on what check level lies the base url

  • aggregate – aggregate instance

  • parent_url – quoted and normed url of parent or None

  • base_ref – quoted and normed url of <base href=””> or None

  • line – line number of url in parent content

  • column – column number of url in parent content

  • page – page number of url in parent content

  • name – name of url or empty

  • url_encoding – encoding of URL or None

  • extern – None or (is_extern, is_strict)

build_url()[source]

Call super.build_url(), extract list of mail addresses from URL, and check their syntax.

can_get_content()[source]

mailto: URLs do not have any content

Returns

False

Return type

bool

check_connection()[source]

Verify a list of email addresses. If one address fails, the whole list will fail.

For each mail address the MX DNS records are found. If no MX records are found, print a warning and try to look for A DNS records. If no A records are found either print an error.

check_email_syntax(mail)[source]

Check email syntax. The relevant RFCs:

check_smtp_domain(mail)[source]

Check a single mail address.

parse_addresses()[source]

Parse all mail addresses out of the URL target. Also parses optional CGI headers like “?to=foo@example.org”. Stores parsed addresses in the self.addresses set.

set_cache_url()[source]

The cache url is a comma separated list of emails.

linkcheck.checker.mailtourl.getaddresses(addr)[source]

Return list of email addresses from given field value.

linkcheck.checker.mailtourl.is_literal(domain)[source]

Return True iff domain string is a literal.

linkcheck.checker.mailtourl.is_missing_quote(addr)[source]

Return True iff mail address is not correctly quoted.

linkcheck.checker.mailtourl.is_quoted(addr)[source]

Return True iff mail address string is quoted.