Bug 916972 - [fork][US3420]The email service does not work on the /app/account/help page.
Summary: [fork][US3420]The email service does not work on the /app/account/help page.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Website
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Hiro Asari
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-01 10:31 UTC by Yujie Zhang
Modified: 2015-05-15 01:19 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-15 14:22:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Contact mail delivered (46.70 KB, image/png)
2013-03-06 21:41 UTC, Hiro Asari
no flags Details

Description Yujie Zhang 2013-03-01 10:31:30 UTC
Description of problem:

Changed the site/app/mailers/account_support_contact_mailer.rb to set this: 

default :to => "yujzhang"
mail(:to => "yujzhang", :from => @support_contact.from, :subject => @support_contact.subject)

, after clicking "send" button, I can not receive email.

Version-Release number of selected component (if applicable):
fork_ami_US3420_503 

How reproducible:
always

Steps to Reproduce:
1.Configure instance like above
2.Go to /app/account/help page
3.Input title and subject, then click "Send" button
  
Actual results:

Can not receive support request email which sent from /app/account/help page.Log is as following:

2013-03-01 05:24:25.138 [INFO ] Started POST "/app/account/contact" for 203.114.244.88 at 2013-03-01 05:24:25 -0500 (pid:18722)
2013-03-01 05:24:25.503 [INFO ] Processing by AccountController#contact_support as HTML (pid:18722)
2013-03-01 05:24:25.538 [INFO ] Parameters: {"utf8"=>"✓", "authenticity_token"=>"fDtrqkRG3F7bOem1Sl3+fVZS5VFo0WCFf5CWFlHaePY=", "support_contact"=>{"from"=>"wsun", "subject"=>"test", "body"=>"test"}, "commit"=>"Send"} (pid:18722)
2013-03-01 05:24:25.636 [DEBUG] params: {"from"=>"wsun", "subject"=>"test", "body"=>"test"} (pid:18722)
2013-03-01 05:24:26.759 [DEBUG] Contact email sent from wsun (pid:18722)
2013-03-01 05:24:27.395 [INFO ] Rendered account_support_contact_mailer/contact_email.html.erb (0.7ms) (pid:18722)
2013-03-01 05:24:27.293 [INFO ] Sent mail to yujzhang (142ms) (pid:18722)
2013-03-01 05:24:27.293 [DEBUG] Date: Fri, 01 Mar 2013 05:24:27 -0500
From: wsun
To: yujzhang
Message-ID: <513081db40a91_4922c73878849cd>
Subject: test
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE html>
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
  </head>
  <body>
    <h1>Account Support Request received from user X</h1>
    <p>
      test
    </p>
  </body>
</html> (pid:18722)


Expected results:

Should receive support request email which sent from /app/account/help page.

Additional info:

Comment 1 Hiro Asari 2013-03-05 22:07:01 UTC
On devenv, the app is running in development mode, for which we have:
  config.action_mailer.delivery_method = :test
so no delivery happens.

I'll try to figure out if there is a way to set up mail relay.

Comment 2 Hiro Asari 2013-03-06 21:41:14 UTC
Created attachment 706271 [details]
Contact mail delivered

This is strictly an issue with development environment configuration. It takes a little bit of effort, but you can test that the form works fine.

1. Edit /var/www/openshift/site/config/environments/development.rb:

1.a. Configure the recipient for the contact form:

  config.acct_help_mail_to = '<YOURNAME>@redhat.com'


1.b. Configure ActionMailer so that it uses SMTP. A typical configuration might look like:

  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :address              => "smtp.gmail.com",
    :port                 => 587,
    :domain               => 'gmail.com',
    :user_name            => '<username>',
    :password             => '<password>',
    :authentication       => 'plain',
    :enable_starttls_auto => true  }

2. Restart 'rhc-site' service with "service rhc-site restart".

3. Go to https://<devenv>/app/account/help and send contact email.

If you are using a Gmail account (as shown above in 1.b.), this may result in a warning email from Google, indicating that they've detected suspicious activity. Use your browser to log in to the Gmail account, and follow the instruction at the top to allow temporary access.

4. Got to https://<devenv>/app/account/help and send contact email again.

This should result in email as shown in the attached screenshot.

To reiterate: this is strictly a configuration issue, which should not manifest on production.

Comment 3 Yujie Zhang 2013-03-07 12:57:12 UTC
Tested on fork_ami_US3420_503 with above steps, the email can be received after the configuration, so verify this bug now.


Note You need to log in before you can comment on or make changes to this bug.