This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit 86573375f5c3834caefb5a15991e236ed807be8a Author: Kevin Morin <morin@codelutin.com> Date: Thu Aug 3 11:22:06 2017 +0200 fixes #9321 passage à struts 2.3.33 qui valide correctement les adresses mail --- .../faxtomail/services/FaxToMailServiceUtils.java | 6 +++ .../validators/FaxToMailEmailValidator.java | 42 ------------------- .../validators/FaxToMailEmailsValidator.java | 47 ---------------------- .../src/main/resources/validators.xml | 4 +- pom.xml | 2 +- 5 files changed, 9 insertions(+), 92 deletions(-) diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceUtils.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceUtils.java index 99641b16..f4716353 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceUtils.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceUtils.java @@ -179,6 +179,12 @@ public class FaxToMailServiceUtils { public static String getTextFromMessage(MimeMessage message) throws IOException, MessagingException { // convertit le contenu texte en PDF String text; + + // a tester : +// ByteArrayOutputStream os = new ByteArrayOutputStream(); +// message.writeTo(os); +// text = os.toString(); + try { text = (String) message.getContent(); diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/validators/FaxToMailEmailValidator.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/validators/FaxToMailEmailValidator.java deleted file mode 100644 index 79fd5dff..00000000 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/validators/FaxToMailEmailValidator.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.franciaflex.faxtomail.services.validators; - -/* - * #%L - * FaxToMail :: Service - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2014 Mac-Groupe, Code Lutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import com.opensymphony.xwork2.validator.validators.EmailValidator; - -/** - * Surcharge du validateur d'email par default de struts pour autoriser en plus le domaine ".fax". - */ -public class FaxToMailEmailValidator extends EmailValidator { - - // see XW-371 - public static final String EMAIL_ADDRESS_PATTERN = - "\\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx|fax)$\\b"; - - public FaxToMailEmailValidator() { - setRegex(EMAIL_ADDRESS_PATTERN); - } - -} diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/validators/FaxToMailEmailsValidator.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/validators/FaxToMailEmailsValidator.java deleted file mode 100644 index 0c9d81c5..00000000 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/validators/FaxToMailEmailsValidator.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.franciaflex.faxtomail.services.validators; - -/* - * #%L - * FaxToMail :: Service - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2014 Mac-Groupe, Code Lutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import com.opensymphony.xwork2.validator.validators.EmailValidator; - -/** - * Surcharge du validateur d'email par default de struts pour autoriser en plus le domaine ".fax". - * Possibilité d'avoir plusieurs emails séparés par des points-virgule - */ -public class FaxToMailEmailsValidator extends EmailValidator { - - // see XW-371 - public static final String EMAIL_ADDRESSES_PATTERN = - "\\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*" + - "@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx|fax)" + - "(\\s*;\\s*['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*" + - "@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx|fax))*" + - "$\\b"; - - public FaxToMailEmailsValidator() { - setRegex(EMAIL_ADDRESSES_PATTERN); - } - -} diff --git a/faxtomail-service/src/main/resources/validators.xml b/faxtomail-service/src/main/resources/validators.xml index 81b8154b..742d5d09 100644 --- a/faxtomail-service/src/main/resources/validators.xml +++ b/faxtomail-service/src/main/resources/validators.xml @@ -47,6 +47,6 @@ <validator name="existingFile" class="org.nuiton.validator.xwork2.field.ExistingFileFieldValidator"/> <!-- les validateur specifiques --> - <validator name="email" class="com.franciaflex.faxtomail.services.validators.FaxToMailEmailValidator"/> - <validator name="emails" class="com.franciaflex.faxtomail.services.validators.FaxToMailEmailsValidator"/> + <validator name="email" class="com.opensymphony.xwork2.validator.validators.EmailValidator"/> + <validator name="emails" class="com.opensymphony.xwork2.validator.validators.EmailValidator"/> </validators> diff --git a/pom.xml b/pom.xml index 3b6bf687..f91876a4 100644 --- a/pom.xml +++ b/pom.xml @@ -113,7 +113,7 @@ <!-- do not upgrade to 1.6.5-1 --> <swingXVersion>1.6.4</swingXVersion> <xworkVersion>2.3.16.3</xworkVersion> - <struts2Version>2.3.32</struts2Version> + <struts2Version>2.3.33</struts2Version> <jqueryPluginVersion>3.7.1</jqueryPluginVersion> <bootstrapPluginVersion>2.0.0</bootstrapPluginVersion> <slf4jVersion>1.7.7</slf4jVersion> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.