You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/03/26 14:17:05 UTC

[camel] branch master updated: CAMEL-14795: camel-mail - allow dynamic setting of token in order to be able to (#3683)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 312d281  CAMEL-14795: camel-mail - allow dynamic setting of token in order to be able to (#3683)
312d281 is described below

commit 312d28184914036f17693ee828162eff8b3530af
Author: forsthofer <fo...@users.noreply.github.com>
AuthorDate: Thu Mar 26 15:16:53 2020 +0100

    CAMEL-14795: camel-mail - allow dynamic setting of token in order to be able to (#3683)
    
    support OAUTH
    
    Co-authored-by: Franz Forsthofer <fr...@sap.com>
---
 .../component/mail/MailComponentConfigurer.java    |   3 +
 .../component/mail/MailEndpointConfigurer.java     |   3 +
 .../org/apache/camel/component/mail/imap.json      |  10 +-
 .../org/apache/camel/component/mail/imaps.json     |  10 +-
 .../org/apache/camel/component/mail/pop3.json      |  10 +-
 .../org/apache/camel/component/mail/pop3s.json     |  10 +-
 .../org/apache/camel/component/mail/smtp.json      |  10 +-
 .../org/apache/camel/component/mail/smtps.json     |  10 +-
 .../camel-mail/src/main/docs/mail-component.adoc   |  14 +-
 .../camel/component/mail/DefaultAuthenticator.java |   2 +-
 .../component/mail/DefaultJavaMailSender.java      |  27 +++-
 .../camel/component/mail/JavaMailSender.java       |   4 +
 ...ltAuthenticator.java => MailAuthenticator.java} |  21 +--
 .../camel/component/mail/MailConfiguration.java    |  42 +++++-
 .../apache/camel/component/mail/MailConsumer.java  |   4 +-
 .../camel/component/mail/AuthenticatorTest.java    | 159 +++++++++++++++++++++
 .../camel/component/mail/MailComponentTest.java    |  23 +++
 .../mail/MailConsumerAuthenticatorTest.java        | 105 ++++++++++++++
 .../component/mail/MailCustomMailSenderTest.java   |  10 +-
 .../camel/component/mail/mock/MyMockStore.java     |   3 +
 .../component/mail/mock/MyMockTransport.java}      |  31 ++--
 .../mock/{MyMockStore.java => MyPop3Store.java}    |  33 +----
 .../src/test/resources/META-INF/javamail.providers |   4 +-
 .../component/dsl/ImapComponentBuilderFactory.java |  20 ++-
 .../dsl/ImapsComponentBuilderFactory.java          |  20 ++-
 .../component/dsl/Pop3ComponentBuilderFactory.java |  20 ++-
 .../dsl/Pop3sComponentBuilderFactory.java          |  20 ++-
 .../component/dsl/SmtpComponentBuilderFactory.java |  20 ++-
 .../dsl/SmtpsComponentBuilderFactory.java          |  20 ++-
 .../endpoint/dsl/MailEndpointBuilderFactory.java   | 100 ++++++++++++-
 30 files changed, 644 insertions(+), 124 deletions(-)

diff --git a/components/camel-mail/src/generated/java/org/apache/camel/component/mail/MailComponentConfigurer.java b/components/camel-mail/src/generated/java/org/apache/camel/component/mail/MailComponentConfigurer.java
index f0a1dc1..51da2d2 100644
--- a/components/camel-mail/src/generated/java/org/apache/camel/component/mail/MailComponentConfigurer.java
+++ b/components/camel-mail/src/generated/java/org/apache/camel/component/mail/MailComponentConfigurer.java
@@ -32,6 +32,7 @@ public class MailComponentConfigurer extends PropertyConfigurerSupport implement
         case "alternativeBodyHeader": getOrCreateConfiguration(target).setAlternativeBodyHeader(property(camelContext, java.lang.String.class, value)); return true;
         case "attachmentscontenttransferencodingresolver":
         case "attachmentsContentTransferEncodingResolver": getOrCreateConfiguration(target).setAttachmentsContentTransferEncodingResolver(property(camelContext, org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver.class, value)); return true;
+        case "authenticator": getOrCreateConfiguration(target).setAuthenticator(property(camelContext, org.apache.camel.component.mail.MailAuthenticator.class, value)); return true;
         case "basicpropertybinding":
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
         case "bcc": getOrCreateConfiguration(target).setBcc(property(camelContext, java.lang.String.class, value)); return true;
@@ -105,6 +106,7 @@ public class MailComponentConfigurer extends PropertyConfigurerSupport implement
         answer.put("additionalJavaMailProperties", java.util.Properties.class);
         answer.put("alternativeBodyHeader", java.lang.String.class);
         answer.put("attachmentsContentTransferEncodingResolver", org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver.class);
+        answer.put("authenticator", org.apache.camel.component.mail.MailAuthenticator.class);
         answer.put("basicPropertyBinding", boolean.class);
         answer.put("bcc", java.lang.String.class);
         answer.put("bridgeErrorHandler", boolean.class);
@@ -156,6 +158,7 @@ public class MailComponentConfigurer extends PropertyConfigurerSupport implement
         case "alternativeBodyHeader": return getOrCreateConfiguration(target).getAlternativeBodyHeader();
         case "attachmentscontenttransferencodingresolver":
         case "attachmentsContentTransferEncodingResolver": return getOrCreateConfiguration(target).getAttachmentsContentTransferEncodingResolver();
+        case "authenticator": return getOrCreateConfiguration(target).getAuthenticator();
         case "basicpropertybinding":
         case "basicPropertyBinding": return target.isBasicPropertyBinding();
         case "bcc": return getOrCreateConfiguration(target).getBcc();
diff --git a/components/camel-mail/src/generated/java/org/apache/camel/component/mail/MailEndpointConfigurer.java b/components/camel-mail/src/generated/java/org/apache/camel/component/mail/MailEndpointConfigurer.java
index 5c0ad5c..426ed22 100644
--- a/components/camel-mail/src/generated/java/org/apache/camel/component/mail/MailEndpointConfigurer.java
+++ b/components/camel-mail/src/generated/java/org/apache/camel/component/mail/MailEndpointConfigurer.java
@@ -25,6 +25,7 @@ public class MailEndpointConfigurer extends PropertyConfigurerSupport implements
         case "alternativeBodyHeader": target.getConfiguration().setAlternativeBodyHeader(property(camelContext, java.lang.String.class, value)); return true;
         case "attachmentscontenttransferencodingresolver":
         case "attachmentsContentTransferEncodingResolver": target.getConfiguration().setAttachmentsContentTransferEncodingResolver(property(camelContext, org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver.class, value)); return true;
+        case "authenticator": target.getConfiguration().setAuthenticator(property(camelContext, org.apache.camel.component.mail.MailAuthenticator.class, value)); return true;
         case "backofferrorthreshold":
         case "backoffErrorThreshold": target.setBackoffErrorThreshold(property(camelContext, int.class, value)); return true;
         case "backoffidlethreshold":
@@ -144,6 +145,7 @@ public class MailEndpointConfigurer extends PropertyConfigurerSupport implements
         answer.put("additionalJavaMailProperties", java.util.Properties.class);
         answer.put("alternativeBodyHeader", java.lang.String.class);
         answer.put("attachmentsContentTransferEncodingResolver", org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver.class);
+        answer.put("authenticator", org.apache.camel.component.mail.MailAuthenticator.class);
         answer.put("backoffErrorThreshold", int.class);
         answer.put("backoffIdleThreshold", int.class);
         answer.put("backoffMultiplier", int.class);
@@ -220,6 +222,7 @@ public class MailEndpointConfigurer extends PropertyConfigurerSupport implements
         case "alternativeBodyHeader": return target.getConfiguration().getAlternativeBodyHeader();
         case "attachmentscontenttransferencodingresolver":
         case "attachmentsContentTransferEncodingResolver": return target.getConfiguration().getAttachmentsContentTransferEncodingResolver();
+        case "authenticator": return target.getConfiguration().getAuthenticator();
         case "backofferrorthreshold":
         case "backoffErrorThreshold": return target.getBackoffErrorThreshold();
         case "backoffidlethreshold":
