From 2ac5875c1cf547a849cd9287e42fb76ca2d13ff1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Thu, 25 Apr 2024 14:40:38 -0400 Subject: [PATCH] * Thu Apr 25 2024 Jean-Philippe Pialasse 11.0.0-7.sme - move qmail template from qpsmtpd [SME: 9492] badrcptto,badmailfrom,rcpthosts are for qmail-smtpd, they were used by qpsmtpd as a direct remplacement, some file override them now, moving to qmail alternative would be to drop them as long as qpsmptd is used in front --- createlinks | 16 ++++++++++++++++ .../var/qmail/control/badmailfrom/10sample | 2 ++ .../var/qmail/control/badrcptto/00setup | 9 +++++++++ .../control/badrcptto/10blockVisibleInternal | 16 ++++++++++++++++ .../var/qmail/control/rcpthosts/10standard | 14 ++++++++++++++ .../var/qmail/control/rcpthosts/12LiteralIP | 5 +++++ smeserver-qmail.spec | 8 +++++++- 7 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 root/etc/e-smith/templates/var/qmail/control/badmailfrom/10sample create mode 100644 root/etc/e-smith/templates/var/qmail/control/badrcptto/00setup create mode 100644 root/etc/e-smith/templates/var/qmail/control/badrcptto/10blockVisibleInternal create mode 100644 root/etc/e-smith/templates/var/qmail/control/rcpthosts/10standard create mode 100644 root/etc/e-smith/templates/var/qmail/control/rcpthosts/12LiteralIP diff --git a/createlinks b/createlinks index 72bbc98..a447a07 100755 --- a/createlinks +++ b/createlinks @@ -9,6 +9,8 @@ use File::Path; foreach (qw( + badmailfrom + badrcptto bouncefrom bouncehost concurrencylocal @@ -42,6 +44,20 @@ foreach (qw( )); } +templates2events("/var/qmail/control/badrcptto", qw( + user-create + user-delete + user-modify + group-create + group-delete + group-modify + pseudonym-create + pseudonym-delete + pseudonym-modify + )); +} + + foreach (qw( /var/qmail/alias/.qmail-default /var/qmail/alias/.qmail-localdelivery-default diff --git a/root/etc/e-smith/templates/var/qmail/control/badmailfrom/10sample b/root/etc/e-smith/templates/var/qmail/control/badmailfrom/10sample new file mode 100644 index 0000000..995e8a1 --- /dev/null +++ b/root/etc/e-smith/templates/var/qmail/control/badmailfrom/10sample @@ -0,0 +1,2 @@ +#spamer@spamdomain.com +#@spamdomain.com diff --git a/root/etc/e-smith/templates/var/qmail/control/badrcptto/00setup b/root/etc/e-smith/templates/var/qmail/control/badrcptto/00setup new file mode 100644 index 0000000..7443a6a --- /dev/null +++ b/root/etc/e-smith/templates/var/qmail/control/badrcptto/00setup @@ -0,0 +1,9 @@ +{ + require esmith::AccountsDB; + require esmith::DomainsDB; + + %Accounts = esmith::AccountsDB->as_hash; + %Domains = esmith::DomainsDB->as_hash; + + ""; +} diff --git a/root/etc/e-smith/templates/var/qmail/control/badrcptto/10blockVisibleInternal b/root/etc/e-smith/templates/var/qmail/control/badrcptto/10blockVisibleInternal new file mode 100644 index 0000000..77bf6c4 --- /dev/null +++ b/root/etc/e-smith/templates/var/qmail/control/badrcptto/10blockVisibleInternal @@ -0,0 +1,16 @@ +{ + foreach my $account ( keys %Accounts ) + { + next unless ( exists $Accounts{$account}{Visible} + and $Accounts{$account}{Visible} eq "internal" ); + + $OUT .= "$account\n"; + $OUT .= "$account\@$DomainName\n"; + + foreach my $domain ( keys %Domains ) + { + next unless $Domains{$domain}{type} eq "domain"; + $OUT .= "$account\@$domain\n"; + } + } +} diff --git a/root/etc/e-smith/templates/var/qmail/control/rcpthosts/10standard b/root/etc/e-smith/templates/var/qmail/control/rcpthosts/10standard new file mode 100644 index 0000000..4121442 --- /dev/null +++ b/root/etc/e-smith/templates/var/qmail/control/rcpthosts/10standard @@ -0,0 +1,14 @@ +{ + use esmith::DomainsDB; + + my $ddb = esmith::DomainsDB->open_ro or die "Couldn't open DomainsDB\n"; + + my @rcpt_hosts = ( "$SystemName.$DomainName" ); + + foreach my $domain ( $ddb->get_all_by_prop( type => "domain" ) ) + { + push @rcpt_hosts, $domain->key; + } + + $OUT = join "\n", @rcpt_hosts; +} diff --git a/root/etc/e-smith/templates/var/qmail/control/rcpthosts/12LiteralIP b/root/etc/e-smith/templates/var/qmail/control/rcpthosts/12LiteralIP new file mode 100644 index 0000000..e55b368 --- /dev/null +++ b/root/etc/e-smith/templates/var/qmail/control/rcpthosts/12LiteralIP @@ -0,0 +1,5 @@ +{ + return "" unless (defined $ExternalIP); + + return "[$ExternalIP]"; +} diff --git a/smeserver-qmail.spec b/smeserver-qmail.spec index c58b5ea..ce8f2f6 100644 --- a/smeserver-qmail.spec +++ b/smeserver-qmail.spec @@ -4,7 +4,7 @@ Summary: startup scripts for Dan Bernstein's qmail package %define name smeserver-qmail Name: %{name} %define version 11.0.0 -%define release 6 +%define release 7 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -29,6 +29,12 @@ Provides: e-smith-qmail AutoReqProv: no %changelog +* Thu Apr 25 2024 Jean-Philippe Pialasse 11.0.0-7.sme +- move qmail template from qpsmtpd [SME: 9492] + badrcptto,badmailfrom,rcpthosts are for qmail-smtpd, they were used by qpsmtpd + as a direct remplacement, some file override them now, moving to qmail + alternative would be to drop them as long as qpsmptd is used in front + * Thu Apr 04 2024 Brian Read 11.0.0-6.sme - Update createlinks to create smeserver-package-update event[SME: 12579]