cancel
Showing results for 
Search instead for 
Did you mean: 

Email outbound

y_j2ee
Champ in-the-making
Champ in-the-making
HI I want to know if there is a possibility to use email address like  myname@localhost without .com
or .fr because in alfresco I get an error "The email address is incorrectely formatted "
8 REPLIES 8

sselvan
Champ in-the-making
Champ in-the-making
There has to be a .com or .edu or similar to that.
Btw, why would you want to have without the .com?

y_j2ee
Champ in-the-making
Champ in-the-making
Firstly thank you for your reply, the problem  is that we have a domaine : domaine.nameofentreprise so the intranet  addresses are nameofemployees@domaine.nameofentreprise, and  when i define a rules for trying sending email with ALfresco, we have this message "the adresse email is incorrectly formatted" there is a possibility to skip the validation of adresse email or other solution.
i will be gratful if someone can give me help!!!!!

sselvan
Champ in-the-making
Champ in-the-making
    /**
     * Return true if address has valid format
     * @param address
     * @return
     */
    private boolean validateAddress(String address)
    {
        boolean result = false;
       
        EmailValidator emailValidator = EmailValidator.getInstance();
        if (emailValidator.isValid(address))
        {
            result = true;
        }
        else
        {
            logger.error("Failed to send email to '" + address + "' as the address is incorrectly formatted" );
        }
     
        return result;
    }
This code is in MailActionExecuter.java (perhaps .class) in org.alfresco.repo.action.executer package inside alfresco-repository-3.2r2.jar in <ALF_HOME>\tomcat\webapps\alfresco\WEB-INF\lib\

There is no way to edit or configure this change directly (Out-of-the-box). You might have to edit this java file, create the JAR file and redeploy the jar file. I wouldn't say that is the best way to do it - but, I will let you figure that out.

Hope this helps!

sselvan
Champ in-the-making
Champ in-the-making
Oh, btw I just realized you are probably in a multi-tenant environment.
I don't know much about it. May be it is issue - you might want to post a jira ticket.

Thank you

y_j2ee
Champ in-the-making
Champ in-the-making
Hi sselvan I will test your solution , thank you so much

vignesh_sabapat
Champ in-the-making
Champ in-the-making
Hi sselvan I will test your solution , thank you so much

I got into same issue as mentioned by you and i have done changes suggested by sselvan in this post and its working. Now i can able to send mail using alfresco explorer with localhost or other hostname as my mail address (in my case it is vignesh@vignesh.redhat)

vignesh_sabapat
Champ in-the-making
Champ in-the-making
I have worked on 3.4. Checked out the source from alfresco svn with revision number correspond to 3.4. Then located the source file MailActionExecuter.java file. And changed
private boolean validateAddress(String address)
    {
        boolean result = false;
      
        EmailValidator emailValidator = EmailValidator.getInstance();
        if (emailValidator.isValid(address))
        {
            result = true;
        }

private boolean validateAddress(String address)
    {
        boolean result = true;
      
        EmailValidator emailValidator = EmailValidator.getInstance();
        if (emailValidator.isValid(address))
        {
            result = true;
        }

Saved and rebuild the code using ant build. Then copied the result jar from

path/to/checkedout-src/HEAD/root/projects/repository/build/dist/alfresco-repository-3.4.d.jar

replace this jar file in your existing alfresco project and try to send out email