linkcheck.checker.mailtourl
Handler for mailto: links.
Functions
|
Return list of email addresses from given field value. |
|
Return True iff domain string is a literal. |
|
Return True iff mail address is not correctly quoted. |
|
Return True iff mail address string is quoted. |
Classes
|
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:
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.
- 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:
How to check names (memo): https://tools.ietf.org/html/rfc3696
Email address syntax https://tools.ietf.org/html/rfc2822
SMTP protocol https://tools.ietf.org/html/rfc5321#section-4.1.3
Host syntax https://tools.ietf.org/html/rfc1123#section-2
- 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.
- linkcheck.checker.mailtourl.getaddresses(addr)[source]
Return list of email addresses from given field value.