Cuttlefish.io (Ruby on Rails) configuration



我已经按照本指南在我的 Ubuntu 服务器上部署了 Cuttlefish(Ruby on Rails 事务电子邮件应用程序)。

访问 domain.example.com 并登录墨鱼后,我单击测试电子邮件,然后在收件人框中输入我的Gmail地址,然后单击发送测试电子邮件。

我收到一封已发送的测试电子邮件,但该电子邮件从未到达。我也尝试通过创建应用程序发送消息,然后尝试在phpMailer中使用smtp凭据,但我无法连接到smtp服务器。

应用程序页面给我的smtp设置如下:-

Protocol: SMTP
Host: localhost
Port: 2525
Username: test_2
Password: xxxxxxx
Authentication: plain

当我在终端中运行 telnet 本地主机 2525 时,出现连接被拒绝错误。

当我运行netstat -anltp|grep :2525时,我没有得到任何结果。

我已经在我的服务器上安装并工作了后缀。

请你帮我通过墨鱼发送电子邮件。

Cuttlefish拥有自己的基于EventMachine gem的smtp服务器,它运行在2525端口上。Postfix 默认在 25 上的 Ubuntu 上运行。因此,您的smtp进程似乎不起作用。

您应该与工头一起导出新贵工作。为此,我更喜欢使用以下 capistrano 任务:

desc 'Foreman init'
task :foreman_init do
  on roles(:all) do
    foreman_temp = "/var/www/tmp/foreman"
    execute  "mkdir -p #{foreman_temp}"
    execute "ln -s #{release_path} #{current_path}"
    within current_path do
      execute "cd #{current_path}"
      execute :bundle, "exec foreman export upstart #{foreman_temp} -a #{application} -u #{user} -l /var/www/apps/#{application}/log -d #{current_path} -f Procfile.production"
    end
    sudo "mv #{foreman_temp}/* /etc/init/"
    sudo "rm -r #{foreman_temp}"
  end
end

请注意,墨鱼的Procfile中有3个过程:

smtp: rvm . do bundle exec rake cuttlefish:smtp RAILS_ENV=production
log: rvm . do bundle exec rake cuttlefish:log RAILS_ENV=production
worker: rvm . do bundle exec rake jobs:work RAILS_ENV=production

希望对您有所帮助。

最新更新