cancel
Showing results for 
Search instead for 
Did you mean: 

Setting return address for emails sent by Alfresco

omegerard
Champ in-the-making
Champ in-the-making
Hi,

When I send an invitation for a user to access a particular space, the email sent has as return address:

From: alfresco@alfresco.org

You won't be surprised to learn that we'd like to customize that. I searched the xml config file, but did not find any useful clue. Is this still something that is hard-coded in the sources?

Regards

Ludo
6 REPLIES 6

rbramley
Champ in-the-making
Champ in-the-making
Hi Ludo,

If you are logged in as admin, then your {http://www.alfresco.org/model/content/1.0}email node property is empty (or null).
Therefore, the InviteUsersWizard will default the from address to "alfresco@alfresco.org" (around line 190):

         if (from == null || from.length() == 0)         {            // TODO: get this from spring config?            from = "alfresco@alfresco.org";         }‍‍‍‍‍‍‍


If you are a different user, then this property should not be null and the message should originate from the set-up username.


Also, if you plan on using e-mail notification rules, then you'll want to change org.alfresco.repo.action.executer.MailActionExecuter.FROM_ADDRESS (line 51):
    public static final String FROM_ADDRESS = "alfresco_repository@alfresco.org";‍‍‍


Hope this helps,

Robin

omegerard
Champ in-the-making
Champ in-the-making
Hi Robin,

Thanks for your reply.

What file are you referring to? In which file can I find the cited code at around line 190?

The command "find . exec grep alfresco@alfresco.org {} \;" command gave me only one hit: lixense.txt. So, I presume it must be in the source code somewhere.

Regards

Ludo

rbramley
Champ in-the-making
Champ in-the-making
Hi Ludo,

Yes, these are both set within the source code…

projects\web-client\source\java\org\alfresco\web\bean\wizard\InviteUsersWizard.java
projects\repository\source\java\org\alfresco\repo\action\executer\MailActionExecuter.java

The InviteUsersWizard has a "TODO: get this from spring config?" so hopefully that will get done before the next release!

Cheers,

Robin

rsfeir
Champ in-the-making
Champ in-the-making
This is an issue for us.  For now we setup some sendmail rules to override this, but this is quite an old problem, why has this value not moved out to a descriptor or properties file along with the other mail settings where we can change things?

Thanks
R

steve
Champ in-the-making
Champ in-the-making
Hello,

You can change this in the configuration extension files for the 1.2 release.

In the extension directory there should be a file called:
web-client-config-custom.xml.sample

Rename this by removing the .sample from the end.

Edit the following section to include your desired return email address (and uncomment it):

   <!– Example of overriding the from email address –>   <!–   <config>      <client>         <from-email-address>someone@your-domain.com</from-email-address>      </client>   </config>   –>‍‍‍‍‍‍‍‍‍‍

Hope this helps,

Steve

rsfeir
Champ in-the-making
Champ in-the-making
We're not using 1.2  Smiley Happy