Code Monkey home page Code Monkey logo

fakesmtp's Introduction

FakeSMTP

FakeSMTP is a Free Fake SMTP Server with GUI for testing emails in applications easily. It is written in Java.

Configure your application to use localhost as your SMTP server, and all emails will be intercepted and displayed in this software.

FakeSMTP uses SubEthaSMTP: an easy-to-use server-side SMTP library for Java.

FakeSMTP is free to use for commercial and non-commercial projects and the source code is provided.

It is licensed under the very free BSD or GPL license, whichever you prefer.

Requirements

You need Java JVM 1.6 or newer installed on your machine.

If you are on a "Unix-like" machine (Mac, GNU/Linux, BSD...), you may have to be "root" to start the port 25, otherwise, try another port >= 1024.

Usage

The fakeSMTP.jar is auto-executable. If your desktop environment supports it, you can directly double click on the .jar file. Otherwise, run the following command:

java -jar fakeSMTP-VERSION.jar

If you want to specify the directory where emails will be saved when starting the application, you can use the -o argument:

java -jar fakeSMTP-VERSION.jar -o output_directory_name
java -jar fakeSMTP-VERSION.jar --output-dir output_directory_name

If you want to autostart the SMTP server at launch, you can use the -s argument:

java -jar fakeSMTP-VERSION.jar -s
java -jar fakeSMTP-VERSION.jar --start-server

If you want to autostart the SMTP server without a GUI (background) on a different port and bound to the loopback address:

java -jar fakeSMTP-VERSION.jar -s -b -p 2525 -a 127.0.0.1
java -jar fakeSMTP-VERSION.jar --start-server --background --port 2525 --bind-address 127.0.0.1

If you don't need to save emails on the filesystem (to improve the overall performances), you can use the -m (memory mode) argument:

java -jar fakeSMTP-VERSION.jar -m

To see all the available options (relay domains, custom eml-viewer...):

java -jar fakeSMTP-VERSION.jar --help

Alternatives

FakeSMTP was created because we couldn't find any free (as in freedom) and cross-platform SMTP server with GUI for testing emails in applications or websites. Listed below are some greats alternatives to Fake SMTP:

SMTP4dev

  • Nice features;
  • Open source;
  • Windows only (written in .Net).

DevNull SMTP

  • Lightweight;
  • Closed source;
  • Cross-Platform (written in Java 1.4).

Building it

You need to download and setup Maven. Once installed, go to project directory and run the following command:

mvn package -Dmaven.test.skip

This command will create an executable jar on the target folder.

We recommend you not to skip unit tests.

Once you know how to configure unit tests for this project, stop skipping them.

Running integration tests

To run integration tests, you will first need to launch the application and start the server on port 2525.

java -jar fakeSMTP-VERSION.jar -p 2525 -s

You can then run the following command:

mvn integration-test

Change the default port for unit/integration tests

You need to modify the following file: src/test/java/com/nilhcem/fakesmtp/core/test/TestConfig.java.

Please note that it is better to have two different ports for unit and integrations tests, to avoid any port binding exception while running Maven's integration-test goal.

Usage on Docker

  • Run distributed version: Dockerfile

    `docker build -t="mail" github.com/Nilhcem/FakeSMTP`
    
    `docker run -ti -p 250:25 --privileged=true -v /mail:/output mail`
    
  • Build from source

Get sources from GitHub: Dockerfile

git clone https://github.com/Nilhcem/FakeSMTP
cd FakeSMTP

Build the docker image

mvn package docker:build -DskipTests

Run the docker image

docker run -ti -d fakesmtp

Configure container

  • Map the SMTP port 25 to host:

    -p 250:25

  • Map volume for received mails:

    --privileged=true -v /mail-data:/output

Full command

  • Foward fakesmtp:25 to host port 250,

  • mount host folder /home/fakesmtp/mail as container folder /output

    docker run -ti -d -p 250:25 --privileged=true -v /home/fakesmtp/mail:/output fakesmtp

Contact me

Use my github's nickname (at) gmail (dot) com

fakesmtp's People

Contributors

evrycollin avatar jasonpenny avatar lfuelling avatar nakag avatar nilhcem avatar pawel-piecyk avatar rellem avatar tntim96 avatar vest 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  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  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

fakesmtp's Issues

Line endings altered

Hi,

I liked the simplicity of this tool, so I used it to debug a email sending component.

Unfortunately the code "changes" the data it receives. There a few issues with convertStreamToString():

  • I want to see all headers received, the first 4 lines should not be cut away
  • readLine() works with LF and CRLF, where CRLF is the expected one (according to RFC2821 section 4.1.1.4). When you write it out, you append only LF (on unix). So the data is altered and you don't know what came in originally.

I think it would be better to just read and dump the stream, without modifying it.

Option to choose the email client

I'm using ubuntu 14.04 x86_64 with java 7 and FakeSMTP cannot open emails when I double clicked them.

From your code I can see that you are using Desktop.open() to open the emails. I did a test that fails in my case

import java.awt.*;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

public class TestDesktop {
    public static void main(String[] args) throws IOException {
        boolean desktopSupported = Desktop.isDesktopSupported();
        System.out.println("desktopSupported = " + desktopSupported);
        Desktop desktop = Desktop.getDesktop();
        System.out.println("desktop = " + desktop);
        Path path = Paths.get("/", "home", "fsousa", "xxx.eml");
        boolean exists = path.toFile().exists();
        System.out.println("exists = " + exists);
        desktop.open(path.toFile());
    }
}
desktopSupported = true
desktop = java.awt.Desktop@223d7457
exists = true
Exception in thread "main" java.io.IOException: Failed to show URI:file:/home/fsousa/xxx.eml
    at sun.awt.X11.XDesktopPeer.launch(XDesktopPeer.java:114)
    at sun.awt.X11.XDesktopPeer.open(XDesktopPeer.java:77)
    at java.awt.Desktop.open(Desktop.java:272)
    at com.egoi.megan.TestDesktop.main(TestDesktop.java:17)

Testing with a text file (*.txt) works, but fails for *.eml

Under OSX works fine.

The user should be able to choose another application to open the email.

Thanks
java version "1.7.0_72"
Java(TM) SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)

Uncaught Exception, when going to standby mode will cause fakesmtp crash

When I close my notebook it will go to standby and fakesmtp will always crash.
Until you kill fakesmtp it will produce more and more popups about the exception.

OS: Ubuntu 16.04 TLS
Java: java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

1 Aug 2017 10:25:23 ERROR com.nilhcem.fakesmtp.core.exception.UncaughtExceptionHandler - java.lang.ClassCastException: sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData at sun.java2d.xr.XRPMBlitLoops.cacheToTmpSurface(XRPMBlitLoops.java:148) ~[na:1.8.0_121] at sun.java2d.xr.XrSwToPMBlit.Blit(XRPMBlitLoops.java:356) ~[na:1.8.0_121] at sun.java2d.SurfaceDataProxy.updateSurfaceData(SurfaceDataProxy.java:498) ~[na:1.8.0_121] at sun.java2d.SurfaceDataProxy.replaceData(SurfaceDataProxy.java:455) ~[na:1.8.0_121] at sun.java2d.SurfaceData.getSourceSurfaceData(SurfaceData.java:233) ~[na:1.8.0_121] at sun.java2d.pipe.DrawImage.renderImageCopy(DrawImage.java:566) ~[na:1.8.0_121] at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:67) ~[na:1.8.0_121] at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:1014) ~[na:1.8.0_121] at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3318) ~[na:1.8.0_121] at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3296) ~[na:1.8.0_121] at com.sun.java.swing.plaf.gtk.GTKEngine.paintCachedImage(GTKEngine.java:555) ~[na:1.8.0_121] at com.sun.java.swing.plaf.gtk.GTKPainter.paintButtonBackgroundImpl(GTKPainter.java:291) ~[na:1.8.0_121] at com.sun.java.swing.plaf.gtk.GTKPainter.paintLabelBackground(GTKPainter.java:223) ~[na:1.8.0_121] at javax.swing.plaf.synth.SynthLabelUI.update(SynthLabelUI.java:174) ~[na:1.8.0_121] at javax.swing.JComponent.paintComponent(JComponent.java:780) ~[na:1.8.0_121] at sun.swing.table.DefaultTableCellHeaderRenderer.paintComponent(DefaultTableCellHeaderRenderer.java:158) ~[na:1.8.0_121] at javax.swing.JComponent.paint(JComponent.java:1056) ~[na:1.8.0_121] at javax.swing.CellRendererPane.paintComponent(CellRendererPane.java:151) ~[na:1.8.0_121] at javax.swing.plaf.basic.BasicTableHeaderUI.paintCell(BasicTableHeaderUI.java:710) ~[na:1.8.0_121] at javax.swing.plaf.basic.BasicTableHeaderUI.paint(BasicTableHeaderUI.java:652) ~[na:1.8.0_121] at javax.swing.plaf.synth.SynthTableHeaderUI.paint(SynthTableHeaderUI.java:173) ~[na:1.8.0_121] at javax.swing.plaf.synth.SynthTableHeaderUI.update(SynthTableHeaderUI.java:144) ~[na:1.8.0_121] at javax.swing.JComponent.paintComponent(JComponent.java:780) ~[na:1.8.0_121] at javax.swing.JComponent.paint(JComponent.java:1056) ~[na:1.8.0_121] at javax.swing.JComponent.paintChildren(JComponent.java:889) ~[na:1.8.0_121] at javax.swing.JComponent.paint(JComponent.java:1065) ~[na:1.8.0_121] at javax.swing.JViewport.paint(JViewport.java:728) ~[na:1.8.0_121] at javax.swing.JComponent.paintChildren(JComponent.java:889) ~[na:1.8.0_121] at javax.swing.JComponent.paint(JComponent.java:1065) ~[na:1.8.0_121] at javax.swing.JComponent.paintChildren(JComponent.java:889) ~[na:1.8.0_121] at javax.swing.JComponent.paint(JComponent.java:1065) ~[na:1.8.0_121] at javax.swing.JComponent.paintChildren(JComponent.java:889) ~[na:1.8.0_121] at javax.swing.JComponent.paint(JComponent.java:1065) ~[na:1.8.0_121] at javax.swing.JComponent.paintChildren(JComponent.java:889) ~[na:1.8.0_121] at javax.swing.JComponent.paint(JComponent.java:1065) ~[na:1.8.0_121] at javax.swing.JComponent.paintChildren(JComponent.java:889) ~[na:1.8.0_121] at javax.swing.JComponent.paint(JComponent.java:1065) ~[na:1.8.0_121] at javax.swing.JLayeredPane.paint(JLayeredPane.java:586) ~[na:1.8.0_121] at javax.swing.JComponent.paintChildren(JComponent.java:889) ~[na:1.8.0_121] at javax.swing.JComponent.paint(JComponent.java:1065) ~[na:1.8.0_121] at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210) ~[na:1.8.0_121] at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:290) ~[na:1.8.0_121] at javax.swing.RepaintManager.paint(RepaintManager.java:1272) ~[na:1.8.0_121] at javax.swing.JComponent._paintImmediately(JComponent.java:5158) ~[na:1.8.0_121] at javax.swing.JComponent.paintImmediately(JComponent.java:4969) ~[na:1.8.0_121] at javax.swing.RepaintManager$4.run(RepaintManager.java:854) ~[na:1.8.0_121] at javax.swing.RepaintManager$4.run(RepaintManager.java:814) ~[na:1.8.0_121] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_121] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) ~[na:1.8.0_121] at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814) ~[na:1.8.0_121] at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789) ~[na:1.8.0_121] at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738) ~[na:1.8.0_121] at javax.swing.RepaintManager.access$1200(RepaintManager.java:64) ~[na:1.8.0_121] at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732) ~[na:1.8.0_121] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) ~[na:1.8.0_121] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) ~[na:1.8.0_121] at java.awt.EventQueue.access$500(EventQueue.java:97) ~[na:1.8.0_121] at java.awt.EventQueue$3.run(EventQueue.java:709) ~[na:1.8.0_121] at java.awt.EventQueue$3.run(EventQueue.java:703) ~[na:1.8.0_121] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_121] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) ~[na:1.8.0_121] at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) ~[na:1.8.0_121] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [na:1.8.0_121] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [na:1.8.0_121] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [na:1.8.0_121] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [na:1.8.0_121] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [na:1.8.0_121] at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [na:1.8.0_121]

EML file format - first line

Hello,

my EML files on disk look a bit strange, the first line is a timestamp with some spaces in front.

        Tue, 12 Feb 2019 11:12:02 +0100 (CET)
From: [email protected]
To: [email protected]
Subject: Test

X

My mail program (Evolution) has problems at opening such files. Whats the purpose of this first line and is this a bug?

Thank you,
Manuel

Confused by the newer version

I got version 1.13 from this website:

https://nilhcem.github.io/FakeSMTP/download.html

Then I realized there was a newer version here on Git, so I downloaded that one. However, the newer version doesn't seem to have a .jar file in all the directories I looked in. How come that last version was a simple .jar file download that ran beautifully when I clicked on it, and this version is not so simple?

Please advise.

Thank you.

GUI does not reflect command-line port parameter

When FakeSMTP is started from the command line with a -p parameter, the GUI shows the default 25 value in the Listening port input. It's especially confusing when the server is auto-started (with the -s command line parameter)
fakesmtp

GUI Blank

Thanks for this very useful tool, great job.

Strange GUI

On my dev linux vm I have the issue that the FakeSMTP GUI shows me only the Menu, but I can't see the controls and e-mail list, thats very strange.
From my point it must be some system/os/virtualisation related thing that blocks the gui.

Thanks for analyse and help in advance.

System Details

Ubuntu 17.07 64-bit
Virtualbox 5.8.2r
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
Fake SMTP Server v2.0

2018-03-23 17_03_21-ubuntu17 04 desktop wird ausgefuhrt - oracle vm virtualbox

Setup Instructions For Linux Users

I have been trying for over a month to get this application to work on my Linux Mint 19.1 which has XAMPP installed on it. I tried configuring the php.ini file [mail function] that XAMPP offers to make these two applications work together and I have no luck.

Please make easy step by step instructions.

Feature request: Simple Web UI

Very nice and simple to use application. The docker implementation is very nice as well indeed.

I would love to see the same simple GUI exposed as Web-based UI (over a very simple REST API maybe) - this will help a lot when deploying a Dev environment.

AppImage Or Flatpak

Please make an AppImage or Flatpak for linux users for an easy installation on all Linux distros.

build failure: test fails w/ wrong exception type

[stephan@host:~/cvs/FakeSMTP]$ mvn install
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Fake SMTP
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------

...

Running com.nilhcem.fakesmtp.core.server.SMTPServerHandlerTest
09 Sep 2015 12:50:31 INFO org.subethamail.smtp.server.SMTPServer - SMTP server *:9999999 starting
09 Sep 2015 12:50:31 ERROR com.nilhcem.fakesmtp.server.SMTPServerHandler -
java.lang.IllegalStateException: SMTPServer can only be started once
at org.subethamail.smtp.server.SMTPServer.start(SMTPServer.java:281) ~[subethasmtp-3.1.7.jar:June 16 2012]
at com.nilhcem.fakesmtp.server.SMTPServerHandler.startServer(SMTPServerHandler.java:43) ~[classes/:na]
at com.nilhcem.fakesmtp.core.server.SMTPServerHandlerTest.testOutOfRangePort(SMTPServerHandlerTest.java:19) [test-classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:19) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53) [surefire-junit4-2.10.jar:2.10]
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123) [surefire-junit4-2.10.jar:2.10]
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104) [surefire-junit4-2.10.jar:2.10]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164) [surefire-api-2.10.jar:2.10]
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110) [surefire-booter-2.10.jar:2.10]
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175) [surefire-booter-2.10.jar:2.10]
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107) [surefire-booter-2.10.jar:2.10]
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68) [surefire-booter-2.10.jar:2.10]
09 Sep 2015 12:50:31 INFO org.subethamail.smtp.server.SMTPServer - SMTP server *:9999999 stopping
09 Sep 2015 12:50:31 INFO org.subethamail.smtp.server.ServerThread - SMTP server *:9999999 stopped
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE!
Running com.nilhcem.fakesmtp.core.server.MailServerTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.022 sec

Results :

Tests in error:
testOutOfRangePort(com.nilhcem.fakesmtp.core.server.SMTPServerHandlerTest): Unexpected exception, expected<com.nilhcem.fakesmtp.core.exception.OutOfRangePortException> but was<java.lang.IllegalStateException>

[stephan@host:~/cvs/FakeSMTP]$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Build issue Error injecting: org.codehaus.plexus.archiver.jar.JarArchiver

Getting this error when running package goal


[INFO] --- maven-assembly-plugin:2.5.4:attached (default) @ fakesmtp ---
[WARNING] Error injecting: org.codehaus.plexus.archiver.jar.JarArchiver
java.lang.ExceptionInInitializerError
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:86)
	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
	at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
	at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:89)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
	at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
	at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
	at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
	at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
	at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
	at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
	at org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanScheduler.java:176)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126)
	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
	at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
	at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
	at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
	at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
	at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
	at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
	at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
	at org.codehaus.plexus.archiver.manager.DefaultArchiverManager.getArchiver(DefaultArchiverManager.java:63)
	at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchiver(DefaultAssemblyArchiver.java:302)
	at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:170)
	at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:484)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.<clinit>(AbstractZipArchiver.java:128)
	... 62 more

This is fixed by updating the assembly plugin:

			<!-- Create an executable jar with dependencies -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<archive>
						<manifestFile>${project.basedir}/src/main/resources/META-INF/MANIFEST.MF</manifestFile>
					</archive>
					<!-- Remove the "-jar-with-dependencies" at the end of the file -->
					<appendAssemblyId>false</appendAssemblyId>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>single</goal>
						</goals>
						<phase>package</phase>
					</execution>
				</executions>
			</plugin>

handling of lines starting with . is not quite right

In SMTP lines starting with . have to be changed to two dots to avoid the problem with eof . at the end.
It looks like currently the smtp server removes one . at the first line of the mail data, but not on the following lines.

To verify this, send a mail containing two lines with a single dot each (assuming that your client correctly converts the lines), the mail data will look like this

DATA
Subject: xxx

..
..
.

The received mail then looks like this

Subject: xxx

.
..

i18n messages for pt_BR

Hello,
I'm from Brasil, and I've been using this project for mocking SMTP; when I start the daemon, I've got following message:

[andreyknupp@localhost ~]$ java -jar MockSMTP.jar 
09 Mar 2013 12:34:56 ERROR com.nilhcem.fakesmtp.core.I18n - Can't find bundle for base name i18n/messages, locale pt_BR
09 Mar 2013 12:34:56 INFO  com.nilhcem.fakesmtp.core.I18n - Will use default bundle (en_US) instead

That's in en_US, I've wrote a pt_BR bundle:

# Default path where emails will be saved
emails.default.dir=received-emails

# Main Panel
mainpanel.listening.port=Ligado na porta:
mainpanel.messages.received=Mensagen(s) recebidas:
mainpanel.save.messages=Salvar mensagen(s) para:
mainpanel.tab.mailslist=Lista de e-mails
mainpanel.tab.smtplog=SMTP log
mainpanel.tab.lastmessage=Última mensagem

# Menu Bar
menubar.file=Arquivo
menubar.exit=Sair
menubar.edit=Editar
menubar.messages.location=Localização de mensagens
menubar.help=Ajuda
menubar.about=Sohre
menubar.about.title=%s: Sobre
menubar.about.dialog=Fake SMTP Server v1.3
menubar.about.dialog.link=http://nilhcem.github.com/FakeSMTP/
menubar.mnemo.file=F
menubar.mnemo.exit=x
menubar.mnemo.edit=E
menubar.mnemo.msglocation=l
menubar.mnemo.help=H
menubar.mnemo.about=A

# Clear all button
clearall.button=Limpar todas
clearall.title=%s: Deletar e-mails salvos
clearall.delete.email=Você deseja realmente deletar todos os e-mails salvos ?
clearall.tooltip=Clique aqui para limpar todas as informações e, eventualmente, apagar todos os e-mails recebidos.

# Start server button
startsrv.start=Iniciar servidor
startsrv.stop=Parar servidor
startsrv.err.invalid=Não foi possível iniciar o servidor SMTP (%n), a porta é inválida.
startsrv.err.bound=Não foi possível iniciar o servidor SMTP (%n). Garanta que não há nenhum outro programa utilizando a porta %d.
startsrv.err.bound=Não foi possível iniciar o servidor SMTP (%n). Garanta que a porta: %d está disponível e não está sendo usada por outras aplicações.
startsrv.err.range=Não foi possível utilizar o servidor SMTP (%n) A porta %d está fora do limite.
startsrv.err.default=Erro ao iniciar o servidor SMTP:%n%s.
startsrv.err.title=Erro: %s

# Mails list pane
mailslist.err.open=Não foi possível abrir o arquivo: %s
mailslist.err.find=Não foi possível encontrar o arquivo: %s
mailslist.err.title=Erro: %s
mailslist.col.received=Recebido
mailslist.col.from=De
mailslist.col.to=Para
mailslist.col.subject=Assunto

# Port text field
porttextfield.tooltip=Escreva aqui o número da porta do servidor SMTP.

# Save message field
savemsgfield.tooltip=Clique aqui para abrir uma caixa de seleção de pasta para especificar onde e-mails recebidos serão salvos.

# Directory chooser
dirchooser.title=%s: Localização das mensagens
dirchooser.approve.btn=Selecionar

🍻

Build fails on Windows: UNC path is missing sharename: /\fakeSMTP-2.1-SNAPSHOT.jar

I'm trying to build FakeSMTP's docker image to use it for testing my web application. Sadly, the build fails with the following error:

[INFO] Copying C:\Users\Stephan\Documents\Programme\bulletin\FakeSMTP\target\fakeSMTP-2.1-SNAPSHOT.jar -> C:\Users\Stephan\Documents\Programme\bulletin\FakeSMTP\target\docker\fakeSMTP-2.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.687 s
[INFO] Finished at: 2017-11-12T17:38:07+01:00
[INFO] Final Memory: 28M/377M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.3.2:build (default-cli) on project fakesmtp: Exception caught: UNC path is missing sharename: /\fakeSMTP-2.1-SNAPSHOT.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

The maven command I ran was as follows:

E:\apache-maven-3.5.2\bin\mvn package docker:build -DskipTests

Error generation

A vital part of testing SMTP clients is in error handling. FakeSMTP is great for testing success, but it would be really useful to be able to deliberately provoke specific standard RFC821 and extended RFC3463 error responses, perhaps via special addresses, for example:

[email protected] => 421 4.2.1 Delivery deferred. Please try later
[email protected] => 422 4.2.2 Mailbox full
[email protected] => 550 5.1.1 Unknown User
[email protected] => 550 5.7.1 Rejected by spam filter
[email protected] => 551 5.5.1 Relaying denied (applies to whole domain, not just user)

Postfix's smtp-sink project does this to an extent, but it doesn't have the nice usability that FakeSMTP does. There's a good doc on SMTP errors here.

I think this will largely involve extending MailListener->accept, but I'm not a Java coder...

Provide a real mac application

Hi,

on MacOS X it's common to package jar files (and any other program) into so called application bundles.
I did this for version 1.12 for you. Here is the link: https://www.transferbigfiles.com/2a05acbf-645a-4be9-95c3-28786567e492/skGW_KMjaZ6eeJoxa4fBtQ2

It would be cool to support this feature by default. It's not that complicated. Basically all you have to do is to change the bash script that actually runs "java -jar fakeSMTP-1.12.jar" with the new filename, if it changes.
You're welcome to ask for help if needed.

Cheers
Matthias

Far JAR issue

This is a very useful tool which I am using primarily for integration testing.

However, the published Maven JAR is an uber-JAR containing classes of transitive dependencies thus eliminating control of the classpath and forcing me to use the FakeSMTP source instead (with copyright etc. of course)

Is it possible to use transitive dependencies instead?

[REQUEST] Auto-start server at launch

Hi Nilhcem

FakeSMTP is excellent - really appreciate your work. I was wondering though, would it be possible (eg through a command line parameter) to get the server running as soon as the program is launched? I'd like to have it start when my Mac boots, which is fine, but I have to remember to find the window and start the server itself before running tests (which I inevitably forget to do).

👍 Steve

Emails wont get delivered

Hello,
I am loving your product so far but when I try to run it under Ubuntu 14.04 LTS, Java 1.7 and Postfix I get the following outputs:
Terminal:

# java -jar /FakeSMTP/target/FakeSMTP-2.1-SNAPSHOT.jar -s -p 2525
INFO  org.subethamail.smtp.server.SMTPServer - SMTP server *:2525 starting
INFO  org.subethamail.smtp.server.ServerThread - SMTP server *:2525 started

FakeSMTP after clicking on start:
AM - SMTP server *:2525 started
and when I send an email to [email protected] I get this in the mail.log:

# tail -f /var/log/mail.log
ubuntu postfix/pickup[35673]: 2B7196CF77: uid=33 from=<www-data>
ubuntu postfix/cleanup[35686]: 2B7196CF77: message-id=<[email protected]>
ubuntu postfix/qmgr[35674]: 2B7196CF77: from=<www-data@localhost>, size=18731, nrcpt=1 (queue active)
ubuntu postfix/smtp[35689]: connect to bar.com[104.27.139.186]:25: Connection refused
ubuntu postfix/smtp[35689]: connect to bar.com[104.27.138.186]:25: Connection refused
ubuntu postfix/smtp[35689]: 2B7196CF77: to=<[email protected]>, relay=none, delay=42, delays=0.08/0.01/42/0, dsn=4.4.1, status=deferred (connect to bar.com[104.27.138.186]:25: Connection refused)

Unfortunately no email will show up in the specified output folder nor does FakeSMTP recognize any incoming email.
Did I miss something?

Translation

Could you add a template or tell us where we can define i18n? I'd like to translate this to dutch if you want :)

Minor startup issue.

Hi.

When I load FakeSMTP via ...

`java -jar fakeSMTP-2.0.jar -a 127.0.0.1 -p 25 -s -b -o D:\SMTP`` (yes I'm on Windows).

I get ...

27 May 2015 11:19:12 ERROR com.nilhcem.fakesmtp.core.I18n - Can't find bundle for base name i18n/messages, locale en_GB
27 May 2015 11:19:12 INFO  com.nilhcem.fakesmtp.core.I18n - Will use default bundle (en_US) instead
27 May 2015 11:19:12 INFO  org.subethamail.smtp.server.SMTPServer - SMTP server /127.0.0.1:25 starting
27 May 2015 11:19:12 INFO  org.subethamail.smtp.server.ServerThread - SMTP server /127.0.0.1:25 started

With regard to the locale messages, is there anything important to worry about?

If not, then just close this issue.

Regards,

Richard Quadling.

Ability to read emails via API

It would be nice to have a feature that allows the user to read the emails via some API.

This feature can be used in UI automation or end-to-end tests where the email's content can be verified.

log non-command client data as well

Currently the SMTP log contains the client commands like MAIL FROM and DATA, but not the data that is send inbetween like the auth replies and the actual mail text.

Not sure if it is possible to log that with the SMTP library, if possible, this would be very useful.

Using in application unit tests

I know FakeSMTP has its own unit tests but it is possible to include the FakeSMTP in the class path of a application and have the application use FakeSMTP for the application's own unit tests?

e.g. the app's unit tests could query FakeSMTP via some Java API methods to test whether a particular email (with given time, to/from email address, subject and/or body criteria) had been dispatched to it from the application?

A friend was using another similar tool (which did not have FakeSMTP's very useful GUI) which allowed for this kind of unit test funkiness and so I thought it would be great if FakeSMTP offered this - if it doesn't already.

support for auth plain (and maybe other auth modes)

For testing, it would be good to have different auth modes available and maybe also to be able to switch them on and off.

auth plain should be quite simple, other auth modes like cram-md5 could be faked with e.g. bouncycastle.

this would be helpful to test handling of login errors, e.g. if the client retries transmission on auth failure or not.

No EML Reader

In my system (without a mailClient), when I try to open the eml file, I receive an error.

       12 Dez 2013 22:11:00 ERROR com.nilhcem.fakesmtp.gui.tab.MailsListPane - java.io.IOException: Failed to open E:\Users\Aron Rodrigues\Desktop\received-emails\121213100900205.eml. Error message: A device attached to the system is not functioning.
        at sun.awt.windows.WDesktopPeer.ShellExecute(WDesktopPeer.java:76) ~[na:1.7.0_40]
        at sun.awt.windows.WDesktopPeer.open(WDesktopPeer.java:54) ~[na:1.7.0_40]
        at java.awt.Desktop.open(Desktop.java:272) ~[na:1.7.0_40]
        at com.nilhcem.fakesmtp.gui.tab.MailsListPane$3.mouseClicked(MailsListPane.java:118) ~[fakeSMTP-1.5.jar:na]
        at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270) [na:1.7.0_40]
        at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:269) [na:1.7.0_40]
        at java.awt.Component.processMouseEvent(Component.java:6508) [na:1.7.0_40]
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3320) [na:1.7.0_40]
        at java.awt.Component.processEvent(Component.java:6270) [na:1.7.0_40]
        at java.awt.Container.processEvent(Container.java:2229) [na:1.7.0_40]
        at java.awt.Component.dispatchEventImpl(Component.java:4861) [na:1.7.0_40]
        at java.awt.Container.dispatchEventImpl(Container.java:2287) [na:1.7.0_40]
        at java.awt.Component.dispatchEvent(Component.java:4687) [na:1.7.0_40]
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832) [na:1.7.0_40]
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4501) [na:1.7.0_40]
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422) [na:1.7.0_40]
        at java.awt.Container.dispatchEventImpl(Container.java:2273) [na:1.7.0_40]
        at java.awt.Window.dispatchEventImpl(Window.java:2719) [na:1.7.0_40]
        at java.awt.Component.dispatchEvent(Component.java:4687) [na:1.7.0_40]
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735) [na:1.7.0_40]
        at java.awt.EventQueue.access$200(EventQueue.java:103) [na:1.7.0_40]
        at java.awt.EventQueue$3.run(EventQueue.java:694) [na:1.7.0_40]
        at java.awt.EventQueue$3.run(EventQueue.java:692) [na:1.7.0_40]
        at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_40]
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) [na:1.7.0_40]
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) [na:1.7.0_40]
        at java.awt.EventQueue$4.run(EventQueue.java:708) [na:1.7.0_40]
        at java.awt.EventQueue$4.run(EventQueue.java:706) [na:1.7.0_40]
        at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_40]
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) [na:1.7.0_40]
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:705) [na:1.7.0_40]
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) [na:1.7.0_40]
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:161) [na:1.7.0_40]        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) [na:1.7.0_40]
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) [na:1.7.0_40]
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) [na:1.7.0_40]
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) [na:1.7.0_40]

May I contribute with an eml reader?

Windows is not refreshed on linux

Hello

When a mail is received the windows content is not refreshed (at least on linux running oracle jdk 1.8).
Only way to force the refresh is to resize the window.

Looking at the code I see that the gui operations are not done in the dispatch thread as it should be from what I remember in swing, not sure how to fix this cleanly in the meantime I'm forcing a repaint of the mainpanel (ugly) but that fixes the issue.

Could you put the program into maven repo

I wonder if you could put the program into the maven central repository, I think this would be useful for running integration tests in a continuous integration service like travis or cloudbees

IPv issues with Java 8

"If I want to use FakeSMTP with Java 8, I have to specify that it should use the IPv4 stack instead of the IPv6 stack. Otherwise, FakeSMTP doesn’t work properly."

Consistent Command Line Argument and UI Options Handling

It seems that there are two different ways to handle updating the UIModel with options from ArgsHandler: com.nilhcem.fakesmtp.core.ArgsHandler#handleArgs vs com.nilhcem.fakesmtp.gui.MainPanel#checkArgs. It would be good to make them consistent. I don't mind making the change one way or the other, but I am not sure which way is the prefered handling. It seems like MainPanel#checkArgs is the more logical choice, since it is UI related.

Improvement: Display received messages with date, time and timezone

The current FakeSMTP user interface (version 2.0) only displays the time when an email message was received.

e.g.

04:17:44 PM

When the FakeSMTP application is running as a service for more than one day, it will be helpful to display the date, time and timezone from the received email header.

e.g.

Thu, 16 Feb 2017 04:17:44 PM +0800 (AWST)

NOTE: The received email table header date label formatting is managed in class "com.nilhcem.fakesmtp.gui.tab.MailsListPane".

Linux: Cannot Start SMTP Server Port 25

I get an error when I try to start FakeSMTP on port 25.

Can't start SMTP Server
Make sure the port 25 is available and not used by other applications.

I am using Linux Mint 19.1 and I even did a fresh install of Linux Mint 19.1 and I still get this error. I didn't have this on Windows 10.

I was wondering how I can find out what application is using port 25 and how to disable it so FakeSMTP can use port 25.

Crash in FakeSMTP server when using C# SmtpClient with Authentication

When I try an authenticated session to FakeSMTP server using a C# SmtpClient, the server crashes:

17 Dec 2013 12:09:42 INFO org.subethamail.smtp.server.SMTPServer - SMTP server *:25 starting
17 Dec 2013 12:09:42 INFO org.subethamail.smtp.server.ServerThread - SMTP server *:25 started
17 Dec 2013 12:10:01 DEBUG org.subethamail.smtp.server.Session - SMTP connection from localhost/127.0.0.1, new connection count: 1
17 Dec 2013 12:10:01 DEBUG org.subethamail.smtp.server.Session - Server: 220 build-cct.sal-eng.nl ESMTP SubEthaSMTP null
17 Dec 2013 12:10:01 DEBUG org.subethamail.smtp.server.Session - Client: EHLO build-cct
17 Dec 2013 12:10:01 DEBUG org.subethamail.smtp.server.Session - Server: 250-build-cct.sal-eng.nl
250-8BITMIME
250-AUTH LOGIN
250 Ok
17 Dec 2013 12:10:01 DEBUG org.subethamail.smtp.server.Session - Client: AUTH login aWtrZQ==
17 Dec 2013 12:10:01 DEBUG org.subethamail.smtp.server.Session - Server: 334 VXNlcm5hbWU6
17 Dec 2013 12:10:01 DEBUG org.subethamail.smtp.server.Session - Server: 334 UGFzc3dvcmQ6
17 Dec 2013 12:10:01 ERROR org.subethamail.smtp.server.Session - Unexpected error in the SMTP handler thread
java.lang.NullPointerException: null
at org.subethamail.smtp.command.AuthCommand.execute(AuthCommand.java:88) ~[fakeSMTP-1.5.jar:na]
at org.subethamail.smtp.server.RequireTLSCommandWrapper.execute(RequireTLSCommandWrapper.java:27) ~[fakeSMTP-1.5.jar:na]
at org.subethamail.smtp.server.CommandHandler.handleCommand(CommandHandler.java:98) ~[fakeSMTP-1.5.jar:na]
at org.subethamail.smtp.server.Session.runCommandLoop(Session.java:222) ~[fakeSMTP-1.5.jar:na]
at org.subethamail.smtp.server.Session.run(Session.java:125) ~[fakeSMTP-1.5.jar:na]
17 Dec 2013 12:10:01 DEBUG org.subethamail.smtp.server.Session - Server: 421 4.3.0 Mail system failure, closing transmission channel

17 Dec 2013 12:10:01 ERROR com.nilhcem.fakesmtp.core.exception.UncaughtExceptionHandler -
java.lang.NullPointerException: null
at org.subethamail.smtp.command.AuthCommand.execute(AuthCommand.java:88) ~[fakeSMTP-1.5.jar:na]
at org.subethamail.smtp.server.RequireTLSCommandWrapper.execute(RequireTLSCommandWrapper.java:27) ~[fakeSMTP-1.5.jar:na]
at org.subethamail.smtp.server.CommandHandler.handleCommand(CommandHandler.java:98) ~[fakeSMTP-1.5.jar:na]
at org.subethamail.smtp.server.Session.runCommandLoop(Session.java:222) ~[fakeSMTP-1.5.jar:na]
at org.subethamail.smtp.server.Session.run(Session.java:125) ~[fakeSMTP-1.5.jar:na]

UTF-8 mail address not working

I'm using fakeSmtp for unit testing in my .Net Core project with random generated test data by Faker.Net.
Sending a mail with characters that are not part of ASCII leads to the following exception:

Message: System.Net.Mail.SmtpException : The client or server is only configured for E-mail addresses with ASCII local-parts: valentina_mö[email protected].

In my configuration I set the host to localhost, the port to 25 and the DeliveryFormat to SmtpDeliveryFormat.International.

When creating a mailAddress object I use Encoding.Utf8.

How can I use FakeSMTP to send mails with UTF-8 encoded mail addresses? Thank you

Don't see button "Stop Server"

I start FakeSMTP 2.0 on Windows 10 x64 but don't see the button "Stop Server" after click start server. I must manually close then reopen the program.

MacOS High Sierra FakeSMTP Exception thrown NoClassDefFoundError

I am trying to run FakeSMTP on MacOS High Sierra with installed MAMP Pro.
When I run the FakeSMTP server (port 2525) and the integration test I receive the following error:

Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "org.subethamail.smtp.server.ServerThread *:2525"

I have update my java JSD and SE from 1.8.0_25 to 9.0.1+11 without any other outcome than the above given exception.

Also I get the following error in the mvn integration test:
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "localhost", port 2525, isSSL false
DEBUG SMTP: exception reading response: java.net.SocketTimeoutException: Read timed out

It makes no difference to run with or without MAMP(Pro).

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.