What credentials do I need for the mail application? Testing locally, running 
in the infra/whimsy environment?

    mail = Mail.new do
      to "#{user.public_name}<#{user.mail.first}>"
 #     cc "secret...@apache.org"
      from "#{user.mail.first}"
      subject "Conflict of Interest affirmation from #{user.public_name}"
      body "This year's Conflict of Interest affirmation is attached."
    end
    mail.attachments["#{user.id}.txt"] = affirmed
    mail.deliver!
  end

#<Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 25>
  /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/net/smtp.rb:539:in `initialize'
  /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/net/smtp.rb:539:in `open'
  /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/net/smtp.rb:539:in `tcp_socket'
  /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/net/smtp.rb:549:in `block in 
do_start'
  /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/timeout.rb:95:in `block in 
timeout'
  /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
  /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/net/smtp.rb:548:in `do_start'
  /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/net/smtp.rb:518:in `start'
  
/usr/local/lib/ruby/gems/2.7.0/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:109:in
 `start_smtp_session'
  
/usr/local/lib/ruby/gems/2.7.0/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:100:in
 `deliver!'
  /usr/local/lib/ruby/gems/2.7.0/gems/mail-2.7.1/lib/mail/message.rb:276:in 
`deliver!'
  /srv/whimsy/www/officers/coi.cgi:177:in `block in emit_post'


> On Jun 22, 2020, at 3:29 PM, Craig Russell <apache....@gmail.com> wrote:
> 
> Another couple of questions:
> 
> 1. What's the best way to --dryrun the commit until I have the rest of the 
> application working? I know there are a couple of ways to do it, from putting 
> --dryrun into some of the svn commands to using a keyboard entry to do it. Is 
> it <ctrl> click on the keyboard?
> 
> 2. What's the best model for implementing the mailto: user, cc:secretary? Is 
> it as easy as require 'mail' and use a whimsy mail API?
> 
> Thanks,
> Craig
> 
>> On Jun 22, 2020, at 3:23 PM, Sam Ruby <ru...@intertwingly.net> wrote:
>> 
>> On Mon, Jun 22, 2020 at 5:20 PM Craig Russell <apache....@gmail.com> wrote:
>>> 
>>> I've pushed a work in progress to branch coi. It currently does what I want 
>>> it to do for "get", which is to calculate who is required to affirm the coi.
>>> 
>>> But when I submit the "post" it gives an error
>>> #<NameError: undefined local variable or method `coi_current_template_url'>
>>> /srv/whimsy/www/officers/coi.cgi:146:in `emit_post'
>>> /srv/whimsy/www/officers/coi.cgi:130:in `block (5 levels) in <main>'
>>> /srv/whimsy/www/officers/coi.cgi:128:in `block (4 levels) in <main>'
>>> /Users/clr/apache/git/whimsy/lib/whimsy/asf/themes.rb:43:in `block (2 
>>> levels) in _whimsy_panel'
>>> 
>>> There is a variable coi_current_template_url but it is out of scope.
>>> 
>>> Is there documentation/discussion of scoping rules for the whimsy cgi 
>>> environment?
>>> 
>>> I've attached the coi.cgi in case it's easier to see what's gone wrong...
>> 
>> Scoping rules in Ruby are a bit complicated.  If these values aren't
>> expected to be modified, the recommendation is to change the variable
>> names to be ALL_CAPS.  If the values are expected to be modified,
>> prefix the variable name with a dollar sign ($).
>> 
>>> Craig L Russell
>>> c...@apache.org
>> 
>> - Sam Ruby
> 
> Craig L Russell
> c...@apache.org
> 

Craig L Russell
c...@apache.org

Reply via email to