【问题标题】:Cuttlefish.io (Ruby on Rails) configurationCuttlefish.io (Ruby on Rails) 配置
【发布时间】:2015-02-06 01:49:53
【问题描述】:

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

访问 domain.example.com 并登录到 Cuttlefish 后,我点击 Test email,然后在 TO 框中输入我的 Gmail 地址,然后点击发送测试电子邮件。

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

app页面给我的smtp设置如下:-

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

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

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

我已在我的服务器上安装并运行 postfix。

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

【问题讨论】:

    标签: ruby-on-rails ruby postfix-mta


    【解决方案1】:

    Cuttlefish 有自己的基于 EventMachine gem 的 smtp 服务器,它运行在 2525 端口上。默认情况下,Postfix 在我的 Ubuntu 上运行 25。因此,您的 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
    

    请注意,Cuttlefish 的 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
    

    希望对你有帮助。

    【讨论】:

    • 非常感谢
    • 嗨,你终于可以运行 Cuttlefish 了吗?
    • 如果我尝试发送测试电子邮件,它会给我一个 EOFError。我不知道 RoR,所以非常感谢任何帮助
    猜你喜欢
    • 1970-01-01
    • 2011-02-13
    • 2015-09-02
    • 2012-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多