genkgo / mail

Library to send e-mails over different transports and protocols (like SMTP and IMAP) using immutable messages and streams. Also includes SMTP server.
https://mail.readthedocs.io/
Other
402 stars 21 forks source link

Implement legacy RFC821 connections #32

Closed GwendolenLynch closed 6 years ago

GwendolenLynch commented 6 years ago

As per everything with me, feel free to request changes or flat out reject. :+1:

Changes:

Use-cases

Using

$transport = new SmtpTransport(
    ClientFactory::fromString('smtp://localhost:25?rfc821=true')->newClient(),
    EnvelopeFactory::useExtractedHeader()
);
frederikbosch commented 6 years ago

Looks good at first hand. One remark, I am against setters/mutability on classes like FakeSmtpConnection. I'd rather see a named constructor FameSmtpConnection::newLegacyRfc821() which creates a new client and sets the boolean to true.

frederikbosch commented 6 years ago

Maybe we should also add this to the server end, with an example in the example folder. Then there is no need to run Python to test it.

GwendolenLynch commented 6 years ago

I'd rather see a named constructor FameSmtpConnection::newLegacyRfc821() which creates a new client and sets the boolean to true.

:+1:

Maybe we should also add this to the server end, with an example in the example folder. Then there is no need to run Python to test it.

I'll look into it.

frederikbosch commented 6 years ago

Also, add a link to the RFC for the README.

GwendolenLynch commented 6 years ago

Also, add a link to the RFC for the README.

~I just added a "dump" of the SMTP RFCs to the README, specifically:~

GwendolenLynch commented 6 years ago

I just added a "dump" of the SMTP RFCs to the README,

That moment you scroll down … just a little further … and your head meets the desk.

frederikbosch commented 6 years ago

Why did you choose to add a new negotiation and an additional configuration directive in dsn factory? Why not add this to TryTlsUpgradeNegotiation directly? Then it will work out of the box for everyone.

GwendolenLynch commented 6 years ago

The short version was that I was unsure as to your architectural direction in that regard. If you're happy with that approach, it would be my preferred one too. I'll update.

GwendolenLynch commented 6 years ago

Done. AppVeyor seems to have had a tantrum over Windows MSI installs, unrelated to these changes as best I can tell.

frederikbosch commented 6 years ago

Yeah, it seems that the upgrade to PHP 7.1.13 breaks AppVeyor. No idea why. I am not a specialist on AppVeyor/Windows.

frederikbosch commented 6 years ago

Thanks again!