Giter Club home page Giter Club logo

aws-smtp-relay's Introduction

aws-smtp-relay's People

Contributors

8llouch avatar basschipper avatar dependabot-preview[bot] avatar dependabot[bot] avatar duttonw avatar ebukoski avatar harisiva-codaio avatar loopingz avatar mjohnson9 avatar morganchristiansson avatar pgmillon avatar snyk-bot 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aws-smtp-relay's Issues

SourceArn support

Is there a possiblity of adding (optional) support for sourceArn when sending emails?

Segfault when trying to send email

Reproduction scenario:

$ docker run -it --rm ubuntu:xenial
root@d260a71663c1:/# apt install -y telnet wget openjdk-8-jdk-headless
root@d260a71663c1:/# wget https://github.com/loopingz/aws-smtp-relay/releases/download/v1.2.0/aws-smtp-relay_1.2.0_all.deb
root@d260a71663c1:/# apt install -y ./aws-smtp-relay_1.2.0_all.deb
root@d260a71663c1:/# /usr/bin/aws-smtp-relay -b 127.0.0.1 -p 25
[main] INFO org.subethamail.smtp.server.SMTPServer - SMTP server /127.0.0.1:25 starting
[org.subethamail.smtp.server.ServerThread /127.0.0.1:25] INFO org.subethamail.smtp.server.ServerThread - SMTP server /127.0.0.1:25 started
Segmentation fault (core dumped)
root@d260a71663c1:/# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 d260a71663c1 ESMTP SubEthaSMTP null
HELO void.com
250 d260a71663c1
mail from: [email protected]

Docker: Invalid jar

Thanks for publishing on docker hub, however:

$ docker run loopingz/aws-smtp-relay
Error: Invalid or corrupt jarfile /usr/share/aws-smtp-relay/aws-smtp-relay.jar

Thanks πŸ˜ƒ

SSL connection

Hi,

I would like to know if it is possible to setup a SSL connection between the client mail and aws-smtp-relay?

If yes,
How can I do it?

Thank you

From: header required in DATA command

Getting this error when using an application e-mail alerts.

Exception in thread "pool-1-thread-28330" com.amazonaws.services.simpleemail.model.AmazonSimpleEmailServiceException: Missing required header 'From'. (Service: AmazonSimpleEmailService; Status Code: 400; Error Code: InvalidParameterValue; Request ID: xxxxxx)

The program sends from header like this.

MAIL FROM:<[email protected]>

This is not accepted by aws ses which also requires a From: <[email protected]> header in the e-mail or it rejects the API call with the above error.

Will be working to resolve this now.

Code offer: init scripts

Expected behavior

Starting and stopping the SMTP relay on machine start/stop.

Actual behavior

Steps to reproduce the behavior

/usr/local/sbin/start-aws-smtp-relay.sh:

#!/bin/sh
PIDFILE=/var/run/aws-smtp-relay.pid
if [ -e $PIDFILE ]; then
  echo "Found $PIDFILE - relay already running?"
  ps -p `head -1 $PIDFILE` > /dev/null && exit 1 || echo "Relay process not found; starting..."
fi

java -jar /usr/share/aws-smtp-relay/aws-smtp-relay-1.0.0-jar-with-dependencies.jar -r us-east-1 &
echo $! > $PIDFILE

/usr/local/sbin/stop-aws-smtp-relay.sh:

#!/bin/sh
PIDFILE=/var/run/aws-smtp-relay.pid
if [ -e $PIDFILE ]; then
  head -1 $PIDFILE | xargs kill
  rm $PIDFILE
fi

/etc/init.d/aws-smtp-relay:

#!/bin/sh
### BEGIN INIT INFO
# Provides:          aws-smtp-relay
# Required-Start:    $remote_fs $network $named
# Required-Stop:     $remote_fs
# Default-Start:     3 4 5
# Default-Stop:      0 1 2 6
# Short-Description: Relay SMTP traffic to AWS SES
# Description:       Mail relay to convert SMTP traffic to Amazon Simple Email Service API calls.
### END INIT INFO

PIDFILE=/var/run/aws-smtp-relay.pid
case $1 in
  start)
    /bin/sh /usr/local/sbin/start-aws-smtp-relay.sh
  ;;
  stop)
    /bin/sh /usr/local/sbin/stop-aws-smtp-relay.sh
  ;;
  status)
    if [ -e $PIDFILE ]; then
      PID=`head -1 $PIDFILE`
    fi
    if [ "$PID" == "" ]; then
      echo "AWS SMTP relay is not running"
    else
      echo "AWS SMTP relay is running with PID $PID"
    fi
  ;;
  restart)
    /bin/sh /usr/local/sbin/stop-aws-smtp-relay.sh
    /bin/sh /usr/local/sbin/start-aws-smtp-relay.sh
  ;;
esac
exit 0

