Finalise package #1

Closed
opened 2020-11-06 11:57:39 +00:00 by decentral1se · 4 comments
Owner

A lot to be done.

A lot to be done.
decentral1se self-assigned this 2020-11-06 11:57:52 +00:00
Author
Owner

[ ] Get it to send an email out and get one in

These env vars are exposed from the _app service and deal with outgoing:

  if ENV['SMTP_ADDRESS'].present?
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = { address: ENV['SMTP_ADDRESS'] }
    config.action_mailer.smtp_settings[:port] = ENV['SMTP_PORT'] if ENV['SMTP_PORT'].present?
    config.action_mailer.smtp_settings[:domain] = ENV['SMTP_DOMAIN'] if ENV['SMTP_DOMAIN'].present?
    config.action_mailer.smtp_settings[:user_name] = ENV['SMTP_USER_NAME'] if ENV['SMTP_USER_NAME'].present?
    config.action_mailer.smtp_settings[:password] = ENV['SMTP_PASSWORD'] if ENV['SMTP_PASSWORD'].present?
    config.action_mailer.smtp_settings[:authentication] = ENV['SMTP_AUTHENTICATION'] if ENV['SMTP_AUTHENTICATION'].present?
    config.action_mailer.smtp_settings[:enable_starttls_auto] = ENV['SMTP_ENABLE_STARTTLS_AUTO'] == 'true' if ENV['SMTP_ENABLE_STARTTLS_AUTO'].present?
    config.action_mailer.smtp_settings[:openssl_verify_mode] = ENV['SMTP_OPENSSL_VERIFY_MODE'] if ENV['SMTP_OPENSSL_VERIFY_MODE'].present?
  else
    # Use sendmail as default to avoid ssl cert problems
    config.action_mailer.delivery_method = :sendmail
  end

These env vars are exposed from the _smtp service and deal with incoming:

  desc "Start STMP server for incoming email (options: SMTP_SERVER_PORT=2525, SMTP_SERVER_HOST=0.0.0.0)"
  task :reply_email_smtp_server => :environment do
    port = ENV['SMTP_SERVER_PORT'].present? ? ENV['SMTP_SERVER_PORT'].to_i : 2525
    host = ENV['SMTP_SERVER_HOST']
    rake_say "Started SMTP server for incoming email on port #{port}."
    server = FoodsoftMailReceiver.new port, host, 1, logger: Rails.logger
    server.start
    server.join
  end
> [ ] Get it to send an email out and get one in These env vars are exposed from the `_app` service and deal with outgoing: ``` if ENV['SMTP_ADDRESS'].present? config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: ENV['SMTP_ADDRESS'] } config.action_mailer.smtp_settings[:port] = ENV['SMTP_PORT'] if ENV['SMTP_PORT'].present? config.action_mailer.smtp_settings[:domain] = ENV['SMTP_DOMAIN'] if ENV['SMTP_DOMAIN'].present? config.action_mailer.smtp_settings[:user_name] = ENV['SMTP_USER_NAME'] if ENV['SMTP_USER_NAME'].present? config.action_mailer.smtp_settings[:password] = ENV['SMTP_PASSWORD'] if ENV['SMTP_PASSWORD'].present? config.action_mailer.smtp_settings[:authentication] = ENV['SMTP_AUTHENTICATION'] if ENV['SMTP_AUTHENTICATION'].present? config.action_mailer.smtp_settings[:enable_starttls_auto] = ENV['SMTP_ENABLE_STARTTLS_AUTO'] == 'true' if ENV['SMTP_ENABLE_STARTTLS_AUTO'].present? config.action_mailer.smtp_settings[:openssl_verify_mode] = ENV['SMTP_OPENSSL_VERIFY_MODE'] if ENV['SMTP_OPENSSL_VERIFY_MODE'].present? else # Use sendmail as default to avoid ssl cert problems config.action_mailer.delivery_method = :sendmail end ``` These env vars are exposed from the `_smtp` service and deal with incoming: ``` desc "Start STMP server for incoming email (options: SMTP_SERVER_PORT=2525, SMTP_SERVER_HOST=0.0.0.0)" task :reply_email_smtp_server => :environment do port = ENV['SMTP_SERVER_PORT'].present? ? ENV['SMTP_SERVER_PORT'].to_i : 2525 host = ENV['SMTP_SERVER_HOST'] rake_say "Started SMTP server for incoming email on port #{port}." server = FoodsoftMailReceiver.new port, host, 1, logger: Rails.logger server.start server.join end ```
Author
Owner

OK email is ready to be tested live. I have outgoing SMTP details loaded and the internal rails smtp server ready to get routed mails from a relay configuration from mailu!

OK email is ready to be tested live. I have outgoing SMTP details loaded and the internal rails smtp server ready to get routed mails from a relay configuration from mailu!
decentral1se removed their assignment 2021-01-05 15:14:11 +00:00
Author
Owner
See https://github.com/foodcoops/foodcoops.net/issues/51.
Author
Owner

OK, gonna close this off and open up specific tickets as I go.

OK, gonna close this off and open up specific tickets as I go.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/foodsoft#1
No description provided.