I have a cronjob that sends newsletters daily. For some reason, an error has occurred.
I checked the stack trace and got this
Net::SMTPSyntaxError: 501 Syntax error from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:957:in `check_response' from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:926:in `getok' from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:869:in `rcptto' from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:850:in `block in rcptto_list' from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:848:in `each' from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:848:in `rcptto_list' from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:663:in `send_message' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:113:in `block in deliver!' from /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:521:in `start' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:2141:in `do_delivery' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:236:in `block in deliver' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/actionmailer-4.1.8/lib/action_mailer/base.rb:527:in `block in deliver_mail' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/notifications.rb:159:in `block in instrument' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/notifications.rb:159:in `instrument' ... 3 levels... from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/commands/console.rb:90:in `start' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/commands/console.rb:9:in `start' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:69:in `console' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:in `run_command!' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/commands.rb:17:in `<top (required)>' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/app_rails_loader.rb:43:in `require' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/app_rails_loader.rb:43:in `block in exec_app_rails' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/app_rails_loader.rb:32:in `loop' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/app_rails_loader.rb:32:in `exec_app_rails' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/lib/rails/cli.rb:5:in `<top (required)>' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/bin/rails:9:in `require' from /var/www/lsd-core/shared/bundle/ruby/2.1.0/gems/railties-4.1.8/bin/rails:9:in `<top (required)>' from /usr/local/rvm/gems/ruby-2.1.5/bin/rails:23:in `load' from /usr/local/rvm/gems/ruby-2.1.5/bin/rails:23:in `<main>' from /usr/local/rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
Initially, I thought it was a bad email format in the recipient list, but after weeding a few, I still get an error message after manually starting the mailing list.
I tried iterating through each recipient and sending them an email, and it worked! Even for bad letters.
Is there a maximum number of recipients when sending using ActionMailer?
source share