Setting up a mail server

email
Tags: #<Tag:0x00007fa9599bbb58>

#1

Hey, Im on a new instance now. Looking to get a mail server attached.

Have tried sendmail locally and I couldnt get it working. Now trying gmail.

Settings in Spree dont seem to work and mail is just sitting in /tmp/letter_opener

Whats the easiest way to get mail running from Spree?

Also noticed a bug (perhaps). I setup a new admin user logged in andi the mail is still sending from the previous admins address even though the mail server is new under a new admin account.

Anyway, I cant find a guide on here to set up the mail server, whats the best way?

Thanks


#2

Hi @openfoodireland

Did you try to check if delayed_job is running ?
Maybe you can try to restart it and/or restart unicorn

sudo service unicorn_openfoodnetwork restart
sudo service monit restart


#3

Not sure. Im getting this error in test.log

Delayed::Backend::ActiveRecord::Job Load (1.7ms) UPDATE “delayed_jobs” SET locked_at = ‘2016-03-22 14:17:24.885012’, locked_by = ‘delayed_job.0 host:Ansible pid:25985’ WHERE id IN (SELECT id FROM “delayed_jobs” WHERE ((run_at <= ‘2016-03-22 14:17:24.882749’ AND (locked_at IS NULL OR locked_at < ‘2016-03-22 14:02:24.882826’) OR locked_by = ‘delayed_job.0 host:Ansible pid:25985’) AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *

Is this something to do with it? Is it possible to use sendmail or something local?


#4

Have tried to set the mailserver with sendgrid now also from here:

https://sendgrid.com/docs/Integrate/index.html

Having setup an account. Still cannot receive either the test email or any user emails. Anyone have any suggestions?


#5

Are you still having issues with this @openfoodireland?


#6

Hey Danielle,
Yes, have tried multiple settings, localhost (having installed sendmail), gmail settings and sendgrid - all of which Ive seen others on here use. Still not receiving testmails.

I’ve seen reference to the delayed job, not sure where to look for that. Is it in the logs?


#7

@pmackay, @sigmundpetersen, @maikel, @RohanM, are you able to help @openfoodireland out with this?


#8

@openfoodireland please join the deployment channel on slack and we can try to work it out there.

First check, see if delayed_job.0 is running with ps -ef


#9

Yes it is, join slack there as well as Dave

1001 3455 1 0 Mar22 ? 00:01:01 delayed_job.0

Thanks


#10

letter_opener is only used in development and testing environment. If you want to send mails out, you have to start your application and delayed_job in staging or production environment. And then, your mail method needs to have that environment as well.


#11

Ok, will start in a staging enviroment. Thanks