Need help for Email setup

Hi,

It is my first to try to install sharetrib. I came with problems to setup email.

I have followed this instruction:
https://freedif.org/how-to-install-sharetribe-for-ubuntu-16-04

I believe sendmail is configured properly. I can send mail with the following commond
echo “test mail send from sharetrib web server” | mail -s “interesting website” qinyian@gmail.com

But I did not get mail from sharetrib.

in the terminal, I got the following error message:

http://rigy.io/en/confirmation_pending → /en/confirmation_pending
127.0.0.1:11211 failed (count: 37) Errno::ECONNREFUSED: Connection refused - connect(2) for “127.0.0.1” port 11211
DalliError: No server available
DalliError: No server available
DalliError: No server available
DalliError: No server available
{“method”:“PUT”,“path”:“/en/people/confirmation”,“format”:“html”,“controller”:“ConfirmationsController”,“action”:“create”,“status”:302,“duration”:86.45,“view”:0.0,“db”:46.94,“location”:“http://rigy.io/en/confirmation_pending",“params”:{“utf8”:“✓”,“_method”:“put”,“authenticity_token”:“7rq59Aj77Vl6AY3sAFUtUHi5rUgekIbmseIea4jVS6LdaSY6z1kCv9uUc6cWWJa9i4eXCJqEajV8WR4jkp1/Mw==”,“locale”:“en”},“host”:“rigy.io”,“community_id”:1,“current_user_id”:“vvgvFfQI_VNwCj-5loKfRA”,“user_agent”:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36”,“referer”:“http://rigy.io/en/confirmation_pending",“forwarded_for”:“”,“request_uuid”:"67d1e560-30f0-44f0-8f49-4651f4616e5b”}
192.168.0.1 - - [02/Apr/2018:18:36:59 CEST] “POST /en/people/confirmation HTTP/1.1” 302 114
http://rigy.io/en/confirmation_pending → /en/people/confirmation
DalliError: No server available
DalliError: No server available
DalliError: No server available
DalliError: No server available
{“method”:“GET”,“path”:“/en/confirmation_pending”,“format”:“html”,“controller”:“CommunityMembershipsController”,“action”:“confirmation_pending”,“status”:200,“duration”:111.08,“view”:42.73,“db”:49.31,“params”:{“locale”:“en”},“host”:“rigy.io”,“community_id”:1,“current_user_id”:“vvgvFfQI_VNwCj-5loKfRA”,“user_agent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36”,“referer”:“http://rigy.io/en/confirmation_pending",“forwarded_for”:“”,“request_uuid”:"3e75efe9-bbc1-43a6-93ef-f7a88b3c8b60”}
192.168.0.1 - - [02/Apr/2018:18:36:59 CEST] “GET /en/confirmation_pending HTTP/1.1” 200 5763

How could I debug? Where is the official instruction for email setup?

BR
Yian

In development, did you get email to work locally?
Instructions below:
Use Mailcatcher to receive sent emails locally:
Install Mailcatcher:

gem install mailcatcher
Start it:

mailcatcher
Add the following lines to config/config.yml:

development:
mail_delivery_method: smtp
smtp_email_address: “localhost”
smtp_email_port: 1025
Open http://localhost:1080 in your browser

Depends on where you deploy remotely (production), email setup are different in each case:
Heroku - you can use addons - sendgrid or mandrill
Digital Ocean - https://www.digitalocean.com/community/tags/email?type=tutorials
AWS - https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-email.html

Those are just a few example. You might try sharetribe hosted version.

For anyone looking at this later, the issue above is
127.0.0.1:11211 failed (count: 37) Errno::ECONNREFUSED: Connection refused - connect(2) for “127.0.0.1” port 11211 DalliError: No server available

This issue is due to the dalli gem not being able to connect to memcached, which is used for delayed_jobs workers. All Sharetribe emails are sent through a worker queue, so won’t send if your memory store isn’t setup.

Sharetribe allows both memcached and Redis as memory stores. I’ve found Redis to be easier to setup.

https://github.com/sharetribe/sharetribe/blob/d236f631393f2e2d6143f549aa8b37fae3ee1c9c/config/environments/production.rb#L60