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

**URL:** <https://www.ruby-forum.com/t/actionmailer-smtp-net-smtpsyntaxerror-when-message-body-co/80508>\
**Category:** Rails\
**Created:** [December 28, 2006, 1:30am UTC](https://www.ruby-forum.com/t/actionmailer-smtp-net-smtpsyntaxerror-when-message-body-co/80508 "2006-12-28T01:30:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![josephmat36](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@josephmat36](https://www.ruby-forum.com/u/josephmat36)\
**Post date:** [December 28, 2006, 1:30am UTC](https://www.ruby-forum.com/t/actionmailer-smtp-net-smtpsyntaxerror-when-message-body-co/80508/1 "2006-12-28T01:30:15Z")

</div>

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](http://example.com) used in place of real data):

Sent mail:  
From: “Example User (removed\_email\_address@domain.invalid)” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Reply-To: removed\_email\_address@domain.invalid  
To: removed\_email\_address@domain.invalid  
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

---

<div class="post-metadata">

**Author:** ![josephmat36](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@josephmat36](https://www.ruby-forum.com/u/josephmat36)\
**Post date:** [December 28, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/actionmailer-smtp-net-smtpsyntaxerror-when-message-body-co/80508/2 "2006-12-28T19:25:17Z")

</div>

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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid), too.

– Joe