This could also be adapted to replace the default mail sender, of course, by setting the port to 25 and disabling the other sender.

Version bumps required for several dependencies

In attempting to compile this project according to the instructions in the readme, I observed that the OWASP dependency_check_maven plugin was having trouble grabbing CVE data from NIST (their CVE feed was scuttled a while ago). I bumped the version of this plugin up to 7.0.0 (the most current version available), and re-ran the build. But it failed, after detecting a number of dependencies with known vulnerabilities: I will paste the list below. All of these dependencies, including the dependency_check_maven plugin, need version bumps.

[ERROR] One or more dependencies were identified with vulnerabilities that have a CVSS score greater than or equal to '4.0': [ERROR] [ERROR] commons-cli-1.4.jar: CVE-2021-40111(6.5), CVE-2021-40110(7.5), CVE-2021-38542(5.9), CVE-2021-40525(9.1) [ERROR] commons-io-2.6.jar: CVE-2021-29425(4.8) [ERROR] httpclient-4.5.9.jar: CVE-2020-13956(5.3) [ERROR] jackson-annotations-2.6.0.jar: CVE-2018-1000873(6.5) [ERROR] jackson-core-2.6.7.jar: CVE-2018-1000873(6.5) [ERROR] jackson-databind-2.6.7.3.jar: CVE-2017-17485(9.8), CVE-2018-5968(8.1), CVE-2017-15095(9.8), CVE-2019-16942(9.8), CVE-2020-35491(8.1), CVE-2019-16943(9.8), CVE-2020-25649(7.5), CWE-611: Improper Restriction of XML External Entity Reference ('XXE')(5.4), CVE-2020-35490(8.1), CVE-2019-20330(9.8), CVE-2020-10673(8.8), CVE-2018-11307(9.8), CVE-2018-1000873(6.5), CVE-2018-7489(9.8), CVE-2019-17267(9.8), CVE-2019-17531(9.8), CVE-2019-16335(9.8), CVE-2019-14893(9.8), CVE-2019-14540(9.8) [ERROR] [ERROR] See the dependency-check report for more details.

The application crashes in the docker container

Steps to reproduce the behavior

starting the docker container and sending email requests leads to application crash with the following log:

at com.amazonaws.regions.AwsRegionProviderChain.<clinit>(AwsRegionProviderChain.java:33)
at com.oracle.svm.core.hub.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:347)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:267)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:232)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.amazonaws.client.builder.AwsClientBuilder.<clinit>(AwsClientBuilder.java:60)
at com.oracle.svm.core.hub.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:347)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:267)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:232)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:232)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.loopingz.AwsSmtpRelay.deliver(AwsSmtpRelay.java:38)
at org.subethamail.smtp.helper.SimpleMessageListenerAdapter$Handler.data(SimpleMessageListenerAdapter.java:142)
at org.subethamail.smtp.command.DataCommand.execute(DataCommand.java:64)
at org.subethamail.smtp.server.RequireTLSCommandWrapper.execute(RequireTLSCommandWrapper.java:30)
at org.subethamail.smtp.server.CommandHandler.handleCommand(CommandHandler.java:99)
at org.subethamail.smtp.server.Session.runCommandLoop(Session.java:244)
at org.subethamail.smtp.server.Session.run(Session.java:145)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:473)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)

Exception in thread "pool-2-thread-1" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory
at org.apache.commons.logging.LogFactory.class$(LogFactory.java:847)
at org.apache.commons.logging.LogFactory.(LogFactory.java:1717)
at com.oracle.svm.core.hub.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:347)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:267)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.amazonaws.regions.AwsRegionProviderChain.(AwsRegionProviderChain.java:33)
at com.oracle.svm.core.hub.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:347)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:267)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:232)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.amazonaws.client.builder.AwsClientBuilder.(AwsClientBuilder.java:60)
at com.oracle.svm.core.hub.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:347)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:267)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:232)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:232)
at java.lang.Class.ensureInitialized(DynamicHub.java:437)
at com.loopingz.AwsSmtpRelay.deliver(AwsSmtpRelay.java:38)
at org.subethamail.smtp.helper.SimpleMessageListenerAdapter$Handler.data(SimpleMessageListenerAdapter.java:142)
at org.subethamail.smtp.command.DataCommand.execute(DataCommand.java:64)
at org.subethamail.smtp.server.RequireTLSCommandWrapper.execute(RequireTLSCommandWrapper.java:30)
at org.subethamail.smtp.server.CommandHandler.handleCommand(CommandHandler.java:99)
at org.subethamail.smtp.server.Session.runCommandLoop(Session.java:244)
at org.subethamail.smtp.server.Session.run(Session.java:145)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:473)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)

Docker Logs more verbose

Hi,

Is it possible to have more detail in the logs?
such as :

  • the emails incoming,
  • emails outcoming,
  • email failing,
  • email successfull

Thank you

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.