#1545 email "from" field error

trigan_d Wed 25 May 2011

Hi everybody.

It looks like a bug, but I'm not sure. Correct me if I'm wrong.

Try to send an email with from field set to something like

"John Smith" <john@somewhereonthe.net>

You will get SMTP error "555 5.5.4 Unsupported option: <john@somewhereonthe.net>". It's because of fantom SmtpClient taking sender address for MAIL FROM: directly from Email object.

I guess that we should have an ability to set the MAIL FROM: parameter regardless of MIME From: header. Or, like an other variant, the SmtpClient can became smarter and parse the Email.from field to take only the correct part of it.

Any way, we have to send commands to SMTP server like this:

MAIL FROM: john@somewhereonthe.net
RCPT TO: somebody@betterplace.hvn
From: "John Smith" <john@somewhereonthe.net>
Subject: just another prayer

Hello somebody.
Please make our Fantom better.
Sincerely yours, Johnny.

brian Wed 25 May 2011

Promoted to ticket #1545 and assigned to brian

brian Wed 25 May 2011

Ticket resolved in 1.0.59

Yeah, we've actually run into that bug in our own email use. I think the simplest solution is to use full MIME email addresses for the from, to, cc, and bcc fields. Then strip the addr-spec part our for the SMTP exchange. So I added a MimeUtil.toAddrSpec method and made the fixes.


Login or Signup to reply.