Skip to content

ajozwik/pekko-smtp-server

Repository files navigation

pekko-smtp-server

Scala CI Coverage Status Codacy Badge codecov Maven Central Maven Central

Smtp server based on pekko stream.

Add to your project:

 libraryDependencies += "com.github.ajozwik" %% "pekko-smtp" % <version>

For minimal usage you need to provide consumer method with signature (Mail=>Future[ConsumedResult]). consumer method receives Mail object and it repeats with Future[SuccessfulConsumed] or Future[FailedConsumed].

AddressHandler.scala is optional implementation for fail fast address resolution (blacklist).

Usage: Implement trait Consumer

Example implementation: LogConsumer

Example usage:

  • Pack project

sbt pack

pekko-smtp/target/pack/bin/main -Dconsumer.class=pl.jozwik.smtp.server.consumer.FileLogConsumer

  • or use project as dependency and provide own Main class

If you know, how to handle STARTTLS with pekko-stream (pekko tcp) feel free to create a issue.