Camel.InternetAddress¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Camel.InternetAddress(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod encode_address(len, name, addr)¶
- Parameters:
- Returns:
the encoded address
- Return type:
Encode a single address ready for internet usage. Header folding as per rfc822 is also performed, based on the length len. If len is
None
, then no folding will occur.Note: The value at in will be updated based on any linewrapping done
- classmethod format_address(name, addr)¶
- Parameters:
- Returns:
a nicely formatted string containing the rfc822 address
- Return type:
Function to format a single address, suitable for display.
- classmethod new()¶
- Returns:
a new
Camel.InternetAddress
object- Return type:
Create a new
Camel.InternetAddress
object.
- add(name, address)¶
- Parameters:
- Returns:
the index of added entry
- Return type:
Add a new internet address to self.
- ensure_ascii_domains()¶
Ensures that all email address’ domains will be ASCII encoded, which means that any non-ASCII letters will be properly encoded. This includes IDN (Internationalized Domain Names).
New in version 3.16.
- find_address(address)¶
- Parameters:
address (
str
) – address to lookup- Returns:
the index of the address, or -1 if not found
- namep:
holder for the matching name, or
None
, if not required.
- Return type:
Find an address by address.
- find_name(name)¶
- Parameters:
name (
str
) – name to lookup- Returns:
the index of the address matching the name, or -1 if no match was found
- addressp:
holder for address
Camel.part
, orNone
, if not required.
- Return type:
Find address by real name.
- get(index)¶
- Parameters:
index (
int
) – address’s array index- Returns:
- Return type:
Get the address at index.
- sanitize_ascii_domain()¶
-
Checks the addresses in self for any suspicious characters in the domain name and coverts those domains into their representation. In contrast to
Camel.InternetAddress.ensure_ascii_domains
(), this converts the domains into ASCII only when needed, as returned byCamel.hostname_utils_requires_ascii
().New in version 3.44.