#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" <[email protected]>

You will get SMTP error "555 5.5.4 Unsupported option: <[email protected]>". 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: [email protected]
RCPT TO: [email protected]
DATA
From: "John Smith" <[email protected]>
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.

changeset

Login or Signup to reply.