diff --git a/include/vpopmail.sh b/include/vpopmail.sh index 532394ea..18be5240 100755 --- a/include/vpopmail.sh +++ b/include/vpopmail.sh @@ -43,6 +43,22 @@ install_vpopmail_source() stage_exec sh -c 'cd /data/src/vpopmail; make install' || exit 1 } +vpopmail_port_fixups() { + sed -i '' \ + -e '/pw_name char(32)/ s/char(32)/VARCHAR (64)/' \ + -e '/pw_domain char(96)/ s/char(96)/VARCHAR (96)/' \ + -e '/user char(32)/ s/char(32)/VARCHAR (64)/' \ + -e '/remote_ip char(18)/ s/char(18)/VARCHAR (39)/' \ + -e '/pw_passwd char(40)/ s/char(40)/VARCHAR (128)/' \ + -e '/pw_clear_passwd char(16)/ s/char(16)/VARCHAR (128)/' \ + -e '/pw_gecos char(48)/ s/char(48)/VARCHAR (64)/' \ + -e '/pw_dir char(160)/ s/char(160)/VARCHAR (160)/' \ + -e '/pw_shell char(20)/ s/char(20)/VARCHAR (20)/' \ + -e '/domain CHAR(96)/ s/CHAR(96)/VARCHAR (96)/' \ + -e '/ip_addr char(18)/ s/char(18)/VARCHAR (39)/' \ + $STAGE_MNT/tmp/portbuild/usr/ports/mail/vpopmail/work/vpopmail-5.4.33/vmysql.h +} + install_vpopmail_port() { install_vpopmail_deps @@ -91,7 +107,14 @@ mail_vpopmail_UNSET=$VPOPMAIL_OPTIONS_UNSET fi tell_status "installing vpopmail port with custom options" - stage_port_install mail/vpopmail + + stage_pkg_install pkgconf portconfig + + stage_exec make -C "/usr/ports/mail/vpopmail" extract + vpopmail_port_fixups + stage_exec make -C "/usr/ports/mail/vpopmail" build deinstall install clean || return 1 + + tell_status "port mail/vpopmail installed" } install_qmail() diff --git a/mail-toaster.sh b/mail-toaster.sh index 1b510b85..98eda44d 100755 --- a/mail-toaster.sh +++ b/mail-toaster.sh @@ -888,11 +888,9 @@ stage_port_install() { # $1 is the port directory (eg: mail/dovecot) - jexec "$SAFE_NAME" pkg install -y pkgconf portconfig - # portconfig replaces dialog4ports (as of Oct 2023) + stage_pkg_install pkgconf portconfig - echo "jexec $SAFE_NAME make -C /usr/ports/$1 build deinstall install clean" - jexec "$SAFE_NAME" make -C "/usr/ports/$1" build deinstall install clean || return 1 + stage_exec make -C "/usr/ports/$1" build deinstall install clean || return 1 tell_status "port $1 installed" } diff --git a/provision/elasticsearch.sh b/provision/elasticsearch.sh index a445e528..2b57d00a 100755 --- a/provision/elasticsearch.sh +++ b/provision/elasticsearch.sh @@ -148,13 +148,13 @@ configure_elasticsearch() chown 965 "$_data_conf" sed -i.bak \ - -e "/^#network.host:/ s/#//; s/192.168.0.1/$(get_jail_ip elasticsearch)/" \ + -e "/^network.host:/ s/$(get_jail_ip stage)/$(get_jail_ip elasticsearch)/" \ -e '/^path.data: / s/var/data/' \ -e '/^path.logs: / s/var/data/' \ -e '/^path\./ s/\/elasticsearch//' \ -e '/^#cluster_name/ s/^#//; s/my-application/mail-toaster/' \ - -e '/^#node.name/ s/^#//; s/node-1/mt1/' \ - -e '/^#cluster.initial/ s/^#//; s/node-1/mt1/; s/, "node-2"//' \ + -e '/^node.name/ s/stage/mt1/' \ + -e '/^cluster.initial/ s/stage/mt1/' \ "$_data_conf" if ! grep -qs xpack.security.enabled "$_data_conf"; then diff --git a/provision/haraka.sh b/provision/haraka.sh index c8acb3fa..8d1f834e 100755 --- a/provision/haraka.sh +++ b/provision/haraka.sh @@ -161,7 +161,7 @@ configure_haraka_vpopmail() # shellcheck disable=1004 sed -i.bak \ - -e '/^# auth\/auth_ldap$/a\ + -e '/^# auth\/auth_proxy$/a\ auth\/auth_vpopmaild ' "$HARAKA_CONF/plugins" fi @@ -180,7 +180,7 @@ queue=smtp_forward" | \ if ! grep -qs ^qmail-deliverable "$HARAKA_CONF/plugins"; then tell_status "enabling qmail-deliverable plugin" sed -i.bak \ - -e '/^#qmail-deliverable/ s/#//' \ + -e '/^# qmail-deliverable/ s/# //' \ -e '/^#rcpt_to.qmail_deliverable/ s/#.*/qmail-deliverable/' \ -e 's/^rcpt_to.in_host_list/# rcpt_to.in_host_list/' \ "$HARAKA_CONF/plugins" @@ -215,7 +215,7 @@ configure_haraka_spamassassin() if ! grep -qs ^spamassasssin "$HARAKA_CONF/plugins"; then tell_status "enabling Haraka spamassassin plugin" - sed -i '' -e '/^#spamassassin/ s/#//' "$HARAKA_CONF/plugins" + sed -i '' -e '/^# spamassassin/ s/# //' "$HARAKA_CONF/plugins" fi if [ ! -f "$HARAKA_CONF/spamassassin.ini" ]; then @@ -279,7 +279,7 @@ configure_haraka_clamav() if ! grep -qs ^clamd "$HARAKA_CONF/plugins"; then tell_status "enabling Haraka clamav plugin" - sed -i '' -e '/^#clamd/ s/#//' "$HARAKA_CONF/plugins" + sed -i '' -e '/^# clamd/ s/# //' "$HARAKA_CONF/plugins" fi if ! grep -qs ^clamd_socket "$HARAKA_CONF/clamd.ini"; then @@ -362,10 +362,7 @@ add_headers = always if ! grep -qs ^rspamd "$HARAKA_CONF/plugins"; then tell_status "enabling rspamd plugin" - # shellcheck disable=1004 - sed -i '' -e '/spamassassin$/a\ -rspamd -' "$HARAKA_CONF/plugins" + sed -i '' -e '/^# rspamd/ s/# //' "$HARAKA_CONF/plugins" fi } @@ -373,7 +370,7 @@ configure_haraka_watch() { if ! grep -qs ^watch "$HARAKA_CONF/plugins"; then tell_status "enabling watch plugin" - echo 'watch' >> "$HARAKA_CONF/plugins" + sed -i '' -e '/^# watch/ s/# //' "$HARAKA_CONF/plugins" fi if [ ! -f "$HARAKA_CONF/watch.ini" ]; then @@ -420,15 +417,14 @@ configure_haraka_plugins() # enable a bunch of plugins sed -i.bak \ - -e '/^#process_title/ s/#//' \ - -e '/^#spf$/ s/#//' \ - -e '/^#bounce/ s/#//' \ - -e '/^#data.uribl/ s/#data\.//' \ - -e '/^#uribl/ s/#//' \ - -e '/^#attachment/ s/#//' \ - -e '/^#dkim_sign/ s/#//' \ - -e '/^#karma$/ s/#//' \ - -e '/^# fcrdns/ s/# //' \ + -e '/^# process_title/ s/# //' \ + -e '/^# spf$/ s/# //' \ + -e '/^# bounce/ s/# //' \ + -e '/^# uribl/ s/# //' \ + -e '/^# attachment/ s/# //' \ + -e '/^# dkim/ s/# //' \ + -e '/^# karma/ s/# //' \ + -e '/^# fcrdns/ s/# //' \ "$HARAKA_CONF/plugins" } @@ -457,7 +453,7 @@ configure_haraka_limit() { if ! grep -qs ^limit "$HARAKA_CONF/plugins"; then tell_status "adding limit plugin" - echo 'limit' | tee -a "$HARAKA_CONF/plugins" + sed -i '' -e '/^# limit/ s/# //' "$HARAKA_CONF/plugins" fi if [ ! -f "$HARAKA_CONF/limit.ini" ]; then @@ -510,7 +506,7 @@ dbid=1 server_ip=$(get_jail_ip redis) [deny_excludes] -plugins=send_email, access, helo.checks, data.headers, mail_from.is_resolvable, avg, limit, attachment, tls +plugins=send_email, access, helo.checks, headers, mail_from.is_resolvable, avg, limit, attachment, tls " | tee -a "$HARAKA_CONF/karma.ini" } @@ -587,15 +583,18 @@ configure_haraka_results() [fcrdns] hide=ptr_names,ptr_name_to_ip,ptr_name_has_ips,ptr_multidomain,has_rdns -[data.headers] +[headers] order=fail,pass,msg -[data.uribl] +[uribl] hide=skip [dnsbl] hide=pass +[dns-list] +hide=pass + [qmail-deliverable] order=fail,pass,msg @@ -708,10 +707,6 @@ configure_haraka() configure_haraka_qmail_deliverable configure_haraka_dnsbl - if [ ! -f "$HARAKA_CONF/data.headers.ini" ]; then - echo "reject=no" | tee -a "$HARAKA_CONF/data.headers.ini" - fi - configure_haraka_http configure_haraka_tls configure_haraka_dkim diff --git a/provision/vpopmail.sh b/provision/vpopmail.sh index 1918ec15..15b4116f 100755 --- a/provision/vpopmail.sh +++ b/provision/vpopmail.sh @@ -270,7 +270,6 @@ install_vpopmail() tell_status "installing vpopmail package" stage_pkg_install vpopmail gmake autoconf - #stage_port_install devel/gmake install_vpopmail_port @@ -279,7 +278,6 @@ install_vpopmail() if [ "$TOASTER_MYSQL" = "1" ]; then install_vpopmail_mysql_grants install_vpopmail_mysql_aliastable - alter_vpopmail_tables fi install_qmailadmin @@ -309,6 +307,10 @@ configure_vpopmail() tell_status "ATTN: Your postmaster password is: $_ppass" stage_exec /usr/local/vpopmail/bin/vadddomain "$TOASTER_MAIL_DOMAIN" "$_ppass" fi + + if [ "$TOASTER_MYSQL" = "1" ]; then + alter_vpopmail_tables + fi } start_vpopmail() @@ -364,7 +366,7 @@ migrate_vpopmail_home() + mount += "/data/vpopmail $path/data nullfs rw 0 0"; + mount += "/data/vpopmail/home $path/usr/local/vpopmail nullfs rw 0 0"; } - + dovecot { ip4.addr = 172.16.15.15; ip6.addr = lo1|fd7a:e5cd:1fc1:bc2c:dead:beef:cafe:000f; @@ -372,7 +374,7 @@ migrate_vpopmail_home() - mount += "/data/vpopmail $path/usr/local/vpopmail nullfs rw 0 0"; + mount += "/data/vpopmail/home $path/usr/local/vpopmail nullfs rw 0 0"; } - + 4. start the dovecot and vpopmail jails service jail start vpopmail dovecot