ActionMailer/SMTP: Net::SMTPSyntaxError when message body co

FYI:

I don’t think this is a very well know. It seems that, on some
operating systems, ActionMailer/SMTP crashes when it sends an email
with only a ‘.’ (aka a ‘dot’ or a ‘period’). Specifically, you get
Net::SMTPSyntaxError (502 Error: command not implemented):

Environment Details:

$ uname -a
Linux private1 2.6.15-26-server #1 SMP Thu Aug 3 04:09:15 UTC 2006
i686 GNU/Linux

$ ruby --version
ruby 1.8.4 (2005-12-24) [i686-linux]

$ rails --version
Rails 1.1.6

Email Sending Details (example.com used in place of real data):

Sent mail:
From: “Example User ([email protected])” [email protected]
Reply-To: [email protected]
To: [email protected]
Subject: test with a ‘.’ in the message
Content-Type: text/plain; charset=utf-8

.

Net::SMTPSyntaxError (502 Error: command not implemented
):
/usr/local/lib/ruby/1.8/net/smtp.rb:680:in check_response' /usr/local/lib/ruby/1.8/net/smtp.rb:653:in getok’
/usr/local/lib/ruby/1.8/net/smtp.rb:639:in quit' /usr/local/lib/ruby/1.8/net/smtp.rb:426:in do_finish’
/usr/local/lib/ruby/1.8/net/smtp.rb:381:in start' /usr/local/lib/ruby/1.8/net/smtp.rb:316:in start’
/usr/local/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:511:in
perform_delivery_smtp' /usr/local/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:397:in deliver!’
/usr/local/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:291:in
method_missing' /app/controllers/no_details.rb:57:in private_no_details_here’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in
perform_action_without_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:in perform_action_without_benchmark’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:in measure’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in perform_action’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in
process_without_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in process_without_session_management_support’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in
process' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in dispatch’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:84:in
process' /usr/local/lib/ruby/1.8/sync.rb:229:in synchronize’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:83:in
process' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:in process_client’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in
process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in run’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in run’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:267:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in run’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in run’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231
/usr/local/bin/mongrel_rails:18

After further investigation, this error occurs when ‘.’ is the last
char in the message body and on it’s on line, regardless of how much
is in the body.

Thus the following message would cause the error:
— start message body
Hi.

This is a test with ‘.’ as the last char, on it’s own line.

.
---- end message body

I’m sending this to [email protected], too.

– Joe