How to use localhost for sending out email?


I was trying to configure localhost to send out mail notifications, however, i get this in the logs:

[2020-08-05 14:37:36] ERROR [aTw5qRgG74Q] getaddrinfo ENOTFOUND null
[2020-08-05 14:37:36] DEBUG [aTw5qRgG74Q] Closing connection to the server using “destroy”
[2020-08-05 14:37:36] ERROR Send Error: getaddrinfo ENOTFOUND null
{“errno”:“ENOTFOUND”,“code”:“EDNS”,“syscall”:“getaddrinfo”,“hostname”:“null”,“command”:“CONN”,“level”:“error”,“message”:"mail/index/sendSTMPEmailgetaddrinfo ENOTFOUND null

I tried to change


But this configuration doesnt get reflected, can anyone help me understand what I am doing wrong ?


Ok, managed to fix this by deleting the exchange :

hollaex web --terminate
hollaex terminate

then visited and signed up as DIY Exchange then perform :

hollaex setup
hollaex web --setup

hollaex start
hollaex web --start

However, my setup is run behind proxy server, but application ( is not able to pickup X-Forwarded-For IP of remote client. How to fix this ?

Having a reverse proxy is a common practice but what exactly is the issue you are facing now? Providing screenshots could help.


So I have apache proxy → Load Balancer setup before hollaex → VM
Apache Proxy (public IP , pvt vm lan)
Hollaex VM (pvt IP :

Apache has been setup with remoteip and proxy* modules
with X-Forward-For setup and it sends the remote client IP and shows up this in its log :slight_smile:

Hollaex Configuration

    ProxyPreserveHost On
    ProxyRequests Off
    ProxyVia On
    ProxyPass "/" ""
    ProxyPassReverse "/" ""

RemoteIPHeader X-Forwarded-For - - [06/Aug/2020:19:54:28 +0530] “GET /v1/reset-password?captcha=AAAYYY&email=xxx HTTP/2.0” 200 158 “” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36”

While nginx corresponding log shows : - - [06/Aug/2020:14:24:28 +0000] 200 “GET /v1/reset-password?captcha=AAAYYY&email=xxx HTTP/1.1” 63 “” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36” ""

However the application server running at hollaex is picking up IP of remote client as : instead of

Let me know if you require further details,

Hi there.

Looks like you are having a logging issue while you are running HollaEx with a reverse proxy.

There are two types of logs you could check the IPs.

  • Nginx Logs
  • API Logs

For the Nginx logs, as you mentioned above, it displays the X-forwarded-for logs at the end of the logs line. You could get the real IP by checking it.

For the API logs, it also supports to display the X-forwarded-for IP, but the log lines are separated.

Here’s an example:

2020-08-07 16:24:00	
{"message":"::ffff: - - [07/Aug/2020:07:24:00 +0000] "GET /v1/constant HTTP/1.1" 200 7771 "-" "python-requests/2.21.0"

2020-08-07 16:24:04	
{"level":"info","message":"9db7c6fc-bb20-4dde-90c6-10487526bfa2 middleware/hostname  GET /v1/constant","timestamp":"2020-08-07T07:24:04.471Z","log":"{\"level\":\"info\",\"message\":\"9db7c6fc-bb20-4dde-90c6-10487526bfa2 middleware/hostname  GET /v1/constant\",\"timestamp\":\"2020-08-07T07:24:04.471Z\"}\n"}

On the first line, it only shows the internal IP of a load balancer, but the following logs do show the real IP of the user. Please keep this in mind.

Also, this is not related to the logs, but the emails that the server sends to the user also displays an IP. It only records the local IP (with no X-forwarded-for) by default. You could customize this at the /mail folder of the HollaEx Kit if you want. Make sure to redeploy it by running hollaex upgrade once you customize it.