Index: mail/mailhog/Makefile =================================================================== --- /dev/null +++ mail/mailhog/Makefile @@ -0,0 +1,33 @@ +# Created by: punkt.de Hosting Team +# $FreeBSD$ + +PORTNAME= mailhog +PORTVERSION= 1.0.0 +CATEGORIES= mail +MASTER_SITES= https://github.com/mailhog/MailHog/releases/download/v${PORTVERSION}/ +DISTNAME= MailHog_freebsd_${ARCH:S/i//} +DIST_SUBDIR= ${PKGNAME} +EXTRACT_SUFX= + +MAINTAINER= mops@punkt.de +COMMENT= MailHog development mail server + +LICENSE= MIT + +ONLY_FOR_ARCHS= amd64 arm i386 + +USE_RC_SUBR= mailhog + +NO_BUILD= yes +NO_WRKSUBDIR= yes + +PLIST_FILES= sbin/${PORTNAME} +SUB_FILES= pkg-message + +do-extract: + ${CP} ${_DISTDIR}/${DISTNAME} ${WRKSRC} + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/${DISTNAME} ${STAGEDIR}${PREFIX}/sbin/${PORTNAME} + +.include Index: mail/mailhog/distinfo =================================================================== --- /dev/null +++ mail/mailhog/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1502975822 +SHA256 (mailhog-1.0.0/MailHog_freebsd_amd64) = 338866a5a723852563c4f59fb59a53b22831e0ce5f8d788c386bec1243742374 +SIZE (mailhog-1.0.0/MailHog_freebsd_amd64) = 11268161 +SHA256 (mailhog-1.0.0/MailHog_freebsd_386) = a4b97021af85edb8a815679bdf8a5862beb4bdcc665ab58dc54fd1be44682690 +SIZE (mailhog-1.0.0/MailHog_freebsd_386) = 9392192 +SHA256 (mailhog-1.0.0/MailHog_freebsd_arm) = d151956e6ac08ed857be40bc2e2dd71309f031c9fe97ccc1c4782037fcf02820 +SIZE (mailhog-1.0.0/MailHog_freebsd_arm) = 9617591 Index: mail/mailhog/files/mailhog.in =================================================================== --- /dev/null +++ mail/mailhog/files/mailhog.in @@ -0,0 +1,43 @@ +#!/bin/sh + +# PROVIDE: mailhog +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add these lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# mailhog_enable (bool): Set to NO by default. +# Set it to YES to enable mailhog. +# mailhog_bind_addr (ipaddr): Set to the address mailhog should listen on +# for incoming connections. 127.0.0.1 by default. +# mailhog_smtp_port (int): Port to listen on for SMTP. 1025 by default. +# mailhog_api_port (int): Port to listen on for API. 8025 by default. +# mailhog_ui_port (int): Port to listen on for UI. 8025 (same as API) +# by default. +# mailhog_runtimeuser (string): User mailhog should run as. 'nobody' by default. +# +# Please think twice before exposing this server to the Internet. This is an +# insecure tool without any authentication specifically to aid development +# and debugging. Use in controlled environments only is highly recommended. +# + +. /etc/rc.subr + +name="mailhog" +rcvar="mailhog_enable" +pidfile="/var/run/${name}.pid" + +: ${mailhog_enable:="NO"} +: ${mailhog_bind_addr:="127.0.0.1"} +: ${mailhog_smtp_port:="1025"} +: ${mailhog_api_port:="8025"} +: ${mailhog_ui_port:="8025"} +: ${mailhog_runtimeuser:="nobody"} + +load_rc_config "${name}" + +command="/usr/sbin/daemon" +command_args="-c -r -f -P ${pidfile} -u ${mailhog_runtimeuser} %%PREFIX%%/sbin/${name} -api-bind-addr ${mailhog_bind_addr}:${mailhog_api_port} -ui-bind-addr ${mailhog_bind_addr}:${mailhog_ui_port} -smtp-bind-addr ${mailhog_bind_addr}:${mailhog_smtp_port}" + +run_rc_command "$1" Index: mail/mailhog/files/pkg-message.in =================================================================== --- /dev/null +++ mail/mailhog/files/pkg-message.in @@ -0,0 +1,10 @@ + +---------------------------------------------------------------------------- +To run mailhog server on startup, add mailhog_enable="YES" to /etc/rc.conf. + +The SMTP server listens to 127.0.0.1:1025 by default while the web UI can +be reached at http://127.0.0.1:8025/ + +To change this look at the rc.conf variables in %%PREFIX%%/etc/rc.d/mailhog. +---------------------------------------------------------------------------- + Index: mail/mailhog/pkg-descr =================================================================== --- /dev/null +++ mail/mailhog/pkg-descr @@ -0,0 +1,7 @@ +MailHog is an email testing tool for developers: + +Configure your application to use MailHog for SMTP delivery +View messages in the web UI, or retrieve them with the JSON API +Optionally release messages to real SMTP servers for delivery + +WWW: https://github.com/mailhog/MailHog