smtp 1.0.0+1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 55

smtp #

Pub build status

An SMTP 5321 server implementation in Dart.

Usage #

This SMTP server should not be used as your front-facing server, especially in production. Consider setting up Postfix to relay e-mail to this server; that way, you can be sure that only well-formed e-mail messages will touch your Dart code.

Note that this includes no spam protection, etc., and is simply a plain SMTP server library.


main() async {
  var server = await SmtpServer.bind('127.0.0.1', 0);

  await for (var mailObject in server.mailObjects) {
    print(mailObject.envelope.originatorAddress);
    print(mailObject.envelope.headers.cc);
    mailObject.close(statusCode: 221, reasonPhrase: 'Bye!');
  }
}

1.0.0+1 #

  • Made the description longer for Pub (not sure why this knocked off an entire 20% from the score...).

1.0.0 #

  • First release.

example/main.dart

import 'package:smtp/smtp.dart';

main() async {
  var server = await SmtpServer.bind('127.0.0.1', 0);

  await for (var mailObject in server.mailObjects) {
    print(mailObject.envelope.originatorAddress);
    print(mailObject.envelope.headers.cc);
    mailObject.close(statusCode: 221, reasonPhrase: 'Bye!');
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  smtp: ^1.0.0+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:smtp/smtp.dart';
  
Version Uploaded Documentation Archive
1.0.0+1 Oct 5, 2018 Go to the documentation of smtp 1.0.0+1 Download smtp 1.0.0+1 archive
1.0.0 Oct 5, 2018 Go to the documentation of smtp 1.0.0 Download smtp 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
17
Health:
Code health derived from static analysis. [more]
88
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: Flutter, other

Primary library: package:smtp/smtp.dart with components: io.

Health issues and suggestions

Document public APIs. (-1 points)

46 out of 46 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/server.dart. (-6.78 points)

Analysis of lib/src/server.dart reported 14 hints, including:

line 8 col 19: Use = to separate a named parameter from its default value.

line 8 col 35: Use = to separate a named parameter from its default value.

line 8 col 55: Use = to separate a named parameter from its default value.

line 17 col 19: Use = to separate a named parameter from its default value.

line 18 col 18: Use = to separate a named parameter from its default value.

Fix lib/src/protocol.dart. (-4.41 points)

Analysis of lib/src/protocol.dart reported 9 hints, including:

line 7 col 31: Use = to separate a named parameter from its default value.

line 7 col 57: Use = to separate a named parameter from its default value.

line 21 col 31: Use = to separate a named parameter from its default value.

line 21 col 57: Use = to separate a named parameter from its default value.

line 69 col 31: Use = to separate a named parameter from its default value.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <3.0.0
async >=1.0.0 <3.0.0 2.0.8
dart2_constant ^1.0.0 1.0.2+dart2
http_parser ^3.0.0 3.1.3
mime ^0.9.0 0.9.6+2
Transitive dependencies
charcode 1.1.2
collection 1.14.11
meta 1.1.7
path 1.6.2
source_span 1.5.4
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
mailer ^1.0.0
test any