Coder Social home page Coder Social logo

edmessage's Introduction

Hi there ๐Ÿ‘‹

I am Torsten Curdt. I am a member of the ASF and I've been involved in Open Source Software for more than 20 years. I am always looking for new and exciting ventures. So feel free to get in touch.

To lean more about me, or to reach me please head over to torstencurdt.com.

edmessage's People

Contributors

tcurdt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

edmessage's Issues

APIs block forever.

I'm trying out the API, but it can't get past the first line:

EDMailAgent *mailAgent = [EDMailAgent mailAgentForRelayHostWithName:@"smtp.me.com"];

It seems that it blocks inside of [NSHost currentHost] for ages.

According to this:
http://www.mail-archive.com/[email protected]/msg43541.html

People should avoid [NSHost currentHost] like the plague. It would be good if someone could figure out why this is called and find a more appropriate API.

SMTP sockets have no timeout values

The use of sockets in edmessage have no socket timeout values. RFC 5321 specifies various timeout values for various parts of the protocol ranging from a few minutes to 10 minutes. But right now, the thing can hang forever, or at least a long time. This is a big problem because lots of SMTP hosts can hang on common ports. For example, smtp.gmail.com gives no welcome message on ports 25 and 465 which are common SMTP ports. Of course google actually want you to use port 587, but the point is, connecting with expected ports causes the protocol and therefore the software to hang, and this is very bad.

Now, RFC 5321 specifies 10 minutes timeout in this scenario, but I for one don't even want to wait that long. Maybe that was ok on computers 20 years ago, but these days that is too long. So we need a configurable timeout value. So we need to add a variable to EDMailAgent:

@interface EDMailAgent : NSObject
NSTimeInterval timeout;

@Property(assign) NSTimeInterval timeout;

and in _getStream

  • (EDSMTPStream *)_getStream
    ..... etc
    [[stream socket] setReceiveTimeout:timeout];
  • (id)init
    ... etc
    // set a reasonable timeout. RFC 5321 specifies 10 minutes for some things.
    timeout = 10.0 * 60.0;

And there we go. Now we can set the timeout for the agent manually, and at least we get a semi-reasonable and RFC compliant default.

On another note, I'm not sure why my performance issue about NSHost is now in the closed section of Issues. Is this project being actively maintained?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.