diff --git a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/imap.json b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/imap.json
index 5601451..71be81d 100644
--- a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/imap.json
+++ b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/imap.json
@@ -46,6 +46,7 @@
     "additionalJavaMailProperties": { "kind": "property", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overri [...]
     "alternativeBodyHeader": { "kind": "property", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative email [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "property", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom At [...]
+    "authenticator": { "kind": "property", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens wh [...]
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailConfiguration", "deprecated": false, "secret": false, "description": "Sets the Mail configuration" },
     "connectionTimeout": { "kind": "property", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -58,10 +59,10 @@
     "session": { "kind": "property", "displayName": "Session", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "javax.mail.Session", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the mail session that camel should use for all mail interactions. Useful in scenarios where mail sessions are created and managed by some  [...]
     "useInlineAttachments": { "kind": "property", "displayName": "Use Inline Attachments", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Whether to use disposition inline or attachment." },
     "headerFilterStrategy": { "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." },
-    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
     "useGlobalSslContextParameters": { "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Enable usage of global SSL context parameters." },
-    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" }
+    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." }
   },
   "properties": {
     "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" },
@@ -98,6 +99,7 @@
     "additionalJavaMailProperties": { "kind": "parameter", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overr [...]
     "alternativeBodyHeader": { "kind": "parameter", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative emai [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "parameter", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom A [...]
+    "authenticator": { "kind": "parameter", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens w [...]
     "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "binding": { "kind": "parameter", "displayName": "Binding", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailBinding", "deprecated": false, "secret": false, "description": "Sets the binding used to convert from a Camel message to and from a Mail message" },
     "connectionTimeout": { "kind": "parameter", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -128,9 +130,9 @@
     "startScheduler": { "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Whether the scheduler should be auto started." },
     "timeUnit": { "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." },
     "useFixedDelay": { "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." },
-    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
-    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" },
+    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." },
     "sortTerm": { "kind": "parameter", "displayName": "Sort Term", "group": "sort", "label": "consumer,sort", "required": false, "type": "object", "javaType": "com.sun.mail.imap.SortTerm[]", "deprecated": false, "secret": false, "description": "Sorting order for messages. Only natively supported for IMAP. Emulated to some degree when using POP3 or when IMAP server does not have the SORT capability." }
   }
 }
diff --git a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/imaps.json b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/imaps.json
index 6ab9317..06ff2db 100644
--- a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/imaps.json
+++ b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/imaps.json
@@ -46,6 +46,7 @@
     "additionalJavaMailProperties": { "kind": "property", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overri [...]
     "alternativeBodyHeader": { "kind": "property", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative email [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "property", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom At [...]
+    "authenticator": { "kind": "property", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens wh [...]
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailConfiguration", "deprecated": false, "secret": false, "description": "Sets the Mail configuration" },
     "connectionTimeout": { "kind": "property", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -58,10 +59,10 @@
     "session": { "kind": "property", "displayName": "Session", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "javax.mail.Session", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the mail session that camel should use for all mail interactions. Useful in scenarios where mail sessions are created and managed by some  [...]
     "useInlineAttachments": { "kind": "property", "displayName": "Use Inline Attachments", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Whether to use disposition inline or attachment." },
     "headerFilterStrategy": { "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." },
-    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
     "useGlobalSslContextParameters": { "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Enable usage of global SSL context parameters." },
-    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" }
+    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." }
   },
   "properties": {
     "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" },
@@ -98,6 +99,7 @@
     "additionalJavaMailProperties": { "kind": "parameter", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overr [...]
     "alternativeBodyHeader": { "kind": "parameter", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative emai [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "parameter", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom A [...]
+    "authenticator": { "kind": "parameter", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens w [...]
     "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "binding": { "kind": "parameter", "displayName": "Binding", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailBinding", "deprecated": false, "secret": false, "description": "Sets the binding used to convert from a Camel message to and from a Mail message" },
     "connectionTimeout": { "kind": "parameter", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -128,9 +130,9 @@
     "startScheduler": { "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Whether the scheduler should be auto started." },
     "timeUnit": { "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." },
     "useFixedDelay": { "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." },
-    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
-    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" },
+    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." },
     "sortTerm": { "kind": "parameter", "displayName": "Sort Term", "group": "sort", "label": "consumer,sort", "required": false, "type": "object", "javaType": "com.sun.mail.imap.SortTerm[]", "deprecated": false, "secret": false, "description": "Sorting order for messages. Only natively supported for IMAP. Emulated to some degree when using POP3 or when IMAP server does not have the SORT capability." }
   }
 }
diff --git a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/pop3.json b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/pop3.json
index 268d8bb..75b129c 100644
--- a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/pop3.json
+++ b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/pop3.json
@@ -46,6 +46,7 @@
     "additionalJavaMailProperties": { "kind": "property", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overri [...]
     "alternativeBodyHeader": { "kind": "property", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative email [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "property", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom At [...]
+    "authenticator": { "kind": "property", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens wh [...]
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailConfiguration", "deprecated": false, "secret": false, "description": "Sets the Mail configuration" },
     "connectionTimeout": { "kind": "property", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -58,10 +59,10 @@
     "session": { "kind": "property", "displayName": "Session", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "javax.mail.Session", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the mail session that camel should use for all mail interactions. Useful in scenarios where mail sessions are created and managed by some  [...]
     "useInlineAttachments": { "kind": "property", "displayName": "Use Inline Attachments", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Whether to use disposition inline or attachment." },
     "headerFilterStrategy": { "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." },
-    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
     "useGlobalSslContextParameters": { "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Enable usage of global SSL context parameters." },
-    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" }
+    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." }
   },
   "properties": {
     "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" },
@@ -98,6 +99,7 @@
     "additionalJavaMailProperties": { "kind": "parameter", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overr [...]
     "alternativeBodyHeader": { "kind": "parameter", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative emai [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "parameter", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom A [...]
+    "authenticator": { "kind": "parameter", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens w [...]
     "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "binding": { "kind": "parameter", "displayName": "Binding", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailBinding", "deprecated": false, "secret": false, "description": "Sets the binding used to convert from a Camel message to and from a Mail message" },
     "connectionTimeout": { "kind": "parameter", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -128,9 +130,9 @@
     "startScheduler": { "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Whether the scheduler should be auto started." },
     "timeUnit": { "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." },
     "useFixedDelay": { "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." },
-    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
-    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" },
+    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." },
     "sortTerm": { "kind": "parameter", "displayName": "Sort Term", "group": "sort", "label": "consumer,sort", "required": false, "type": "object", "javaType": "com.sun.mail.imap.SortTerm[]", "deprecated": false, "secret": false, "description": "Sorting order for messages. Only natively supported for IMAP. Emulated to some degree when using POP3 or when IMAP server does not have the SORT capability." }
   }
 }
diff --git a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/pop3s.json b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/pop3s.json
index 19d1011..31c5869 100644
--- a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/pop3s.json
+++ b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/pop3s.json
@@ -46,6 +46,7 @@
     "additionalJavaMailProperties": { "kind": "property", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overri [...]
     "alternativeBodyHeader": { "kind": "property", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative email [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "property", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom At [...]
+    "authenticator": { "kind": "property", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens wh [...]
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailConfiguration", "deprecated": false, "secret": false, "description": "Sets the Mail configuration" },
     "connectionTimeout": { "kind": "property", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -58,10 +59,10 @@
     "session": { "kind": "property", "displayName": "Session", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "javax.mail.Session", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the mail session that camel should use for all mail interactions. Useful in scenarios where mail sessions are created and managed by some  [...]
     "useInlineAttachments": { "kind": "property", "displayName": "Use Inline Attachments", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Whether to use disposition inline or attachment." },
     "headerFilterStrategy": { "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." },
-    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
     "useGlobalSslContextParameters": { "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Enable usage of global SSL context parameters." },
-    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" }
+    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." }
   },
   "properties": {
     "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" },
@@ -98,6 +99,7 @@
     "additionalJavaMailProperties": { "kind": "parameter", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overr [...]
     "alternativeBodyHeader": { "kind": "parameter", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative emai [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "parameter", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom A [...]
+    "authenticator": { "kind": "parameter", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens w [...]
     "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "binding": { "kind": "parameter", "displayName": "Binding", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailBinding", "deprecated": false, "secret": false, "description": "Sets the binding used to convert from a Camel message to and from a Mail message" },
     "connectionTimeout": { "kind": "parameter", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -128,9 +130,9 @@
     "startScheduler": { "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Whether the scheduler should be auto started." },
     "timeUnit": { "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." },
     "useFixedDelay": { "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." },
-    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
-    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" },
+    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." },
     "sortTerm": { "kind": "parameter", "displayName": "Sort Term", "group": "sort", "label": "consumer,sort", "required": false, "type": "object", "javaType": "com.sun.mail.imap.SortTerm[]", "deprecated": false, "secret": false, "description": "Sorting order for messages. Only natively supported for IMAP. Emulated to some degree when using POP3 or when IMAP server does not have the SORT capability." }
   }
 }
diff --git a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/smtp.json b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/smtp.json
index 201c3c4..9659dc5 100644
--- a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/smtp.json
+++ b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/smtp.json
@@ -46,6 +46,7 @@
     "additionalJavaMailProperties": { "kind": "property", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overri [...]
     "alternativeBodyHeader": { "kind": "property", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative email [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "property", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom At [...]
+    "authenticator": { "kind": "property", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens wh [...]
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailConfiguration", "deprecated": false, "secret": false, "description": "Sets the Mail configuration" },
     "connectionTimeout": { "kind": "property", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -58,10 +59,10 @@
     "session": { "kind": "property", "displayName": "Session", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "javax.mail.Session", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the mail session that camel should use for all mail interactions. Useful in scenarios where mail sessions are created and managed by some  [...]
     "useInlineAttachments": { "kind": "property", "displayName": "Use Inline Attachments", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Whether to use disposition inline or attachment." },
     "headerFilterStrategy": { "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." },
-    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
     "useGlobalSslContextParameters": { "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Enable usage of global SSL context parameters." },
-    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" }
+    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." }
   },
   "properties": {
     "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" },
@@ -98,6 +99,7 @@
     "additionalJavaMailProperties": { "kind": "parameter", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overr [...]
     "alternativeBodyHeader": { "kind": "parameter", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative emai [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "parameter", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom A [...]
+    "authenticator": { "kind": "parameter", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens w [...]
     "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "binding": { "kind": "parameter", "displayName": "Binding", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailBinding", "deprecated": false, "secret": false, "description": "Sets the binding used to convert from a Camel message to and from a Mail message" },
     "connectionTimeout": { "kind": "parameter", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -128,9 +130,9 @@
     "startScheduler": { "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Whether the scheduler should be auto started." },
     "timeUnit": { "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." },
     "useFixedDelay": { "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." },
-    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
-    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" },
+    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." },
     "sortTerm": { "kind": "parameter", "displayName": "Sort Term", "group": "sort", "label": "consumer,sort", "required": false, "type": "object", "javaType": "com.sun.mail.imap.SortTerm[]", "deprecated": false, "secret": false, "description": "Sorting order for messages. Only natively supported for IMAP. Emulated to some degree when using POP3 or when IMAP server does not have the SORT capability." }
   }
 }
diff --git a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/smtps.json b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/smtps.json
index d8fe80f..275767b 100644
--- a/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/smtps.json
+++ b/components/camel-mail/src/generated/resources/org/apache/camel/component/mail/smtps.json
@@ -46,6 +46,7 @@
     "additionalJavaMailProperties": { "kind": "property", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overri [...]
     "alternativeBodyHeader": { "kind": "property", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative email [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "property", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom At [...]
+    "authenticator": { "kind": "property", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens wh [...]
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailConfiguration", "deprecated": false, "secret": false, "description": "Sets the Mail configuration" },
     "connectionTimeout": { "kind": "property", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -58,10 +59,10 @@
     "session": { "kind": "property", "displayName": "Session", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "javax.mail.Session", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the mail session that camel should use for all mail interactions. Useful in scenarios where mail sessions are created and managed by some  [...]
     "useInlineAttachments": { "kind": "property", "displayName": "Use Inline Attachments", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Whether to use disposition inline or attachment." },
     "headerFilterStrategy": { "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." },
-    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
     "useGlobalSslContextParameters": { "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Enable usage of global SSL context parameters." },
-    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" }
+    "username": { "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." }
   },
   "properties": {
     "host": { "kind": "path", "displayName": "Host", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The mail server host name" },
@@ -98,6 +99,7 @@
     "additionalJavaMailProperties": { "kind": "parameter", "displayName": "Additional Java Mail Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Properties", "prefix": "mail.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Sets additional java mail properties, that will append\/overr [...]
     "alternativeBodyHeader": { "kind": "parameter", "displayName": "Alternative Body Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "CamelMailAlternativeBody", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "Specifies the key to an IN message header that contains an alternative emai [...]
     "attachmentsContentTransferEncodingResolver": { "kind": "parameter", "displayName": "Attachments Content Transfer Encoding Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To use a custom A [...]
+    "authenticator": { "kind": "parameter", "displayName": "Authenticator", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailAuthenticator", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The authenticator for login. If set then the password and username are ignored. Can be used for tokens w [...]
     "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "binding": { "kind": "parameter", "displayName": "Binding", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.mail.MailBinding", "deprecated": false, "secret": false, "description": "Sets the binding used to convert from a Camel message to and from a Mail message" },
     "connectionTimeout": { "kind": "parameter", "displayName": "Connection Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "30000", "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The connection timeout in milliseconds." },
@@ -128,9 +130,9 @@
     "startScheduler": { "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Whether the scheduler should be auto started." },
     "timeUnit": { "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." },
     "useFixedDelay": { "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." },
-    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login" },
+    "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The password for login. See also setAuthenticator(MailAuthenticator)." },
     "sslContextParameters": { "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters." },
-    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login" },
+    "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.mail.MailConfiguration", "configurationField": "configuration", "description": "The username for login. See also setAuthenticator(MailAuthenticator)." },
     "sortTerm": { "kind": "parameter", "displayName": "Sort Term", "group": "sort", "label": "consumer,sort", "required": false, "type": "object", "javaType": "com.sun.mail.imap.SortTerm[]", "deprecated": false, "secret": false, "description": "Sorting order for messages. Only natively supported for IMAP. Emulated to some degree when using POP3 or when IMAP server does not have the SORT capability." }
   }
 }
diff --git a/components/camel-mail/src/main/docs/mail-component.adoc b/components/camel-mail/src/main/docs/mail-component.adoc
index 5f5f96e..51049c2 100644
--- a/components/camel-mail/src/main/docs/mail-component.adoc
+++ b/components/camel-mail/src/main/docs/mail-component.adoc
@@ -93,7 +93,7 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The Mail component supports 41 options, which are listed below.
+The Mail component supports 42 options, which are listed below.
 
 
 
@@ -125,6 +125,7 @@ The Mail component supports 41 options, which are listed below.
 | *additionalJavaMailProperties* (advanced) | Sets additional java mail properties, that will append/override any default properties that is set based on all the other options. This is useful if you need to add some special options but want to keep the others as is. |  | Properties
 | *alternativeBodyHeader* (advanced) | Specifies the key to an IN message header that contains an alternative email body. For example, if you send emails in text/html format and want to provide an alternative mail body for non-HTML email clients, set the alternative mail body with this key as a header. | CamelMailAlternativeBody | String
 | *attachmentsContentTransfer EncodingResolver* (advanced) | To use a custom AttachmentsContentTransferEncodingResolver to resolve what content-type-encoding to use for attachments. |  | AttachmentsContentTransferEncodingResolver
+| *authenticator* (advanced) | The authenticator for login. If set then the password and username are ignored. Can be used for tokens which can expire and therefore must be read dynamically. |  | MailAuthenticator
 | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *configuration* (advanced) | Sets the Mail configuration |  | MailConfiguration
 | *connectionTimeout* (advanced) | The connection timeout in milliseconds. | 30000 | int
@@ -137,10 +138,10 @@ The Mail component supports 41 options, which are listed below.
 | *session* (advanced) | Specifies the mail session that camel should use for all mail interactions. Useful in scenarios where mail sessions are created and managed by some other resource, such as a JavaEE container. When using a custom mail session, then the hostname and port from the mail session will be used (if configured on the session). |  | Session
 | *useInlineAttachments* (advanced) | Whether to use disposition inline or attachment. | false | boolean
 | *headerFilterStrategy* (filter) | To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message. |  | HeaderFilterStrategy
-| *password* (security) | The password for login |  | String
+| *password* (security) | The password for login. See also setAuthenticator(MailAuthenticator). |  | String
 | *sslContextParameters* (security) | To configure security using SSLContextParameters. |  | SSLContextParameters
 | *useGlobalSslContextParameters* (security) | Enable usage of global SSL context parameters. | false | boolean
-| *username* (security) | The username for login |  | String
+| *username* (security) | The username for login. See also setAuthenticator(MailAuthenticator). |  | String
 |===
 // component options: END
 
@@ -169,7 +170,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (66 parameters):
+=== Query Parameters (67 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -207,6 +208,7 @@ with the following path and query parameters:
 | *additionalJavaMailProperties* (advanced) | Sets additional java mail properties, that will append/override any default properties that is set based on all the other options. This is useful if you need to add some special options but want to keep the others as is. |  | Properties
 | *alternativeBodyHeader* (advanced) | Specifies the key to an IN message header that contains an alternative email body. For example, if you send emails in text/html format and want to provide an alternative mail body for non-HTML email clients, set the alternative mail body with this key as a header. | CamelMailAlternativeBody | String
 | *attachmentsContentTransfer EncodingResolver* (advanced) | To use a custom AttachmentsContentTransferEncodingResolver to resolve what content-type-encoding to use for attachments. |  | AttachmentsContentTransferEncodingResolver
+| *authenticator* (advanced) | The authenticator for login. If set then the password and username are ignored. Can be used for tokens which can expire and therefore must be read dynamically. |  | MailAuthenticator
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *binding* (advanced) | Sets the binding used to convert from a Camel message to and from a Mail message |  | MailBinding
 | *connectionTimeout* (advanced) | The connection timeout in milliseconds. | 30000 | int
@@ -237,9 +239,9 @@ with the following path and query parameters:
 | *startScheduler* (scheduler) | Whether the scheduler should be auto started. | true | boolean
 | *timeUnit* (scheduler) | Time unit for initialDelay and delay options. The value can be one of: NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS | MILLISECONDS | TimeUnit
 | *useFixedDelay* (scheduler) | Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details. | true | boolean
-| *password* (security) | The password for login |  | String
+| *password* (security) | The password for login. See also setAuthenticator(MailAuthenticator). |  | String
 | *sslContextParameters* (security) | To configure security using SSLContextParameters. |  | SSLContextParameters
-| *username* (security) | The username for login |  | String
+| *username* (security) | The username for login. See also setAuthenticator(MailAuthenticator). |  | String
 | *sortTerm* (sort) | Sorting order for messages. Only natively supported for IMAP. Emulated to some degree when using POP3 or when IMAP server does not have the SORT capability. |  | SortTerm[]
 |===
 // endpoint options: END
diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultAuthenticator.java b/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultAuthenticator.java
index 140ba85..6df51ea 100644
--- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultAuthenticator.java
+++ b/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultAuthenticator.java
@@ -22,7 +22,7 @@ import javax.mail.PasswordAuthentication;
 /**
  * Mail {@link Authenticator} that supplies username and password
  */
-public class DefaultAuthenticator extends Authenticator {
+public class DefaultAuthenticator extends MailAuthenticator {
 
     private final String username;
     private final String password;
diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultJavaMailSender.java b/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultJavaMailSender.java
index fb05737..1e4533b 100644
--- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultJavaMailSender.java
+++ b/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultJavaMailSender.java
@@ -17,11 +17,11 @@
 package org.apache.camel.component.mail;
 
 import java.util.Date;
-import java.util.Map;
 import java.util.Properties;
 
 import javax.mail.MessagingException;
 import javax.mail.NoSuchProviderException;
+import javax.mail.PasswordAuthentication;
 import javax.mail.Session;
 import javax.mail.Transport;
 import javax.mail.internet.MimeMessage;
@@ -40,6 +40,7 @@ public class DefaultJavaMailSender implements JavaMailSender {
     private String host;
     private String username;
     private String password;
+    private MailAuthenticator authenticator;
     // -1 means using the default port to access the service
     private int port = -1;
     private String protocol;
@@ -85,7 +86,8 @@ public class DefaultJavaMailSender implements JavaMailSender {
     @Override
     public Session getSession() {
         if (session == null) {
-            session = Session.getInstance(getJavaMailProperties(), new DefaultAuthenticator(username, password));
+            session = Session.getInstance(getJavaMailProperties(),
+                    authenticator == null ? new DefaultAuthenticator(username, password) : authenticator);
         }
         return session;
     }
@@ -106,6 +108,15 @@ public class DefaultJavaMailSender implements JavaMailSender {
     }
 
     @Override
+    public MailAuthenticator getAuthenticator() {
+        return authenticator;
+    }
+
+    @Override
+    public void setAuthenticator(MailAuthenticator authenticator) {
+        this.authenticator = authenticator;
+    }
+
     public int getPort() {
         return port;
     }
@@ -125,11 +136,21 @@ public class DefaultJavaMailSender implements JavaMailSender {
         this.protocol = protocol;
     }
 
+    /**
+     * Returns the password authentication from the authenticator or from the
+     * parameters user and password.
+     */
+    public PasswordAuthentication getPasswordAuthentication() {
+        // call authenticator so that the authenticator can dynamically determine the password or token
+        return authenticator == null ? new PasswordAuthentication(username, password) : authenticator.getPasswordAuthentication();
+    }
+
     @Override
     public void send(MimeMessage mimeMessage) throws MessagingException {
         Transport transport = getTransport(getSession());
         LOG.debug("Connecting to {}:{}", host, port);
-        transport.connect(getHost(), getPort(), getUsername(), getPassword());
+        PasswordAuthentication passwordAuth = getPasswordAuthentication();
+        transport.connect(getHost(), getPort(), passwordAuth.getUserName(), passwordAuth.getPassword());
         try {
             if (mimeMessage.getSentDate() == null) {
                 mimeMessage.setSentDate(new Date());
diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/JavaMailSender.java b/components/camel-mail/src/main/java/org/apache/camel/component/mail/JavaMailSender.java
index ea9bc84..9d9dadb 100644
--- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/JavaMailSender.java
+++ b/components/camel-mail/src/main/java/org/apache/camel/component/mail/JavaMailSender.java
@@ -66,4 +66,8 @@ public interface JavaMailSender {
     void setSession(Session session);
 
     Session getSession();
+    
+    void setAuthenticator(MailAuthenticator authenticator);
+    
+    MailAuthenticator getAuthenticator();
 }
diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultAuthenticator.java b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailAuthenticator.java
similarity index 64%
copy from components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultAuthenticator.java
copy to components/camel-mail/src/main/java/org/apache/camel/component/mail/MailAuthenticator.java
index 140ba85..eaa9f8c 100644
--- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultAuthenticator.java
+++ b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailAuthenticator.java
@@ -16,28 +16,17 @@
  */
 package org.apache.camel.component.mail;
 
-import javax.mail.Authenticator;
 import javax.mail.PasswordAuthentication;
 
 /**
- * Mail {@link Authenticator} that supplies username and password
+ * Mail authenticator that supplies username and password
  */
-public class DefaultAuthenticator extends Authenticator {
+public class MailAuthenticator extends javax.mail.Authenticator {
 
-    private final String username;
-    private final String password;
-
-    public DefaultAuthenticator(String username, String password) {
-        this.password = password;
-        this.username = username;
-    }
-
-    /**
-     * Returns an authenticator object for use in sessions
-     */
-    @Override
+    // makes the method public
+    /** Override this method in your implementation. */
     public PasswordAuthentication getPasswordAuthentication() {
-        return new PasswordAuthentication(username, password);
+        return super.getPasswordAuthentication();
     }
 
 }
diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
index 8e9a334..2688c19 100644
--- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
+++ b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import java.util.Properties;
 
 import javax.mail.Message;
+import javax.mail.PasswordAuthentication;
 import javax.mail.Session;
 import javax.net.ssl.SSLContext;
 
@@ -118,6 +119,8 @@ public class MailConfiguration implements Cloneable {
     private AttachmentsContentTransferEncodingResolver attachmentsContentTransferEncodingResolver;
     @UriParam(label = "advanced")
     private Properties javaMailProperties;
+    @UriParam(label = "advanced")
+    private MailAuthenticator authenticator;
 
     public MailConfiguration() {
     }
@@ -200,6 +203,9 @@ public class MailConfiguration implements Cloneable {
         if (password != null) {
             answer.setPassword(password);
         }
+        if (authenticator != null) {
+            answer.setAuthenticator(authenticator);
+        }
         if (protocol != null) {
             answer.setProtocol(protocol);
         }
@@ -220,7 +226,8 @@ public class MailConfiguration implements Cloneable {
                     Thread.currentThread().setContextClassLoader(applicationClassLoader);
                 }
                 // use our authenticator that does no live user interaction but returns the already configured username and password
-                Session session = Session.getInstance(answer.getJavaMailProperties(), new DefaultAuthenticator(getUsername(), getPassword()));
+                Session session = Session.getInstance(answer.getJavaMailProperties(),
+                        authenticator == null ? new DefaultAuthenticator(getUsername(), getPassword()) : authenticator);
                 // sets the debug mode of the underlying mail framework
                 session.setDebug(debugMode);
                 answer.setSession(session);
@@ -239,9 +246,10 @@ public class MailConfiguration implements Cloneable {
         properties.put("mail." + protocol + ".timeout", connectionTimeout);
         properties.put("mail." + protocol + ".host", host);
         properties.put("mail." + protocol + ".port", "" + port);
-        if (username != null) {
-            properties.put("mail." + protocol + ".user", username);
-            properties.put("mail.user", username);
+        String pUserName = getPasswordAuthentication().getUserName();
+        if (pUserName != null) {
+            properties.put("mail." + protocol + ".user", pUserName);
+            properties.put("mail.user", pUserName);
             properties.put("mail." + protocol + ".auth", "true");
         } else {
             properties.put("mail." + protocol + ".auth", "false");
@@ -268,6 +276,15 @@ public class MailConfiguration implements Cloneable {
         return properties;
     }
 
+    /**
+     * Returns the password authentication from the authenticator or from the
+     * parameters user and password.
+     */
+    public PasswordAuthentication getPasswordAuthentication() {
+        // call authenticator so that the authenticator can dynamically determine the password or token
+        return authenticator == null ? new PasswordAuthentication(username, password) : authenticator.getPasswordAuthentication();
+    }
+
     private SSLContext createSSLContext() {
         try {
             return sslContextParameters.createSSLContext(null);
@@ -360,12 +377,25 @@ public class MailConfiguration implements Cloneable {
     }
 
     /**
-     * The password for login
+     * The password for login. See also {@link #setAuthenticator(MailAuthenticator)}.
      */
     public void setPassword(String password) {
         this.password = password;
     }
 
+    public MailAuthenticator getAuthenticator() {
+        return authenticator;
+    }
+
+    /**
+     * The authenticator for login. If set then the <code>password</code> and
+     * <code>username</code> are ignored. Can be used for tokens which can
+     * expire and therefore must be read dynamically.
+     */
+    public void setAuthenticator(MailAuthenticator authenticator) {
+        this.authenticator = authenticator;
+    }
+
     public String getSubject() {
         return subject;
     }
@@ -417,7 +447,7 @@ public class MailConfiguration implements Cloneable {
     }
 
     /**
-     * The username for login
+     * The username for login. See also {@link #setAuthenticator(MailAuthenticator)}.
      */
     public void setUsername(String username) {
         this.username = username;
diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
index 1945180..b3c4713 100644
--- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
+++ b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
@@ -29,6 +29,7 @@ import javax.mail.Folder;
 import javax.mail.FolderNotFoundException;
 import javax.mail.Message;
 import javax.mail.MessagingException;
+import javax.mail.PasswordAuthentication;
 import javax.mail.Store;
 import javax.mail.search.SearchTerm;
 
@@ -565,7 +566,8 @@ public class MailConsumer extends ScheduledBatchPollingConsumer {
                 LOG.debug("Connecting to MailStore: {}", getEndpoint().getConfiguration().getMailStoreLogInformation());
             }
             store = sender.getSession().getStore(config.getProtocol());
-            store.connect(config.getHost(), config.getPort(), config.getUsername(), config.getPassword());
+            PasswordAuthentication passwordAuth = config.getPasswordAuthentication();
+            store.connect(config.getHost(), config.getPort(), passwordAuth.getUserName(), passwordAuth.getPassword());
 
             serverCanSort = hasSortCapability(store);
         }
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/AuthenticatorTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/AuthenticatorTest.java
new file mode 100644
index 0000000..31dfbeb
--- /dev/null
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/AuthenticatorTest.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.mail;
+
+import java.util.Properties;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.PasswordAuthentication;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+import org.jvnet.mock_javamail.Mailbox;
+
+public class AuthenticatorTest extends CamelTestSupport {
+
+    /**
+     * Checks that the authenticator does dynamically return passwords for the
+     * smtp endpoint.
+     */
+    @Test
+    public void testSendAndReceiveMails() throws Exception {
+        Mailbox.clearAll();
+        // first expect correct result because smtp authenticator does not return wrong password       
+        callAndCheck("mock:result");
+        // second expect exception  because smtp authenticator does return wrong password       
+        callAndCheck("mock:exception");
+        // third expect correct result because smtp authenticator does not return wrong password       
+        callAndCheck("mock:result");
+    }
+
+    private String callAndCheck(String endpoint) throws MessagingException, InterruptedException {
+        MockEndpoint resultEndpoint = getMockEndpoint(endpoint);
+        resultEndpoint.expectedMinimumMessageCount(1);
+        //resultEndpoint.setResultWaitTime(60000);
+        String body = "hello world!";
+        execute("james3@localhost", body);
+
+        resultEndpoint.assertIsSatisfied();
+
+        Exchange exchange = resultEndpoint.getReceivedExchanges().get(0);
+        String text = exchange.getIn().getBody(String.class);
+        assertEquals("mail body", body, text);
+        return body;
+    }
+
+    private void execute(String mailAddress, String body) throws MessagingException, InterruptedException {
+
+        Properties properties = new Properties();
+        properties.put("mail.smtp.host", "localhost");
+        Session session = Session.getInstance(properties, null);
+
+        MimeMessage message = new MimeMessage(session);
+        populateMimeMessageBody(message, body);
+        message.setRecipients(Message.RecipientType.TO, mailAddress);
+
+        Transport.send(message);
+
+    }
+
+    protected void populateMimeMessageBody(MimeMessage message, String body) throws MessagingException {
+        MimeBodyPart plainPart = new MimeBodyPart();
+        plainPart.setText(body);
+
+        MimeBodyPart htmlPart = new MimeBodyPart();
+        htmlPart.setText("<html><body>" + body + "</body></html>");
+
+        Multipart alt = new MimeMultipart("alternative");
+        alt.addBodyPart(plainPart);
+        alt.addBodyPart(htmlPart);
+
+        Multipart mixed = new MimeMultipart("mixed");
+        MimeBodyPart wrap = new MimeBodyPart();
+        wrap.setContent(alt);
+        mixed.addBodyPart(wrap);
+
+        mixed.addBodyPart(plainPart);
+        mixed.addBodyPart(htmlPart);
+
+        mixed.addBodyPart(plainPart);
+        mixed.addBodyPart(htmlPart);
+
+        message.setContent(mixed);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+
+            public void configure() {
+                getContext().getRegistry().bind("authPop3", new MyAuthenticator("pop3"));
+                getContext().getRegistry().bind("authSmtp", new MyAuthenticator("smtp"));
+                getContext().getRegistry().bind("authImap", new MyAuthenticator("imap"));
+
+                onException(MessagingException.class).handled(true).to("mock:exception");
+
+                from("pop3://localhost?initialDelay=100&delay=100&authenticator=#authPop3").removeHeader("to")
+                        .to("smtp://localhost?authenticator=#authSmtp&to=james4@localhost");
+                from("imap://localhost?initialDelay=200&delay=100&authenticator=#authImap").convertBodyTo(String.class).to("mock:result");
+            }
+        };
+    }
+
+    public static class MyAuthenticator extends MailAuthenticator {
+        private final String protocol;
+        private int counter;
+
+        public MyAuthenticator(String protocol) {
+            this.protocol = protocol;
+        }
+
+        @Override
+        public PasswordAuthentication getPasswordAuthentication() {
+            if ("pop3".equals(protocol)) {
+                return new PasswordAuthentication("james3", "secret");
+            } else if ("smtp".equals(protocol)) {
+                if (counter < 2) {
+                    // in the processing of a mail message the mail consumer calls this method twice
+                    counter++;
+                    return new PasswordAuthentication("james4", "secret");
+                } else if (counter < 4) {
+                    // return in the second call the wrongPassword which will throw an MessagingException, see MyMockTransport
+                    counter++;
+                    return new PasswordAuthentication("james4", "wrongPassword");
+                } else {
+                    return new PasswordAuthentication("james4", "secret");
+                }
+            } else if ("imap".equals(protocol)) {
+                return new PasswordAuthentication("james4", "secret");
+            } else {
+                throw new IllegalStateException("not supported protocol " + protocol);
+            }
+
+        }
+    }
+}
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailComponentTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailComponentTest.java
index 13b244a..b4c2663 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailComponentTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailComponentTest.java
@@ -222,6 +222,29 @@ public class MailComponentTest extends CamelTestSupport {
     }
 
     @Test
+    public void testAuthenticator() {
+        DefaultAuthenticator auth1 = new DefaultAuthenticator("u1", "p1");
+        context.getRegistry().bind("auth1", auth1);
+        MailEndpoint endpoint = resolveMandatoryEndpoint("smtp://myhost:25/?authenticator=#auth1&to=james%40myhost");
+        MailConfiguration config = endpoint.getConfiguration();
+        assertEquals("getProtocol()", "smtp", config.getProtocol());
+        assertEquals("getHost()", "myhost", config.getHost());
+        assertEquals("getPort()", 25, config.getPort());
+        assertEquals("getUsername()", null, config.getUsername());
+        assertNotNull("getPasswordAuthentication()", config.getPasswordAuthentication());
+        assertEquals("getPasswordAuthentication().getUserName()", "u1", config.getPasswordAuthentication().getUserName());
+        assertEquals("getPasswordAuthentication().getUserName()", "p1", config.getPasswordAuthentication().getPassword());
+        assertEquals("getRecipients().get(Message.RecipientType.TO)", "james@myhost", config.getRecipients().get(Message.RecipientType.TO));
+        assertEquals("folder", "INBOX", config.getFolderName());
+        assertEquals("from", "camel@localhost", config.getFrom());
+        assertEquals("password", null, config.getPassword());
+        assertEquals(false, config.isDelete());
+        assertEquals(false, config.isIgnoreUriScheme());
+        assertEquals("fetchSize", -1, config.getFetchSize());
+        assertEquals(false, config.isDebugMode());
+    }
+
+    @Test
     public void testMailEndpointsWithFetchSize() throws Exception {
         MailEndpoint endpoint = resolveMandatoryEndpoint("pop3://james@myhost?fetchSize=5");
         MailConfiguration config = endpoint.getConfiguration();
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailConsumerAuthenticatorTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailConsumerAuthenticatorTest.java
new file mode 100644
index 0000000..9ddc616
--- /dev/null
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailConsumerAuthenticatorTest.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.mail;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import javax.mail.MessagingException;
+import javax.mail.PasswordAuthentication;
+import javax.mail.Session;
+
+import org.apache.camel.Processor;
+
+/** Test the dynamic behavior of the MailAuthenticator in the MailConsumer. */
+public class MailConsumerAuthenticatorTest {
+
+    @Test
+    public void dynamicPasswordPop3() throws Exception {
+
+        execute("pop3");
+    }
+
+    @Test
+    public void dynamicPasswordImap() throws Exception {
+
+        execute("imap");
+    }
+
+    private void execute(String protocol) throws Exception, IOException {
+        MailAuthenticator authenticator = new MyAuthenticator();
+
+        JavaMailSender sender = Mockito.mock(JavaMailSender.class);
+        Processor processor = Mockito.mock(Processor.class);
+
+        MailEndpoint endpoint = new MailEndpoint();
+        MailConfiguration configuration = new MailConfiguration();
+        configuration.setAuthenticator(authenticator);
+        configuration.configureProtocol(protocol);
+        configuration.setFolderName("INBOX");
+
+        endpoint.setConfiguration(configuration);
+
+        Properties props = new Properties();
+        props.put("mail.store.protocol", protocol);
+        Session session = Session.getDefaultInstance(props, authenticator);
+
+        when(sender.getSession()).thenReturn(session);
+
+        MailConsumer consumer = new MailConsumer(endpoint, processor, sender);
+        try {
+            boolean exception = false;
+            try {
+                consumer.poll();
+            } catch (MessagingException e) {
+                // we expect that an Exception occurs with the worngPassword, see MyMockStore
+                assertEquals("unauthorized", e.getMessage());
+                exception = true;
+            }
+            assertTrue("MessagingException expected with message 'unauthorized'", exception);
+
+            // poll a second time, this time there should be no exception, because we now provide the correct password
+            consumer.poll();
+        } finally {
+            consumer.close();
+        }
+    }
+
+    public static class MyAuthenticator extends MailAuthenticator {
+
+        private int counter = 0;
+
+        public PasswordAuthentication getPasswordAuthentication() {
+            if (counter == 0) {
+                counter++;
+                // the first time return a wrong password
+                return new PasswordAuthentication("user1", "wrongPassword");
+            }
+            //otherwise return the correct password, to simulate dynamic behavior
+            return new PasswordAuthentication("user1", "correctPassword");
+        }
+
+    }
+
+}
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCustomMailSenderTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCustomMailSenderTest.java
index eed26e0..e7d2a53 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCustomMailSenderTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCustomMailSenderTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.mail;
 
-import java.util.Map;
 import java.util.Properties;
 
 import javax.mail.MessagingException;
@@ -114,6 +113,15 @@ public class MailCustomMailSenderTest extends CamelTestSupport {
         public Session getSession() {
             return null;
         }
+
+        @Override
+        public void setAuthenticator(MailAuthenticator authenticator) {
+        }
+
+        @Override
+        public MailAuthenticator getAuthenticator() {
+            return null;
+        }
     }
 
 }
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyMockStore.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyMockStore.java
index 436d9fa..ae9453a 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyMockStore.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyMockStore.java
@@ -39,6 +39,9 @@ public class MyMockStore extends MockStore {
 
     @Override
     protected boolean protocolConnect(String host, int port, String user, String password) throws MessagingException {
+        if ("wrongPassword".equals(password)) {
+            throw new MessagingException("unauthorized");
+        }
         address = user + '@' + host;
         return super.protocolConnect(host, port, user, password);
     }
diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultAuthenticator.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyMockTransport.java
similarity index 55%
copy from components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultAuthenticator.java
copy to components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyMockTransport.java
index 140ba85..0286c0f 100644
--- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/DefaultAuthenticator.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyMockTransport.java
@@ -14,30 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.mail;
+package org.apache.camel.component.mail.mock;
 
-import javax.mail.Authenticator;
-import javax.mail.PasswordAuthentication;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.URLName;
 
-/**
- * Mail {@link Authenticator} that supplies username and password
- */
-public class DefaultAuthenticator extends Authenticator {
+import org.jvnet.mock_javamail.MockTransport;
 
-    private final String username;
-    private final String password;
+public class MyMockTransport extends MockTransport {
 
-    public DefaultAuthenticator(String username, String password) {
-        this.password = password;
-        this.username = username;
+    public MyMockTransport(Session session, URLName urlname) {
+        super(session, urlname);
     }
 
-    /**
-     * Returns an authenticator object for use in sessions
-     */
-    @Override
-    public PasswordAuthentication getPasswordAuthentication() {
-        return new PasswordAuthentication(username, password);
+    public void connect(String host, int port, String user, String password) throws MessagingException {
+        if ("wrongPassword".equals(password)) {
+            throw new MessagingException("unauthorized");
+        }
+        super.connect(host, port, user, password);
     }
 
 }
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyMockStore.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyPop3Store.java
similarity index 57%
copy from components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyMockStore.java
copy to components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyPop3Store.java
index 436d9fa..6800b64 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyMockStore.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/mock/MyPop3Store.java
@@ -16,47 +16,24 @@
  */
 package org.apache.camel.component.mail.mock;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.mail.Folder;
 import javax.mail.MessagingException;
 import javax.mail.Session;
 import javax.mail.URLName;
 
-import org.jvnet.mock_javamail.Aliases;
-import org.jvnet.mock_javamail.Mailbox;
 import org.jvnet.mock_javamail.MockStore;
 
-public class MyMockStore extends MockStore {
-
-    private Map<String, Folder> folders = new HashMap<>();
-    private String address;
+public class MyPop3Store extends MockStore {
 
-    public MyMockStore(Session session, URLName urlname) {
+    public MyPop3Store(Session session, URLName urlname) {
         super(session, urlname);
     }
 
     @Override
     protected boolean protocolConnect(String host, int port, String user, String password) throws MessagingException {
-        address = user + '@' + host;
+        if ("wrongPassword".equals(password)) {
+            throw new MessagingException("unauthorized");
+        }
         return super.protocolConnect(host, port, user, password);
     }
 
-    @Override
-    public Folder getFolder(String name) throws MessagingException {
-        if ("INBOX".equals(name)) {
-            return super.getFolder(name);
-        }
-
-        Folder folder = folders.get(name);
-        if (folder == null) {
-            // need a new mailbox as its a sub folder
-            String adr = name + "-" + address;
-            Mailbox mailbox = Mailbox.get(Aliases.getInstance().resolve(adr));
-            folder = new MyMockFolder(this, mailbox, name);
-            folders.put(name, folder);
-        }
-        return folder;
-    }
 }
diff --git a/components/camel-mail/src/test/resources/META-INF/javamail.providers b/components/camel-mail/src/test/resources/META-INF/javamail.providers
index cbf1a54..b8b6948 100644
--- a/components/camel-mail/src/test/resources/META-INF/javamail.providers
+++ b/components/camel-mail/src/test/resources/META-INF/javamail.providers
@@ -1,5 +1,5 @@
 # See http://java.sun.com/products/javamail/javadocs/javax/mail/Session.html
 
-protocol=smtp; type=transport; class=org.jvnet.mock_javamail.MockTransport; vendor=java.net mock-javamail project;
-protocol=pop3; type=store; class=org.jvnet.mock_javamail.MockStore; vendor=java.net mock-javamail project;
+protocol=smtp; type=transport; class=org.apache.camel.component.mail.mock.MyMockTransport; vendor=java.net mock-javamail project;
+protocol=pop3; type=store; class=org.apache.camel.component.mail.mock.MyPop3Store; vendor=java.net mock-javamail project;
 protocol=imap; type=store; class=org.apache.camel.component.mail.mock.MyMockStore; vendor=java.net mock-javamail project;
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapComponentBuilderFactory.java
index 25e369b..f725d25 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapComponentBuilderFactory.java
@@ -412,6 +412,21 @@ public interface ImapComponentBuilderFactory {
             return this;
         }
         /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default ImapComponentBuilder authenticator(
+                org.apache.camel.component.mail.MailAuthenticator authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
          * Whether the component should use basic property binding (Camel 2.x)
          * or the newer property binding with additional capabilities.
          * 
@@ -576,7 +591,7 @@ public interface ImapComponentBuilderFactory {
             return this;
         }
         /**
-         * The password for login.
+         * The password for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -613,7 +628,7 @@ public interface ImapComponentBuilderFactory {
             return this;
         }
         /**
-         * The username for login.
+         * The username for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -672,6 +687,7 @@ public interface ImapComponentBuilderFactory {
             case "additionalJavaMailProperties": getOrCreateConfiguration((MailComponent) component).setAdditionalJavaMailProperties((java.util.Properties) value); return true;
             case "alternativeBodyHeader": getOrCreateConfiguration((MailComponent) component).setAlternativeBodyHeader((java.lang.String) value); return true;
             case "attachmentsContentTransferEncodingResolver": getOrCreateConfiguration((MailComponent) component).setAttachmentsContentTransferEncodingResolver((org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver) value); return true;
+            case "authenticator": getOrCreateConfiguration((MailComponent) component).setAuthenticator((org.apache.camel.component.mail.MailAuthenticator) value); return true;
             case "basicPropertyBinding": ((MailComponent) component).setBasicPropertyBinding((boolean) value); return true;
             case "configuration": ((MailComponent) component).setConfiguration((org.apache.camel.component.mail.MailConfiguration) value); return true;
             case "connectionTimeout": getOrCreateConfiguration((MailComponent) component).setConnectionTimeout((int) value); return true;
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapsComponentBuilderFactory.java
index eb9f675..7d4221a 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapsComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ImapsComponentBuilderFactory.java
@@ -415,6 +415,21 @@ public interface ImapsComponentBuilderFactory {
             return this;
         }
         /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default ImapsComponentBuilder authenticator(
+                org.apache.camel.component.mail.MailAuthenticator authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
          * Whether the component should use basic property binding (Camel 2.x)
          * or the newer property binding with additional capabilities.
          * 
@@ -579,7 +594,7 @@ public interface ImapsComponentBuilderFactory {
             return this;
         }
         /**
-         * The password for login.
+         * The password for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -616,7 +631,7 @@ public interface ImapsComponentBuilderFactory {
             return this;
         }
         /**
-         * The username for login.
+         * The username for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -675,6 +690,7 @@ public interface ImapsComponentBuilderFactory {
             case "additionalJavaMailProperties": getOrCreateConfiguration((MailComponent) component).setAdditionalJavaMailProperties((java.util.Properties) value); return true;
             case "alternativeBodyHeader": getOrCreateConfiguration((MailComponent) component).setAlternativeBodyHeader((java.lang.String) value); return true;
             case "attachmentsContentTransferEncodingResolver": getOrCreateConfiguration((MailComponent) component).setAttachmentsContentTransferEncodingResolver((org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver) value); return true;
+            case "authenticator": getOrCreateConfiguration((MailComponent) component).setAuthenticator((org.apache.camel.component.mail.MailAuthenticator) value); return true;
             case "basicPropertyBinding": ((MailComponent) component).setBasicPropertyBinding((boolean) value); return true;
             case "configuration": ((MailComponent) component).setConfiguration((org.apache.camel.component.mail.MailConfiguration) value); return true;
             case "connectionTimeout": getOrCreateConfiguration((MailComponent) component).setConnectionTimeout((int) value); return true;
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3ComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3ComponentBuilderFactory.java
index 70ff956..13fdd3c 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3ComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3ComponentBuilderFactory.java
@@ -412,6 +412,21 @@ public interface Pop3ComponentBuilderFactory {
             return this;
         }
         /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default Pop3ComponentBuilder authenticator(
+                org.apache.camel.component.mail.MailAuthenticator authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
          * Whether the component should use basic property binding (Camel 2.x)
          * or the newer property binding with additional capabilities.
          * 
@@ -576,7 +591,7 @@ public interface Pop3ComponentBuilderFactory {
             return this;
         }
         /**
-         * The password for login.
+         * The password for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -613,7 +628,7 @@ public interface Pop3ComponentBuilderFactory {
             return this;
         }
         /**
-         * The username for login.
+         * The username for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -672,6 +687,7 @@ public interface Pop3ComponentBuilderFactory {
             case "additionalJavaMailProperties": getOrCreateConfiguration((MailComponent) component).setAdditionalJavaMailProperties((java.util.Properties) value); return true;
             case "alternativeBodyHeader": getOrCreateConfiguration((MailComponent) component).setAlternativeBodyHeader((java.lang.String) value); return true;
             case "attachmentsContentTransferEncodingResolver": getOrCreateConfiguration((MailComponent) component).setAttachmentsContentTransferEncodingResolver((org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver) value); return true;
+            case "authenticator": getOrCreateConfiguration((MailComponent) component).setAuthenticator((org.apache.camel.component.mail.MailAuthenticator) value); return true;
             case "basicPropertyBinding": ((MailComponent) component).setBasicPropertyBinding((boolean) value); return true;
             case "configuration": ((MailComponent) component).setConfiguration((org.apache.camel.component.mail.MailConfiguration) value); return true;
             case "connectionTimeout": getOrCreateConfiguration((MailComponent) component).setConnectionTimeout((int) value); return true;
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3sComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3sComponentBuilderFactory.java
index 8856028..ff436f3 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3sComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Pop3sComponentBuilderFactory.java
@@ -415,6 +415,21 @@ public interface Pop3sComponentBuilderFactory {
             return this;
         }
         /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default Pop3sComponentBuilder authenticator(
+                org.apache.camel.component.mail.MailAuthenticator authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
          * Whether the component should use basic property binding (Camel 2.x)
          * or the newer property binding with additional capabilities.
          * 
@@ -579,7 +594,7 @@ public interface Pop3sComponentBuilderFactory {
             return this;
         }
         /**
-         * The password for login.
+         * The password for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -616,7 +631,7 @@ public interface Pop3sComponentBuilderFactory {
             return this;
         }
         /**
-         * The username for login.
+         * The username for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -675,6 +690,7 @@ public interface Pop3sComponentBuilderFactory {
             case "additionalJavaMailProperties": getOrCreateConfiguration((MailComponent) component).setAdditionalJavaMailProperties((java.util.Properties) value); return true;
             case "alternativeBodyHeader": getOrCreateConfiguration((MailComponent) component).setAlternativeBodyHeader((java.lang.String) value); return true;
             case "attachmentsContentTransferEncodingResolver": getOrCreateConfiguration((MailComponent) component).setAttachmentsContentTransferEncodingResolver((org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver) value); return true;
+            case "authenticator": getOrCreateConfiguration((MailComponent) component).setAuthenticator((org.apache.camel.component.mail.MailAuthenticator) value); return true;
             case "basicPropertyBinding": ((MailComponent) component).setBasicPropertyBinding((boolean) value); return true;
             case "configuration": ((MailComponent) component).setConfiguration((org.apache.camel.component.mail.MailConfiguration) value); return true;
             case "connectionTimeout": getOrCreateConfiguration((MailComponent) component).setConnectionTimeout((int) value); return true;
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpComponentBuilderFactory.java
index 1f5a0b9..6a3bef1 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpComponentBuilderFactory.java
@@ -412,6 +412,21 @@ public interface SmtpComponentBuilderFactory {
             return this;
         }
         /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default SmtpComponentBuilder authenticator(
+                org.apache.camel.component.mail.MailAuthenticator authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
          * Whether the component should use basic property binding (Camel 2.x)
          * or the newer property binding with additional capabilities.
          * 
@@ -576,7 +591,7 @@ public interface SmtpComponentBuilderFactory {
             return this;
         }
         /**
-         * The password for login.
+         * The password for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -613,7 +628,7 @@ public interface SmtpComponentBuilderFactory {
             return this;
         }
         /**
-         * The username for login.
+         * The username for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -672,6 +687,7 @@ public interface SmtpComponentBuilderFactory {
             case "additionalJavaMailProperties": getOrCreateConfiguration((MailComponent) component).setAdditionalJavaMailProperties((java.util.Properties) value); return true;
             case "alternativeBodyHeader": getOrCreateConfiguration((MailComponent) component).setAlternativeBodyHeader((java.lang.String) value); return true;
             case "attachmentsContentTransferEncodingResolver": getOrCreateConfiguration((MailComponent) component).setAttachmentsContentTransferEncodingResolver((org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver) value); return true;
+            case "authenticator": getOrCreateConfiguration((MailComponent) component).setAuthenticator((org.apache.camel.component.mail.MailAuthenticator) value); return true;
             case "basicPropertyBinding": ((MailComponent) component).setBasicPropertyBinding((boolean) value); return true;
             case "configuration": ((MailComponent) component).setConfiguration((org.apache.camel.component.mail.MailConfiguration) value); return true;
             case "connectionTimeout": getOrCreateConfiguration((MailComponent) component).setConnectionTimeout((int) value); return true;
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpsComponentBuilderFactory.java
index 82db0a3..ef6c63e 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpsComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmtpsComponentBuilderFactory.java
@@ -415,6 +415,21 @@ public interface SmtpsComponentBuilderFactory {
             return this;
         }
         /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default SmtpsComponentBuilder authenticator(
+                org.apache.camel.component.mail.MailAuthenticator authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
          * Whether the component should use basic property binding (Camel 2.x)
          * or the newer property binding with additional capabilities.
          * 
@@ -579,7 +594,7 @@ public interface SmtpsComponentBuilderFactory {
             return this;
         }
         /**
-         * The password for login.
+         * The password for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -616,7 +631,7 @@ public interface SmtpsComponentBuilderFactory {
             return this;
         }
         /**
-         * The username for login.
+         * The username for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -675,6 +690,7 @@ public interface SmtpsComponentBuilderFactory {
             case "additionalJavaMailProperties": getOrCreateConfiguration((MailComponent) component).setAdditionalJavaMailProperties((java.util.Properties) value); return true;
             case "alternativeBodyHeader": getOrCreateConfiguration((MailComponent) component).setAlternativeBodyHeader((java.lang.String) value); return true;
             case "attachmentsContentTransferEncodingResolver": getOrCreateConfiguration((MailComponent) component).setAttachmentsContentTransferEncodingResolver((org.apache.camel.component.mail.AttachmentsContentTransferEncodingResolver) value); return true;
+            case "authenticator": getOrCreateConfiguration((MailComponent) component).setAuthenticator((org.apache.camel.component.mail.MailAuthenticator) value); return true;
             case "basicPropertyBinding": ((MailComponent) component).setBasicPropertyBinding((boolean) value); return true;
             case "configuration": ((MailComponent) component).setConfiguration((org.apache.camel.component.mail.MailConfiguration) value); return true;
             case "connectionTimeout": getOrCreateConfiguration((MailComponent) component).setConnectionTimeout((int) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MailEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MailEndpointBuilderFactory.java
index 925657d..6aa1143 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MailEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MailEndpointBuilderFactory.java
@@ -880,7 +880,7 @@ public interface MailEndpointBuilderFactory {
             return this;
         }
         /**
-         * The password for login.
+         * The password for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -917,7 +917,7 @@ public interface MailEndpointBuilderFactory {
             return this;
         }
         /**
-         * The username for login.
+         * The username for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -1275,6 +1275,36 @@ public interface MailEndpointBuilderFactory {
             return this;
         }
         /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedMailEndpointConsumerBuilder authenticator(
+                Object authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option will be converted to a
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedMailEndpointConsumerBuilder authenticator(
+                String authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
          * Whether the endpoint should use basic property binding (Camel 2.x) or
          * the newer property binding with additional capabilities.
          * 
@@ -1751,7 +1781,7 @@ public interface MailEndpointBuilderFactory {
             return this;
         }
         /**
-         * The password for login.
+         * The password for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -1788,7 +1818,7 @@ public interface MailEndpointBuilderFactory {
             return this;
         }
         /**
-         * The username for login.
+         * The username for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -1914,6 +1944,36 @@ public interface MailEndpointBuilderFactory {
             return this;
         }
         /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedMailEndpointProducerBuilder authenticator(
+                Object authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option will be converted to a
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedMailEndpointProducerBuilder authenticator(
+                String authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
          * Whether the endpoint should use basic property binding (Camel 2.x) or
          * the newer property binding with additional capabilities.
          * 
@@ -2277,7 +2337,7 @@ public interface MailEndpointBuilderFactory {
             return (AdvancedMailEndpointBuilder) this;
         }
         /**
-         * The password for login.
+         * The password for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -2314,7 +2374,7 @@ public interface MailEndpointBuilderFactory {
             return this;
         }
         /**
-         * The username for login.
+         * The username for login. See also setAuthenticator(MailAuthenticator).
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -2413,6 +2473,34 @@ public interface MailEndpointBuilderFactory {
             return this;
         }
         /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedMailEndpointBuilder authenticator(Object authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
+         * The authenticator for login. If set then the password and username
+         * are ignored. Can be used for tokens which can expire and therefore
+         * must be read dynamically.
+         * 
+         * The option will be converted to a
+         * <code>org.apache.camel.component.mail.MailAuthenticator</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedMailEndpointBuilder authenticator(String authenticator) {
+            doSetProperty("authenticator", authenticator);
+            return this;
+        }
+        /**
          * Whether the endpoint should use basic property binding (Camel 2.x) or
          * the newer property binding with additional capabilities.
          *