Skip to content

Commit

Permalink
mail/mailhog: Add sysrc variable to set hostname parameter
Browse files Browse the repository at this point in the history
This patch adds the sysrc variable "mailhog_hostname".
By setting the variable, we can configure the hostname mailhog uses for
EHLO/HELO and message IDs

PR:		272130
  • Loading branch information
einsibjarni authored and nunotexbsd committed Jul 31, 2023
1 parent 002164a commit 3f78f6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mail/mailhog/Makefile
@@ -1,7 +1,7 @@
PORTNAME= mailhog
DISTVERSIONPREFIX= v
DISTVERSION= 1.0.1
PORTREVISION= 11
PORTREVISION= 12
CATEGORIES= mail devel

MAINTAINER= mops@punkt.de
Expand Down
5 changes: 4 additions & 1 deletion mail/mailhog/files/mailhog.in
Expand Up @@ -16,6 +16,8 @@
# 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.
# mailhog_hostname (string): Hostname to use for EHLO/HELO and message IDs.
# mailhog.example.com by default.
#
# Please think twice before exposing this server to the Internet. This is an
# insecure tool without any authentication specifically to aid development
Expand All @@ -34,10 +36,11 @@ pidfile="/var/run/${name}.pid"
: ${mailhog_api_port:="8025"}
: ${mailhog_ui_port:="8025"}
: ${mailhog_runtimeuser:="nobody"}
: ${mailhog_hostname:="mailhog.example"}

load_rc_config "${name}"

command="/usr/sbin/daemon"
command_args="-c -r -f -P ${pidfile} -u ${mailhog_runtimeuser} %%PREFIX%%/bin/${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}"
command_args="-c -r -f -P ${pidfile} -u ${mailhog_runtimeuser} %%PREFIX%%/bin/${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} -hostname ${mailhog_hostname}"

run_rc_command "$1"

0 comments on commit 3f78f6f

Please sign in to comment.