Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to just receive emails through action mailbox?

Sylor-huang asked in Rails

Hi, I am currently testing and setting up an email service system.

I just need to be able to receive emails , but no need to send email.

  1. my dns mail.xxx.com is ping successful, it can get bytes from IP address.

  2. My online-server had open port: 443,22, 109,110, 993,995

  3. I used docker to deploy my rails server.

Dockers proxy ports is: 443, 109,110,993,995 and rails server port is 3005

  1. My ApplicationMailbox and comments_mailbox like this:

class ApplicationMailbox < ActionMailbox::Base

  routing /@xxx.com/i => :comments
  routing :all => :comments
end
class CommentsMailbox < ApplicationMailbox
  def process
    p mail.decoded
  rescue => e 
    p e
  end
end

  1. My nginx configuration is like this:

user xxx;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
  worker_connections 1024;
}
mail {
  server_name mail.xxx.com;
  ssl on;
  ssl_certificate xxx.pem;
  ssl_certificate_key xxx.key;
  ssl_session_timeout 5m;
  ssl_protocols ...;
  ssl_ciphers ....;
  ssl_prefer_server_ciphers on;
}
http {
  ...
}

When I send email from gmail account to ydddd@xxx.com (my custom emails), I can't receive email in production.

I had see this video : https://gorails.com/episodes/action-mailbox-rails-6, but it seems can not help me.

If I just want to receive emails in rails, What should I to do ? Was I need to use third party api such as sendgrid or Mailgun
?

Thanks so much~~

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,464+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.