Email setup in Adempiere

Often we have a need to setup email in the system. For example – a task is being assigned to a resource and you want an automated email to be sent to that person. In this article we are talking about how you can configure emails in Adempiere.

Adempiere Email setup process & considerations

When Adempiere setup is run, user needs to provide the address of an email server and an email id/password. Adempiere makes use of the Email server setup for sending/receiving emails from the system. The email id and password is used for the System user.

User cannot use localhost or local addresses (such as for setting up the email server. Adempiere validation would fail and setup would not continue.

Other considerations

Standard ports for other mail servers are –
SMTP port: 25
POP port: 110
IMAP port: 143

  • User can set IsSmtpAuthorization field to ‘Y’ in the AD_Client table

This would ensure that authorization of the email happens each time Adempiere tries to send email.

  • If the mail is to be sent on behalf of a specific user, the email id & password will have to be retrieved from the AD_User table. Care must be taken that the domain setup during system installation matches the domain of the user being used to send email.

Known Issues

Configuring “gmail” as the mail server – It has been observed to cause problems when gmail is used as the mail server. System fails to setup initially and then fails to authenticate users.

In Adempiere code, the port numbers for smtp, pop & imap have been hard-coded to 25, 110 and 143 respectively. There is no option during the installation to change these ports.

Since gmail requires different ports for each of these protocols, it is difficult to setup gmail as mail server quickly.

In code, the smtp port number and tls status has been overriden for gmail as below:

if (m_smtpHost.equalsIgnoreCase(“”)) {
// Enable gmail port and ttls – Hardcoded
ps.put(“mail.smtp.port”, “587”);
ps.put(“mail.smtp.starttls.enable”, “true”);

Similar overriding is not done for any other domain or for pop & imap protocols for even gmail.

As a result, following errors can be observed during system installation –

“POP3 Server NOT available”

“IMAP4 Server NOT  available”

Gmail specific configuration

You need to consider the following while setting up gmail as your mail server –
SMTP port: 587
POP port: 995
IMAP port: 993
TLS = true

If the user is sure to always use gmail as the mail server, they may very well change the port numbers in the code before building the installer. The more elegant way would be to have a configurable window in Adempiere.

Hope you found this useful. If you need any assistance on Adempiere, you can contact us by visiting our company website.

Tagged with: , , ,
Posted in ADempiere
One comment on “Email setup in Adempiere
  1. madhu sudhanarao says:

    When i changed the email configuration details in my application and after that i tested my application.In the testing mailing is not happening.On that time I restarted my application then mail sending
    is working fine.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

We Have Moved Our Blog!

We have moved our blog to our company site. Check out for all latest blogs.

Sencha Select Partner Sencha Training Partner
Xamarin Authorized Partner
Recent Publication
%d bloggers like this: