GreenMail.Server (greenmail v0.1.0)

Copy Markdown View Source

OTP GenServer that manages the GreenMail Java process.

Starts GreenMail standalone JAR as a port process. The Java process dies when the GenServer dies — no orphans.

Options

  • :smtp_port — SMTP port (default: 3025)
  • :imap_port — IMAP port (default: 3143)
  • :jar_path — Path to greenmail-standalone.jar (default: auto-detect from priv/)
  • :java_path — Path to java executable (default: auto-detect)
  • :startup_timeout — Max ms to wait for ports (default: 8000)
  • :supervisor — Supervisor name for stop/start (default: caller must set)

Summary

Functions

Returns a specification to start this module under a supervisor.

Restart: stop + start. Flushes all in-memory emails.

Start the mail server after a manual stop.

Stop the mail server. Kills the Java process and waits for ports to free.

Functions

api_port()

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

imap_port()

restart()

Restart: stop + start. Flushes all in-memory emails.

running?()

smtp_port()

start()

Start the mail server after a manual stop.

start_link(opts \\ [])

status()

stop()

Stop the mail server. Kills the Java process and waits for ports to free.