MailAccount class
Contains information about a single mail account
- Annotations
-
- @JsonSerializable()
Constructors
-
MailAccount({required String name, required String email, required MailServerConfig incoming, required MailServerConfig outgoing, String userName = '', String outgoingClientDomain = 'enough.de', bool supportsPlusAliases = false, List<
MailAddress> aliases = const [], Map<String, dynamic> attributes = const {}}) -
Creates a new empty mail account
const
-
MailAccount.fromDiscoveredSettings({required String name, required String email, required String password, required ClientConfig config, required String userName, String outgoingClientDomain = 'enough.de', String? loginName, bool supportsPlusAliases = false, List<
MailAddress> aliases = const []}) -
Creates a mail account with the given
name
for the specifiedemail
from the discoveredconfig
with a a plain authentication for the preferred incoming and preferred outgoing server.factory -
MailAccount.fromDiscoveredSettingsWithAuth({required String name, required String email, required MailAuthentication auth, required ClientConfig config, String userName = '', String outgoingClientDomain = 'enough.de', MailAuthentication? outgoingAuth, bool supportsPlusAliases = false, List<
MailAddress> aliases = const []}) -
Creates a mail account with the given
name
from the discoveredconfig
with the givenauth
for the preferred incoming and preferred outgoing server.factory -
MailAccount.fromJson(Map<
String, dynamic> json) -
Creates a new MailAccount from the given
json
factory -
MailAccount.fromManualSettings({required String name, required String email, required String incomingHost, required String outgoingHost, required String password, String userName = '', ServerType incomingType = ServerType.imap, ServerType outgoingType = ServerType.smtp, String? loginName, String outgoingClientDomain = 'enough.de', int incomingPort = 993, int outgoingPort = 465, SocketType incomingSocketType = SocketType.ssl, SocketType outgoingSocketType = SocketType.ssl, bool supportsPlusAliases = false, List<
MailAddress> aliases = const []}) -
Creates a mail account from manual settings
with a simple user-name/password authentication.
factory
-
MailAccount.fromManualSettingsWithAuth({required String name, required String email, required String incomingHost, required String outgoingHost, required MailAuthentication auth, String userName = '', ServerType incomingType = ServerType.imap, ServerType outgoingType = ServerType.smtp, MailAuthentication? outgoingAuth, String outgoingClientDomain = 'enough.de', dynamic incomingPort = 993, dynamic outgoingPort = 465, SocketType incomingSocketType = SocketType.ssl, SocketType outgoingSocketType = SocketType.ssl, bool supportsPlusAliases = false, List<
MailAddress> aliases = const []}) -
Creates a mail account from manual settings with the specified
auth
.factory
Properties
-
aliases
→ List<
MailAddress> -
Optional list of associated aliases
final
-
attributes
→ Map<
String, dynamic> -
Further attributes
final
- email → String
-
The email address of the user
final
- fromAddress → MailAddress
-
Convenience getter for the from MailAddress
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- incoming → MailServerConfig
-
Incoming mail settings
final
- name → String
-
The name of the account
final
- outgoing → MailServerConfig
-
Outgoing mail settings
final
- outgoingClientDomain → String
-
The domain that is reported to the outgoing SMTP service
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsPlusAliases → bool
-
Optional indicator if the mail service supports + based aliases
final
- userName → String
-
The associated name of the user such as
First Last
, e.g.Andrea Ghez
final
Methods
-
copyWith(
{String? name, String? email, String? userName, MailServerConfig? incoming, MailServerConfig? outgoing, List< MailAddress> ? aliases, Map<String, dynamic> ? attributes, String? outgoingClientDomain, bool? supportsPlusAliases}) → MailAccount - Creates a new MailAccount with the given settings or by copying the current settings.
-
copyWithAlias(
MailAddress alias) → MailAccount -
Copies this account with the additional
alias
-
copyWithAttribute(
String name, dynamic value) → MailAccount -
Copies this account with the attribute
name
andvalue
-
copyWithAuthenticationUserName(
String authenticationUserName) → MailAccount - Convenience method to update the incoming and outgoing authentication user name for identifying the user towards the mail service.
-
hasAttribute(
String name) → bool -
Checks if this account has an attribute with the specified
name
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Generates JSON from this MailAccount
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
getLoginName(
String email, ServerConfig serverConfig) → String -
Retrieves the user name from the given
email
and the discoveredserverConfig
.