From 89566576f128486e84b6f14078290483342b0ac6 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Mon, 9 Dec 2024 23:37:37 -0500 Subject: [PATCH] * Tue Dec 03 2024 Jean-Philippe Pialasse 11.0.1-1.sme - initial release of smeserver-mini-qmail from former smeserver-qmail . only for final delivery or forward behind qpsmtpd and postfix . set /var/qmail/control/qmqpservers server file . set junkmail delivery to dovecot-lda . we only need configs idhost, qmqpservers, me, defaultdomain, plusdomain, rcpthosts . removing controls badrcptto,helohost,smtproutes,rcpthosts,badmailfrom,databytes,bouncefrom, bouncehost,concurrencylocal,concurrencyremote,doublebouncehost,doublebounceto,envnoathost . removing /var/qmail/users . removing alias . cleaning actions scripts (TODO: move pseudonym-cleanup to smeserver-email) --- README.md | 20 ++- createlinks | 112 +------------ .../e-smith/events/actions/qmail-delete-group | 36 ----- root/etc/e-smith/events/actions/qmail-ipup | 26 ---- .../e-smith/events/actions/qmail-update-group | 112 ------------- .../.qmail-junkmail/10deliver_to_junkmail | 1 + .../var/qmail/alias/.qmail-default/50body | 5 - .../qmail/alias/.qmail-group/50group_members | 5 - .../alias/.qmail-localdelivery-default/50body | 1 - .../var/qmail/alias/.qmail-shared/50body | 13 -- .../var/qmail/control/badmailfrom/10sample | 2 - .../var/qmail/control/badrcptto/00setup | 9 -- .../control/badrcptto/10blockVisibleInternal | 16 -- .../templates/var/qmail/control/bouncefrom | 1 - .../templates/var/qmail/control/bouncehost | 1 - .../var/qmail/control/concurrencylocal | 1 - .../var/qmail/control/concurrencyremote | 1 - .../templates/var/qmail/control/databytes | 1 - .../var/qmail/control/doublebouncehost | 1 - .../var/qmail/control/doublebounceto | 1 - .../templates/var/qmail/control/envnoathost | 1 - .../templates/var/qmail/control/helohost | 1 - .../templates/var/qmail/control/idhost | 1 + .../templates/var/qmail/control/qmqpservers | 1 + .../var/qmail/control/rcpthosts/10standard | 14 -- .../var/qmail/control/rcpthosts/12LiteralIP | 5 - .../var/qmail/control/smtproutes/00README | 25 --- .../control/smtproutes/10delegateMailServer | 17 -- .../qmail/control/smtproutes/20SMTPSmartHost | 28 ---- .../templates/var/qmail/users/assign/30admin | 32 ---- .../templates/var/qmail/users/assign/40alias | 32 ---- .../templates/var/qmail/users/assign/45shared | 36 ----- .../templates/var/qmail/users/assign/50system | 56 ------- .../templates/var/qmail/users/assign/60users | 59 ------- .../var/qmail/users/assign/70pseudonyms | 147 ------------------ .../templates/var/qmail/users/assign/80groups | 51 ------ .../var/qmail/users/assign/template-begin | 0 .../var/qmail/users/assign/template-end | 1 - root/service/qmail | 1 - root/usr/lib/systemd/system/qmail.service | 15 -- root/var/qmail/control/qmqpservers | 1 + root/var/service/qmail/down | 0 root/var/service/qmail/log/run | 30 ---- .../service/qmail/log/supervise/.gitignore | 0 root/var/service/qmail/run | 32 ---- root/var/service/qmail/supervise/.gitignore | 0 smeserver-mini-qmail.spec | 27 ++-- 47 files changed, 37 insertions(+), 941 deletions(-) delete mode 100644 root/etc/e-smith/events/actions/qmail-delete-group delete mode 100644 root/etc/e-smith/events/actions/qmail-ipup delete mode 100644 root/etc/e-smith/events/actions/qmail-update-group delete mode 100644 root/etc/e-smith/templates/var/qmail/alias/.qmail-default/50body delete mode 100644 root/etc/e-smith/templates/var/qmail/alias/.qmail-group/50group_members delete mode 100644 root/etc/e-smith/templates/var/qmail/alias/.qmail-localdelivery-default/50body delete mode 100644 root/etc/e-smith/templates/var/qmail/alias/.qmail-shared/50body delete mode 100644 root/etc/e-smith/templates/var/qmail/control/badmailfrom/10sample delete mode 100644 root/etc/e-smith/templates/var/qmail/control/badrcptto/00setup delete mode 100644 root/etc/e-smith/templates/var/qmail/control/badrcptto/10blockVisibleInternal delete mode 100644 root/etc/e-smith/templates/var/qmail/control/bouncefrom delete mode 100644 root/etc/e-smith/templates/var/qmail/control/bouncehost delete mode 100644 root/etc/e-smith/templates/var/qmail/control/concurrencylocal delete mode 100644 root/etc/e-smith/templates/var/qmail/control/concurrencyremote delete mode 100644 root/etc/e-smith/templates/var/qmail/control/databytes delete mode 100644 root/etc/e-smith/templates/var/qmail/control/doublebouncehost delete mode 100644 root/etc/e-smith/templates/var/qmail/control/doublebounceto delete mode 100644 root/etc/e-smith/templates/var/qmail/control/envnoathost delete mode 100644 root/etc/e-smith/templates/var/qmail/control/helohost create mode 100644 root/etc/e-smith/templates/var/qmail/control/idhost create mode 100644 root/etc/e-smith/templates/var/qmail/control/qmqpservers delete mode 100644 root/etc/e-smith/templates/var/qmail/control/rcpthosts/10standard delete mode 100644 root/etc/e-smith/templates/var/qmail/control/rcpthosts/12LiteralIP delete mode 100644 root/etc/e-smith/templates/var/qmail/control/smtproutes/00README delete mode 100644 root/etc/e-smith/templates/var/qmail/control/smtproutes/10delegateMailServer delete mode 100644 root/etc/e-smith/templates/var/qmail/control/smtproutes/20SMTPSmartHost delete mode 100644 root/etc/e-smith/templates/var/qmail/users/assign/30admin delete mode 100644 root/etc/e-smith/templates/var/qmail/users/assign/40alias delete mode 100644 root/etc/e-smith/templates/var/qmail/users/assign/45shared delete mode 100644 root/etc/e-smith/templates/var/qmail/users/assign/50system delete mode 100644 root/etc/e-smith/templates/var/qmail/users/assign/60users delete mode 100644 root/etc/e-smith/templates/var/qmail/users/assign/70pseudonyms delete mode 100644 root/etc/e-smith/templates/var/qmail/users/assign/80groups delete mode 100644 root/etc/e-smith/templates/var/qmail/users/assign/template-begin delete mode 100644 root/etc/e-smith/templates/var/qmail/users/assign/template-end delete mode 120000 root/service/qmail delete mode 100644 root/usr/lib/systemd/system/qmail.service create mode 100644 root/var/qmail/control/qmqpservers delete mode 100644 root/var/service/qmail/down delete mode 100644 root/var/service/qmail/log/run delete mode 100644 root/var/service/qmail/log/supervise/.gitignore delete mode 100644 root/var/service/qmail/run delete mode 100644 root/var/service/qmail/supervise/.gitignore diff --git a/README.md b/README.md index 04199ce..7eaa1ad 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,24 @@ Show list of outstanding bugs: [In progress](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=IN_PROGRESS&cf_package=smeserver-mini-qmail&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced) [Resolved](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=RESOLVED&cf_package=smeserver-mini-qmail&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced) [Verified](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=VERIFIED&cf_package=smeserver-mini-qmail&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced) -And a list of outstanding Legacy bugs: (e-smith-qmail) [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-qmail&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) ## Description -
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* -*Once it has been checked, then this comment will be deleted* -
smeserver-mini-qmail is wrapper to configure qmail for final deivery only and send external email to a qmp server handle by another service. qmail is an open source email server software designed to facilitate email communication for small- and medium-sized businesses. It is highly customizable, with support for multiple domains, virtual domains, forwarding, aliases, and mailing lists, and its features can be adapted to meet the specific communication needs of any organization. With its straightforward web-based administration interface, smeserver-mini-qmail can be easily configured for optimal security and performance. Additionally, its advanced spam filtering technology helps to ensure that email communication remains safe and secure for both senders and recipients. + +the mini-qmail configuration with extra qmail-local support only serves for final delivery and forward to a qmqp server. + +## properties available + $qmail{DeliveryType} + $qmail{DeliveryInstruction} + $props{Filter} ||= 'yes'; + $props{EmailForward} ||= 'local' + $props{EmailForward} =~ /^(forward|both)$/ + $props{ForwardAddress} + $prop{'EveryoneEmail'} + $EmailUnknownUser + +## Sources to adapt this package +* http://cr.yp.to/qmail/mini.html +* https://johnleach.co.uk/documents/qmail-to-postfix/ diff --git a/createlinks b/createlinks index a56ac44..37a0f73 100755 --- a/createlinks +++ b/createlinks @@ -4,28 +4,15 @@ use esmith::Build::CreateLinks qw(:all); use File::Basename; use File::Path; -# email-conf - console-save, bootstrap-console-save, domain-create, domain-delete, -# ip-change, email-update, host-create, host-delete, host-modify, post-upgrade -# rcpthosts template was in smeserver qpsmtpd, and not used if qpsmtpd in use anymore foreach (qw( - badmailfrom - badrcptto - bouncefrom - bouncehost - concurrencylocal - concurrencyremote - databytes defaultdomain defaulthost - doublebounceto - envnoathost - helohost - locals + idhost + locals me plusdomain - rcpthosts - smtproutes + qmqpservers virtualdomains )) { @@ -45,41 +32,6 @@ 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 - )) -{ - templates2events($_, qw( - console-save - bootstrap-console-save - domain-create - domain-delete - ip-change - email-update - host-create - host-delete - host-modify - post-upgrade - smeserver-mini-qmail-update - )); -} - -templates2events("/var/qmail/alias/.qmail-shared" , qw(bootstrap-console-save user-create user-modify user-delete)); #-------------------------------------------------- # actions for console-save event: @@ -87,12 +39,6 @@ templates2events("/var/qmail/alias/.qmail-shared" , qw(bootstrap-console-save us #-------------------------------------------------- $event = "console-save"; -# If qmail-send is running, it will receive the SIGHUP and ignore the -# start command. If it is not running then the signal will be ignored -# and qmail-send will read its new configuration files anyway. - -safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); - #-------------------------------------------------- # actions for bootstrap-console-save event: # write config files and create startup link @@ -100,10 +46,7 @@ safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); $event = "bootstrap-console-save"; event_link("pseudonym-cleanup", $event, "03"); -event_link("qmail-update-group", $event, "20"); event_link("qmail-update-user", $event, "55"); -templates2events("/var/qmail/users/assign", $event); -safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55email-assign"); #-------------------------------------------------- # actions for domain-create event: @@ -111,25 +54,12 @@ safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55ema #-------------------------------------------------- $event = "domain-create"; -# If qmail-send is running, it will receive the SIGHUP and ignore the -# start command. If it is not running then the signal will be ignored -# and qmail-send will read its new configuration files anyway. - -safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); - #-------------------------------------------------- # actions for domain-delete event: # rewrite config files and restart server #-------------------------------------------------- $event = "domain-delete"; - -# If qmail-send is running, it will receive the SIGHUP and ignore the -# start command. If it is not running then the signal will be ignored -# and qmail-send will read its new configuration files anyway. - -safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); - #-------------------------------------------------- # actions for email-update event: # email parameters have been changed in the e-smith @@ -142,24 +72,12 @@ $event = "email-update"; event_link("qmail-update-user", $event, "03"); event_link("pseudonym-cleanup", $event, "30"); -# If qmail-send is running, it will receive the SIGHUP and ignore the -# start command. If it is not running then the signal will be ignored -# and qmail-send will read its new configuration files anyway. - -safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); -safe_symlink("adjust", "root/etc/e-smith/events/$event/services2adjust/masq"); -safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/smtp-auth-proxy"); - #-------------------------------------------------- # actions for group-create event: #-------------------------------------------------- $event = "group-create"; event_link("pseudonym-cleanup", $event, "03"); -event_link("qmail-update-group", $event, "20"); -templates2events("/var/qmail/users/assign", $event); -safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55email-assign"); -safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); #-------------------------------------------------- # actions for group-delete event: @@ -167,10 +85,6 @@ safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); $event = "group-delete"; event_link("pseudonym-cleanup", $event, "03"); -event_link("qmail-delete-group", $event, "20"); -templates2events("/var/qmail/users/assign", $event); -safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55email-assign"); -safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); #-------------------------------------------------- # actions for group-modify event: @@ -178,10 +92,6 @@ safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); $event = "group-modify"; event_link("pseudonym-cleanup", $event, "03"); -event_link("qmail-update-group", $event, "20"); -templates2events("/var/qmail/users/assign", $event); -safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55email-assign"); -safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); #-------------------------------------------------- # actions for user-create event: @@ -189,7 +99,6 @@ safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); $event = "user-create"; event_link("qmail-update-user", $event, "20"); -event_link("qmail-update-group", $event, "20"); #-------------------------------------------------- # actions for user-modify event @@ -197,7 +106,6 @@ event_link("qmail-update-group", $event, "20"); $event = "user-modify"; event_link("qmail-update-user", $event, "20"); -event_link("qmail-update-group", $event, "20"); #-------------------------------------------------- # actions for user-modify-admin event @@ -211,30 +119,20 @@ event_link("qmail-update-user", $event, "20"); #-------------------------------------------------- $event = "user-delete"; -event_link("qmail-update-group", $event, "25"); - #-------------------------------------------------- # actions for ip-up event: #-------------------------------------------------- $event = "ip-up"; -event_link("qmail-ipup", $event, "20"); - #-------------------------------------------------- # actions for ip-change event: #-------------------------------------------------- $event = "ip-change"; -safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); - #-------------------------------------------------- # actions for smeserver-mini-qmail-update event: #-------------------------------------------------- $event = "smeserver-mini-qmail-update"; - -safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/qmail"); -event_link("systemd-reload", $event, "89"); -event_link("systemd-default", $event, "88"); event_link("pseudonym-cleanup", $event, "03"); #-------------------------------------------------- @@ -246,11 +144,7 @@ foreach $event ( qw(pseudonym-create pseudonym-modify pseudonym-delete { event_link("pseudonym-cleanup", $event, "03"); templates2events("/var/qmail/control/virtualdomains", $event); - templates2events("/var/qmail/users/assign", $event); - safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55email-assign"); - safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail"); } safe_symlink(".qmail", "root/home/e-smith/.qmail-default"); -safe_symlink(".qmail-shared", "root/var/qmail/alias/.qmail-shared-default"); diff --git a/root/etc/e-smith/events/actions/qmail-delete-group b/root/etc/e-smith/events/actions/qmail-delete-group deleted file mode 100644 index 0c2aa0d..0000000 --- a/root/etc/e-smith/events/actions/qmail-delete-group +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/perl -w - -#---------------------------------------------------------------------- -# copyright (C) 1999-2005 MItel Networks Corporation -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#---------------------------------------------------------------------- - -package esmith; - -use strict; -use Errno; - -my $event = $ARGV [0]; -my $groupName = $ARGV [1]; - -die "Groupname argument missing." unless defined ($groupName); - -$groupName =~ s/\./:/g; -unlink "/var/qmail/alias/.qmail-$groupName"; -unlink "/var/qmail/alias/.qmail-$groupName-default"; - -exit (0); diff --git a/root/etc/e-smith/events/actions/qmail-ipup b/root/etc/e-smith/events/actions/qmail-ipup deleted file mode 100644 index ebcc1fd..0000000 --- a/root/etc/e-smith/events/actions/qmail-ipup +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -#---------------------------------------------------------------------- -# copyright (C) 2001-2006 Mitel Networks Corporation -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#---------------------------------------------------------------------- -#------------------------------------------------------------ -# Reset qmail TCP timeouts, and tell qmail-send to retry sending -#------------------------------------------------------------ - -/var/qmail/bin/qmail-tcpok -exec sv alarm /service/qmail diff --git a/root/etc/e-smith/events/actions/qmail-update-group b/root/etc/e-smith/events/actions/qmail-update-group deleted file mode 100644 index 2853906..0000000 --- a/root/etc/e-smith/events/actions/qmail-update-group +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/perl -w - -#---------------------------------------------------------------------- -# copyright (C) 2002-2006 Mitel Networks Corporation -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#---------------------------------------------------------------------- - -package esmith; - -use strict; -use Errno; -use esmith::ConfigDB; -use esmith::AccountsDB; -use esmith::util; - -my $c = esmith::ConfigDB->open_ro || die "Couldn't open config db\n"; -my $a = esmith::AccountsDB->open_ro || die "Couldn't open accounts db\n"; - -my $event = $ARGV [0] || die "Event name arg missing\n";; -my @groups; - -if (scalar @ARGV) -{ - @groups = map { $a->get($_); } @ARGV; - foreach my $g (@groups) - { - my $type = $g->prop('type'); - if ($type =~ /^user/) - { - # That's fine. We were probably just called from the user-delete - # event, in which case we want to update all of the groups. So, leave - # the groups array empty. - @groups = (); - last; - } - elsif ($type !~ /^group/){ - die "Expected a user or a group. Got neither: $type\n"; - } - } -} - -# Regenerate all the groups if the previous block failed in some way. -unless (@groups) -{ - @groups = $a->groups; -} - -foreach my $group (@groups) -{ - my $groupName = $group->key; - unless ($group->prop('type') eq 'group') - { - warn "Account $groupName is not a group account.\n"; - next; - } - my %properties = $group->props; - $groupName =~ s/\./:/g; - my $group = "/var/qmail/alias/.qmail-$groupName"; - my @group_members = split(/,/, $properties{Members}); - # Check if we should exclude members from this group email address - my @exclude_users = split(/,/, ($properties{EmailExcludeUsers} || '')); - my @exclude_groups = split(/,/, ($properties{EmailExcludeGroups} || '')); - foreach my $exclude_group (@exclude_groups){ - my $g = $a->get($exclude_group); - next unless $g; - push @exclude_users, split(/,/, ($g->prop('Members') || '')); - } - my %exclude = map { $_, 1 } @exclude_users; - @exclude_users = keys %exclude; - my @members = (); - foreach my $user (@group_members){ - next if grep { $_ eq $user } @exclude_users; - push @members, $user; - } - my $members = join(',', @members); - - esmith::util::processTemplate( - { - CONFREF => - { - Members => $members, - }, - - TEMPLATE_PATH => - "/var/qmail/alias/.qmail-group", - - OUTPUT_FILENAME => "/var/qmail/alias/.qmail-$groupName", - } - ); - - unless (-f "/var/qmail/alias/.qmail-$groupName-default") - { - symlink "/var/qmail/alias/.qmail-$groupName", - "/var/qmail/alias/.qmail-$groupName-default"; - } - -} -exit (0); diff --git a/root/etc/e-smith/templates-user/.qmail-junkmail/10deliver_to_junkmail b/root/etc/e-smith/templates-user/.qmail-junkmail/10deliver_to_junkmail index 9d7d795..77bb323 100644 --- a/root/etc/e-smith/templates-user/.qmail-junkmail/10deliver_to_junkmail +++ b/root/etc/e-smith/templates-user/.qmail-junkmail/10deliver_to_junkmail @@ -1,2 +1,3 @@ | [ -d ./Maildir/.junkmail/ ] || /var/qmail/bin/maildirmake ./Maildir/.junkmail/ +| /var/qmail/bin/preline -f /usr/libexec/dovecot/dovecot-lda -a "$RECIPIENT" -d "$USER" -m "junkmail" ; if [ $? -ne 0 ] ; then exit -1; else exit 99; fi; ./Maildir/.junkmail/ diff --git a/root/etc/e-smith/templates/var/qmail/alias/.qmail-default/50body b/root/etc/e-smith/templates/var/qmail/alias/.qmail-default/50body deleted file mode 100644 index 85ba071..0000000 --- a/root/etc/e-smith/templates/var/qmail/alias/.qmail-default/50body +++ /dev/null @@ -1,5 +0,0 @@ -{ - ($EmailUnknownUser eq "returntosender") ? - "| bouncesaying 'Recipient unknown'" : - "$EmailUnknownUser"; -} diff --git a/root/etc/e-smith/templates/var/qmail/alias/.qmail-group/50group_members b/root/etc/e-smith/templates/var/qmail/alias/.qmail-group/50group_members deleted file mode 100644 index 29e6237..0000000 --- a/root/etc/e-smith/templates/var/qmail/alias/.qmail-group/50group_members +++ /dev/null @@ -1,5 +0,0 @@ -{ - # Generic template to rebuild any .qmail-groupname file. Expects - # to be called with a CONFREF containing the group members. - $OUT .= join("\n", map { '&' . $_ } split(/,/, $Members)); -} diff --git a/root/etc/e-smith/templates/var/qmail/alias/.qmail-localdelivery-default/50body b/root/etc/e-smith/templates/var/qmail/alias/.qmail-localdelivery-default/50body deleted file mode 100644 index 157c4c9..0000000 --- a/root/etc/e-smith/templates/var/qmail/alias/.qmail-localdelivery-default/50body +++ /dev/null @@ -1 +0,0 @@ -| forward $DEFAULT@{"$SystemName.$DomainName"} diff --git a/root/etc/e-smith/templates/var/qmail/alias/.qmail-shared/50body b/root/etc/e-smith/templates/var/qmail/alias/.qmail-shared/50body deleted file mode 100644 index 44b6393..0000000 --- a/root/etc/e-smith/templates/var/qmail/alias/.qmail-shared/50body +++ /dev/null @@ -1,13 +0,0 @@ -{ - use esmith::AccountsDB; - my $a = esmith::AccountsDB->open_ro; - - $OUT = ''; - - for my $user ( $a->get('admin'), $a->users ) - { - next if ( ($user->prop('EveryoneEmail') || 'yes') eq 'no'); - - $OUT .= '&' . $user->key . "\n"; - } -} diff --git a/root/etc/e-smith/templates/var/qmail/control/badmailfrom/10sample b/root/etc/e-smith/templates/var/qmail/control/badmailfrom/10sample deleted file mode 100644 index 995e8a1..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/badmailfrom/10sample +++ /dev/null @@ -1,2 +0,0 @@ -#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 deleted file mode 100644 index 7443a6a..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/badrcptto/00setup +++ /dev/null @@ -1,9 +0,0 @@ -{ - 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 deleted file mode 100644 index 77bf6c4..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/badrcptto/10blockVisibleInternal +++ /dev/null @@ -1,16 +0,0 @@ -{ - 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/bouncefrom b/root/etc/e-smith/templates/var/qmail/control/bouncefrom deleted file mode 100644 index e3100ca..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/bouncefrom +++ /dev/null @@ -1 +0,0 @@ -MAILER-DAEMON diff --git a/root/etc/e-smith/templates/var/qmail/control/bouncehost b/root/etc/e-smith/templates/var/qmail/control/bouncehost deleted file mode 100644 index 24c4714..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/bouncehost +++ /dev/null @@ -1 +0,0 @@ -{ $DomainName } diff --git a/root/etc/e-smith/templates/var/qmail/control/concurrencylocal b/root/etc/e-smith/templates/var/qmail/control/concurrencylocal deleted file mode 100644 index 566c73d..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/concurrencylocal +++ /dev/null @@ -1 +0,0 @@ -{ (defined $DB->get('qmail')->prop('ConcurrencyLocal')) ? $DB->get('qmail')->prop('ConcurrencyLocal') : "20"; } diff --git a/root/etc/e-smith/templates/var/qmail/control/concurrencyremote b/root/etc/e-smith/templates/var/qmail/control/concurrencyremote deleted file mode 100644 index ba58fb1..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/concurrencyremote +++ /dev/null @@ -1 +0,0 @@ -{ (defined $DB->get('qmail')->prop('ConcurrencyRemote'))? $DB->get('qmail')->prop('ConcurrencyRemote') : "20"; } diff --git a/root/etc/e-smith/templates/var/qmail/control/databytes b/root/etc/e-smith/templates/var/qmail/control/databytes deleted file mode 100644 index 832c147..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/databytes +++ /dev/null @@ -1 +0,0 @@ -{ $DB->get('qmail')->prop('MaxMessageSize') || "0"; } diff --git a/root/etc/e-smith/templates/var/qmail/control/doublebouncehost b/root/etc/e-smith/templates/var/qmail/control/doublebouncehost deleted file mode 100644 index 24c4714..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/doublebouncehost +++ /dev/null @@ -1 +0,0 @@ -{ $DomainName } diff --git a/root/etc/e-smith/templates/var/qmail/control/doublebounceto b/root/etc/e-smith/templates/var/qmail/control/doublebounceto deleted file mode 100644 index c3043ad..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/doublebounceto +++ /dev/null @@ -1 +0,0 @@ -{ $DB->get('qmail')->prop('DoubleBounceTo') || "postmaster"; } diff --git a/root/etc/e-smith/templates/var/qmail/control/envnoathost b/root/etc/e-smith/templates/var/qmail/control/envnoathost deleted file mode 100644 index 24c4714..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/envnoathost +++ /dev/null @@ -1 +0,0 @@ -{ $DomainName } diff --git a/root/etc/e-smith/templates/var/qmail/control/helohost b/root/etc/e-smith/templates/var/qmail/control/helohost deleted file mode 100644 index 263e1c4..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/helohost +++ /dev/null @@ -1 +0,0 @@ -{ $qpsmtpd{HeloHost} || $DomainName } diff --git a/root/etc/e-smith/templates/var/qmail/control/idhost b/root/etc/e-smith/templates/var/qmail/control/idhost new file mode 100644 index 0000000..2957424 --- /dev/null +++ b/root/etc/e-smith/templates/var/qmail/control/idhost @@ -0,0 +1 @@ +qmail.{ $DomainName } diff --git a/root/etc/e-smith/templates/var/qmail/control/qmqpservers b/root/etc/e-smith/templates/var/qmail/control/qmqpservers new file mode 100644 index 0000000..7b9ad53 --- /dev/null +++ b/root/etc/e-smith/templates/var/qmail/control/qmqpservers @@ -0,0 +1 @@ +127.0.0.1 diff --git a/root/etc/e-smith/templates/var/qmail/control/rcpthosts/10standard b/root/etc/e-smith/templates/var/qmail/control/rcpthosts/10standard deleted file mode 100644 index 4121442..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/rcpthosts/10standard +++ /dev/null @@ -1,14 +0,0 @@ -{ - 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 deleted file mode 100644 index e55b368..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/rcpthosts/12LiteralIP +++ /dev/null @@ -1,5 +0,0 @@ -{ - return "" unless (defined $ExternalIP); - - return "[$ExternalIP]"; -} diff --git a/root/etc/e-smith/templates/var/qmail/control/smtproutes/00README b/root/etc/e-smith/templates/var/qmail/control/smtproutes/00README deleted file mode 100644 index 0df6333..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/smtproutes/00README +++ /dev/null @@ -1,25 +0,0 @@ -{ - # - # qmail's smtproutes mechanism works such that the LAST BEST match - # found in /var/qmail/control/smtproutes will be used in preference - # to any other entry. - # - # Consider the following /var/qmail/control/smtproutes example: - # - # :smarthost.somewhere - # domain.place:some.host - # domain.place:other.host - # :some.other.smarthost.elsewhere - # - # Mail for user@domain.place will ALWAYS be delivered to - # other.host. The entry for some.host will NEVER be used. - # - # Mail for any other domain will ALWAYS be delivered to - # some.other.smarthost.elsewhere. The entry for smarthost.somewhere - # will NEVER be used. - # - # Therefore, if you wish to make any customisations to the - # /var/qmail/control/smtproutes templates, you must ensure that they - # appear AFTER the standard e-smith template entries. - # -} diff --git a/root/etc/e-smith/templates/var/qmail/control/smtproutes/10delegateMailServer b/root/etc/e-smith/templates/var/qmail/control/smtproutes/10delegateMailServer deleted file mode 100644 index 9db9c1f..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/smtproutes/10delegateMailServer +++ /dev/null @@ -1,17 +0,0 @@ -{ - $OUT = ""; - - use esmith::DomainsDB; - my $ddb = esmith::DomainsDB->open_ro(); - - for my $domain ( $ddb->domains ) - { - my $mail_server = $domain->prop('MailServer') - || $DelegateMailServer - || 'localhost'; - - next if ( $mail_server eq 'localhost' ); - - $OUT .= $domain->key . ":$mail_server\n"; - } -} diff --git a/root/etc/e-smith/templates/var/qmail/control/smtproutes/20SMTPSmartHost b/root/etc/e-smith/templates/var/qmail/control/smtproutes/20SMTPSmartHost deleted file mode 100644 index cd7def9..0000000 --- a/root/etc/e-smith/templates/var/qmail/control/smtproutes/20SMTPSmartHost +++ /dev/null @@ -1,28 +0,0 @@ -{ - $OUT = ""; - - #-------------------------------------------------- - # Now check for SMTP smart host - #-------------------------------------------------- - - if ( - $SMTPSmartHost - && - ($SMTPSmartHost ne 'off') - && - ($SMTPSmartHost !~ /^\s*$/) - ) - { - # Is the smtp-auth-proxy enabled? - if (${'smtp-auth-proxy'}{'status'} eq 'enabled') - { - $OUT .= ":localhost:26"; - } - else - { - $OUT .= ":$SMTPSmartHost"; - } - } - - chomp ($OUT); -} diff --git a/root/etc/e-smith/templates/var/qmail/users/assign/30admin b/root/etc/e-smith/templates/var/qmail/users/assign/30admin deleted file mode 100644 index ab35603..0000000 --- a/root/etc/e-smith/templates/var/qmail/users/assign/30admin +++ /dev/null @@ -1,32 +0,0 @@ -{ - $OUT = ''; - - # Generate qmail user assignments for the admin user. This will be - # handled by ~admin/.qmail. - - my (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) - = getpwnam("admin"); - - # It is almost impossible to get Text::Template to output nothing - # on failure. It can be done by removing the newline at the end of - # this file but that is messy. Therefore, we'll simply return an - # error message that will make qmail-newu fail. Also send a - # warning message that will be captured in the logs. - - unless (defined $uid && defined $gid && defined $dir) - { - my $msg = - "Failed to obtain user details for \'admin\' " - . "while processing admin assignment."; - - warn "$msg\n"; - $OUT = $msg; - return; - } - - # Assign mail for the admin user itself, and for admin-ext. - - my $admin_assign = "admin:${uid}:${gid}:${dir}"; - $OUT .= "=admin:${admin_assign}:::\n"; - $OUT .= "+admin-:${admin_assign}:-::"; -} diff --git a/root/etc/e-smith/templates/var/qmail/users/assign/40alias b/root/etc/e-smith/templates/var/qmail/users/assign/40alias deleted file mode 100644 index a051eac..0000000 --- a/root/etc/e-smith/templates/var/qmail/users/assign/40alias +++ /dev/null @@ -1,32 +0,0 @@ -{ - $OUT = ''; - - # Generate qmail user assignments for the alias user. This will be - # handled by ~alias/.qmail. - - my (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) - = getpwnam("alias"); - - # It is almost impossible to get Text::Template to output nothing - # on failure. It can be done by removing the newline at the end of - # this file but that is messy. Therefore, we'll simply return an - # error message that will make qmail-newu fail. Also send a - # warning message that will be captured in the logs. - - unless (defined $uid && defined $gid && defined $dir) - { - my $msg = - "Failed to obtain user details for \'alias\' " - . "while processing alias assignment."; - - warn "$msg\n"; - $OUT = $msg; - return; - } - - # Assign mail for the alias user itself, and for alias-ext. - - my $alias_assign = "alias:${uid}:${gid}:${dir}"; - $OUT .= "=alias:${alias_assign}:::\n"; - $OUT .= "+alias-:${alias_assign}:-::"; -} diff --git a/root/etc/e-smith/templates/var/qmail/users/assign/45shared b/root/etc/e-smith/templates/var/qmail/users/assign/45shared deleted file mode 100644 index 2fd77de..0000000 --- a/root/etc/e-smith/templates/var/qmail/users/assign/45shared +++ /dev/null @@ -1,36 +0,0 @@ -{ - $OUT = ''; - - # Generate qmail user assignments for the shared group. This will - # be handled by ~alias/.qmail-shared and ~alias/.qmail-shared-ext. - - my (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) - = getpwnam("alias"); - - # It is almost impossible to get Text::Template to output nothing - # on failure. It can be done by removing the newline at the end of - # this file but that is messy. Therefore, we'll simply return an - # error message that will make qmail-newu fail. Also send a - # warning message that will be captured in the logs. - - unless (defined $uid && defined $gid && defined $dir) - { - my $msg = - "Failed to obtain user details for \'alias\' " - . "while processing shared assignment."; - - warn "$msg\n"; - $OUT = $msg; - return; - } - - my $alias_assign = "alias:${uid}:${gid}:${dir}"; - - $OUT .= "=shared:${alias_assign}:-:shared:\n"; - $OUT .= "+shared-:${alias_assign}:-shared-::\n"; - - # Need to remove the final newline character. Blank lines in - # /var/qmail/users/assign are prohibited. - - chomp($OUT); -} diff --git a/root/etc/e-smith/templates/var/qmail/users/assign/50system b/root/etc/e-smith/templates/var/qmail/users/assign/50system deleted file mode 100644 index 8c70126..0000000 --- a/root/etc/e-smith/templates/var/qmail/users/assign/50system +++ /dev/null @@ -1,56 +0,0 @@ -{ - $OUT = ''; - - # Generate qmail user assignments for system accounts. These will - # be handled by admin. Make sure we DON'T reassign the admin or - # alias users! - - my (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) - = getpwnam("admin"); - - # It is almost impossible to get Text::Template to output nothing - # on failure. It can be done by removing the newline at the end of - # this file but that is messy. Therefore, we'll simply return an - # error message that will make qmail-newu fail. Also send a - # warning message that will be captured in the logs. - - unless (defined $uid && defined $gid && defined $dir) - { - my $msg = - "Failed to obtain user details for \'admin\' " - . "while processing system assignments."; - - warn "$msg\n"; - $OUT = $msg; - return; - } - - my $admin_assign = "admin:${uid}:${gid}:${dir}"; - - use esmith::AccountsDB; - my $adb = esmith::AccountsDB->open_ro(); - - foreach my $user ( $adb->get_all_by_prop( type => 'system' ) ) - { - next if ($user->key eq "admin"); - next if ($user->key eq "alias"); - next if ($user->key eq "shared"); - - # Assign mail for system_account@ - $OUT .= "=" . $user->key . ":${admin_assign}:::\n"; - - # Assign mail for system_account-ext@ - $OUT .= "+" . $user->key . "-:${admin_assign}:-::\n"; - } - - # Need to remove the final newline character. Blank lines in - # /var/qmail/users/assign are prohibited. - - chomp($OUT); - - # Failsafe: /var/qmail/users/assign cannot have blank lines. - # Therefore, if $OUT is empty, simply set up an assign for the - # admin user. - - $OUT = "=admin:${admin_assign}:::" unless $OUT; -} diff --git a/root/etc/e-smith/templates/var/qmail/users/assign/60users b/root/etc/e-smith/templates/var/qmail/users/assign/60users deleted file mode 100644 index 9a4fe7f..0000000 --- a/root/etc/e-smith/templates/var/qmail/users/assign/60users +++ /dev/null @@ -1,59 +0,0 @@ -{ - $OUT = ''; - - # Generate qmail user assignments for users. These will be handled by - # ~user/.qmail. - - use esmith::AccountsDB; - my $adb = esmith::AccountsDB->open_ro(); - - foreach $user ( $adb->users ) - { - my $user_name = $user->key; - my (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) - = getpwnam($user_name); - - # It is almost impossible to get Text::Template to output nothing - # on failure. It can be done by removing the newline at the end of - # this file but that is messy. Therefore, we'll simply return an - # error message that will make qmail-newu fail. Also send a - # warning message that will be captured in the logs. - - unless (defined $uid && defined $gid && defined $dir) - { - my $msg = - "Failed to obtain user details for \'$user_name\' " - . "while processing user assignments."; - - warn "$msg\n"; - $OUT = $msg; - return; - } - - $user_assign = $user_name . ":${uid}:${gid}:${dir}"; - - # Assign mail for user@ - $OUT .= "=" . $user_name . ":${user_assign}:::\n"; - - # Assign mail for user-ext@ - $OUT .= "+" . $user_name . "-:${user_assign}:-::\n"; - } - - # Need to remove the final newline character. Blank lines in - # /var/qmail/users/assign are prohibited. - - chomp($OUT); - - # Failsafe: /var/qmail/users/assign cannot have blank lines. - # Therefore, if $OUT is empty, simply set up an assign for the - # alias user. - - unless ($OUT) - { - (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) - = getpwnam("alias"); - - $alias_assign = "alias:${uid}:${gid}:${dir}"; - $OUT = "=alias:${alias_assign}:::"; - } -} diff --git a/root/etc/e-smith/templates/var/qmail/users/assign/70pseudonyms b/root/etc/e-smith/templates/var/qmail/users/assign/70pseudonyms deleted file mode 100644 index 137cb8e..0000000 --- a/root/etc/e-smith/templates/var/qmail/users/assign/70pseudonyms +++ /dev/null @@ -1,147 +0,0 @@ -{ - $OUT = ''; - - # Generate qmail user assignments for pseudonyms. These will - # be handled by ~user/.qmail in the case of a user pseudonym - # or by ~admin/.qmail in the case of a system pseudonym or by - # alias/.qmail-groupname in the case of a group pseudonym. - - my (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) - = getpwnam("alias"); - - # It is almost impossible to get Text::Template to output nothing - # on failure. It can be done by removing the newline at the end of - # this file but that is messy. Therefore, we'll simply return an - # error message that will make qmail-newu fail. Also send a - # warning message that will be captured in the logs. - - unless (defined $uid && defined $gid && defined $dir) - { - my $msg = - "Failed to obtain user details for \'alias\' " - . "while processing pseudonym assignments."; - - warn "$msg\n"; - $OUT = $msg; - return; - } - - my $alias_assign = "alias:${uid}:${gid}:${dir}"; - - undef $uid; - undef $gid; - undef $dir; - - (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) - = getpwnam("admin"); - - unless (defined $uid && defined $gid && defined $dir) - { - my $msg = - "Failed to obtain user details for \'admin\' " - . "while processing pseudonym assignments."; - - warn "$msg\n"; - $OUT = $msg; - return; - } - - my $admin_assign = "admin:${uid}:${gid}:${dir}"; - - # Create assignments for each pseudonym. - - use esmith::AccountsDB; - my $adb = esmith::AccountsDB->open_ro(); - - foreach $pseudonym ( $adb->pseudonyms ) - { - next if ( $pseudonym->key =~ /@/ ); # user@domain goes in virtualdomains - - my $account = $pseudonym->prop('Account'); - unless ($account) - { - my $key = $pseudonym->key; - warn "pseudonym $key has no account property, default to admin"; - $account = $adb->get('admin'); - #next; - } - - $account = $adb->get($pseudonym->prop('Account')); - unless ($account) - { - my $key = $pseudonym->key; - warn "pseudonym $key points to account which does not exist, default to admin"; - $account = $adb->get('admin'); - #next; - } - - my $i = 1; - while ( $account->prop('type') eq "pseudonym") - { - $account = $adb->get($account->prop('Account')); - unless ($account) - { - my $key = $pseudonym->key; - warn "pseudonym $key points to account which does not exist, default to admin"; - $account = $adb->get('admin'); - last; - } - $i ++; last if $i>10; - } - - if ($account->prop('type') eq "pseudonym") - { - warn "users/assign: Skipping " . $pseudonym->key . " - too many pseudonym levels\n"; - next; - } - - if ($account->prop('type') eq "user") - { - my (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) - = getpwnam($account->key); - - unless (defined $uid && defined $gid && defined $dir) - { - my $msg = - "Failed to obtain user details for \'" . $account->key . "\' " - . "while processing pseudonym assignments."; - - warn "$msg\n"; - $OUT = $msg; - return; - } - - $assign = $account->key . ":${uid}:${gid}:${dir}"; - - # Assign mail for user_pseudonym@ - $OUT .= "=" . $pseudonym->key . ":${assign}:::\n"; - $OUT .= "+" . $pseudonym->key . "-:${assign}:-::\n"; - next; - } - - if ($account->prop('type') eq "group" || $account->key eq "shared") - { - $OUT .= "=" . $pseudonym->key . ":${alias_assign}:-:" . $account->key . ":\n"; - $OUT .= "+" . $pseudonym->key . "-:${alias_assign}:-:" . $account->key . ":\n"; - next; - } - - if ($account->prop('type') eq "system" ) - { - $OUT .= "=" . $pseudonym->key . ":${admin_assign}:::\n"; - $OUT .= "+" . $pseudonym->key . "-:${admin_assign}:-::\n"; - next; - } - } - - # Need to remove the final newline character. Blank lines in - # /var/qmail/users/assign are prohibited. - - chomp($OUT); - - # Failsafe: /var/qmail/users/assign cannot have blank lines. - # Therefore, if $OUT is empty, simply set up an assign for the - # alias user. - - $OUT = "=alias:${alias_assign}:::" unless $OUT; -} diff --git a/root/etc/e-smith/templates/var/qmail/users/assign/80groups b/root/etc/e-smith/templates/var/qmail/users/assign/80groups deleted file mode 100644 index 2619336..0000000 --- a/root/etc/e-smith/templates/var/qmail/users/assign/80groups +++ /dev/null @@ -1,51 +0,0 @@ -{ - $OUT = ''; - - # Generate qmail user assignments for groups. These will be handled - # by ~alias/.qmail-groupname and ~alias/.qmail-groupname-ext. - - my (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) - = getpwnam("alias"); - - # It is almost impossible to get Text::Template to output nothing - # on failure. It can be done by removing the newline at the end of - # this file but that is messy. Therefore, we'll simply return an - # error message that will make qmail-newu fail. Also send a - # warning message that will be captured in the logs. - - unless (defined $uid && defined $gid && defined $dir) - { - my $msg = - "Failed to obtain user details for \'alias\' " - . "while processing group assignments."; - - warn "$msg\n"; - $OUT = $msg; - return; - } - - my $alias_assign = "alias:${uid}:${gid}:${dir}"; - - use esmith::AccountsDB; - my $adb = esmith::AccountsDB->open_ro(); - - foreach $group ( $adb->groups ) - { - # Assign mail for group@ - $OUT .= "=" . $group->key . ":${alias_assign}:-:" . $group->key . ":\n"; - - # Assign mail for group-ext@ - $OUT .= "+" . $group->key . "-:${alias_assign}:-" . $group->key . "-::\n"; - } - - # Need to remove the final newline character. Blank lines in - # /var/qmail/users/assign are prohibited. - - chomp($OUT); - - # Failsafe: /var/qmail/users/assign cannot have blank lines. - # Therefore, if $OUT is empty, simply set up an assign for the - # alias user. - - $OUT = "=alias:${alias_assign}:::" unless $OUT; -} diff --git a/root/etc/e-smith/templates/var/qmail/users/assign/template-begin b/root/etc/e-smith/templates/var/qmail/users/assign/template-begin deleted file mode 100644 index e69de29..0000000 diff --git a/root/etc/e-smith/templates/var/qmail/users/assign/template-end b/root/etc/e-smith/templates/var/qmail/users/assign/template-end deleted file mode 100644 index 9c558e3..0000000 --- a/root/etc/e-smith/templates/var/qmail/users/assign/template-end +++ /dev/null @@ -1 +0,0 @@ -. diff --git a/root/service/qmail b/root/service/qmail deleted file mode 120000 index 25cbd2d..0000000 --- a/root/service/qmail +++ /dev/null @@ -1 +0,0 @@ -../var/service/qmail \ No newline at end of file diff --git a/root/usr/lib/systemd/system/qmail.service b/root/usr/lib/systemd/system/qmail.service deleted file mode 100644 index 9d1a745..0000000 --- a/root/usr/lib/systemd/system/qmail.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=qmail, message transfer agent -After=network.target -Requires=runit.service - -[Service] -Type=oneshot -ExecStartPre=/sbin/e-smith/service-status qmail -ExecStart=/usr/bin/sv u /service/qmail -ExecStop=/usr/bin/sv stop /service/qmail -ExecReload=/usr/bin/sv t /service/qmail -RemainAfterExit=yes - -[Install] -WantedBy=sme-server.target diff --git a/root/var/qmail/control/qmqpservers b/root/var/qmail/control/qmqpservers new file mode 100644 index 0000000..7b9ad53 --- /dev/null +++ b/root/var/qmail/control/qmqpservers @@ -0,0 +1 @@ +127.0.0.1 diff --git a/root/var/service/qmail/down b/root/var/service/qmail/down deleted file mode 100644 index e69de29..0000000 diff --git a/root/var/service/qmail/log/run b/root/var/service/qmail/log/run deleted file mode 100644 index 3d9111f..0000000 --- a/root/var/service/qmail/log/run +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -#---------------------------------------------------------------------- -# copyright (C) 2001 e-smith, inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Technical support for this program is available from e-smith, inc. -# Please visit our web site www.e-smith.com for details. -#---------------------------------------------------------------------- - -NUM=$(/sbin/e-smith/db configuration getprop qmail KeepLogFiles) - -exec \ - /usr/bin/setuidgid qmaill \ - /usr/bin/multilog t s5000000 \ - n${NUM:-10} \ - /var/log/qmail diff --git a/root/var/service/qmail/log/supervise/.gitignore b/root/var/service/qmail/log/supervise/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/root/var/service/qmail/run b/root/var/service/qmail/run deleted file mode 100644 index dbcfd66..0000000 --- a/root/var/service/qmail/run +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -#---------------------------------------------------------------------- -# copyright (C) 2002-2006 Mitel Networks Corporation -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#---------------------------------------------------------------------- -if [ ! -f /var/qmail/queue/lock/tcpto ] -then - dd bs=1024 count=1 if=/dev/zero of=/var/qmail/queue/lock/tcpto - chown qmailr:qmail /var/qmail/queue/lock/tcpto - chmod 644 /var/qmail/queue/lock/tcpto -fi - -exec \ - /usr/bin/env - PATH="/var/qmail/bin:/bin:/usr/bin:/usr/local/bin" \ - /var/qmail/bin/qmail-start \ - ./Maildir/ \ - 2>&1 diff --git a/root/var/service/qmail/supervise/.gitignore b/root/var/service/qmail/supervise/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/smeserver-mini-qmail.spec b/smeserver-mini-qmail.spec index c3f8a7a..b97d6bf 100644 --- a/smeserver-mini-qmail.spec +++ b/smeserver-mini-qmail.spec @@ -15,9 +15,6 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildRequires: smeserver-devtools >= 1.13.0-04 BuildArchitectures: noarch Requires: mini-qmail -#those two one will requires qmail rpm, should either change their requirement to a binary -# or make this rpm or mini-qmail provides qmail -# first option is cleaner Requires: dot-forward Requires: fastforward Requires: smeserver-email @@ -32,7 +29,16 @@ AutoReqProv: no %changelog * Tue Dec 03 2024 Jean-Philippe Pialasse 11.0.1-1.sme -- initial release of smeserver-mini-qmail from former smeserver-qmail [SME: ] +- initial release of smeserver-mini-qmail from former smeserver-qmail + . only for final delivery or forward behind qpsmtpd and postfix + . set /var/qmail/control/qmqpservers server file + . set junkmail delivery to dovecot-lda + . we only need configs idhost, qmqpservers, me, defaultdomain, plusdomain, rcpthosts + . removing controls badrcptto,helohost,smtproutes,rcpthosts,badmailfrom,databytes,bouncefrom, + bouncehost,concurrencylocal,concurrencyremote,doublebouncehost,doublebounceto,envnoathost + . removing /var/qmail/users + . removing alias + . cleaning actions scripts (TODO: move pseudonym-cleanup to smeserver-email) * Thu Apr 25 2024 Jean-Philippe Pialasse 11.0.0-8.sme - move qmail template from qpsmtpd [SME: 9492] @@ -442,16 +448,7 @@ rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-%{release}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ - --dir '/var/service/qmail' 'attr(1755,root,root)' \ - --file '/var/service/qmail/down' 'attr(0644,root,root)' \ - --file '/var/service/qmail/run' 'attr(0755,root,root)' \ - --file '/var/service/qmail/control/1' 'attr(0750,root,root)' \ - --dir '/var/service/qmail/supervise' 'attr(0700,root,root)' \ - --dir '/var/service/qmail/log' 'attr(0755,root,root)' \ - --file '/var/service/qmail/log/run' 'attr(0755,root,root)' \ - --dir '/var/service/qmail/log/supervise' 'attr(0700,root,root)' \ --dir '/var/log/qmail' 'attr(2750,qmaill,nofiles)' \ - --dir '/var/qmail/alias' 'attr(2755,alias,qmail)' \ > %{name}-%{version}-%{release}-filelist echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist @@ -461,6 +458,10 @@ rm -rf $RPM_BUILD_ROOT %pre %preun %post +rm /var/qmail/control/{helohost,smtproutes,rcpthosts,badrcptto,badmailfrom,databytes,bouncefrom,bouncehost,concurrencylocal,concurrencyremote,doublebouncehost,doublebounceto,envnoathost} -f +rm -rf /var/qmail/users +rm -rf /var/qmail/alias/* + %postun %files -f %{name}-%{version}-%{release}-filelist