12 Commits

Author SHA1 Message Date
ff9191cd37 * Fri Feb 21 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-12.sme
- remove /usr/local/sbin/smtp-auth-proxy.pl [SME: 12939]
2025-02-21 19:47:27 -05:00
359c7cd7ab * Wed Feb 12 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-11.sme
- fix typo in webmail settings for roundcube [SME: 12743]
2025-02-12 21:58:50 -05:00
847d2286d9 * Wed Jan 08 2025 Brian Read <brianr@koozali.org> 11.0.0-10.sme
- Update release due to finger trouble [SME: 12863]
2025-01-08 11:25:55 +00:00
bebfe041ee * Wed Jan 08 2025 Brian Read <brianr@koozali.org> 11.0.0-9.sme
- Revert change - reload should be in smeserver-postfix [SME: 12863]
2025-01-08 11:22:45 +00:00
b23ca94b0f Revert crealeinks to previous version 2025-01-08 09:46:17 +00:00
77e79e7b61 * Tue Jan 07 2025 Brian Read <brianr@koozali.org> 11.0.0-8.sme
- reload-or-restart postfix after pseudonym change [SME: 12863]
2025-01-07 16:09:01 +00:00
6dd24d9479 * Mon Dec 30 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-7.sme
- fix CGI::param called in list context [SME: 12789]
- update webmail settings for roundcube [SME: 12743]
- remove requires runit [SME: 12566]
- move action pseudonym-cleanup and migrate 10AdminEmail from smeserver-mini-qmail [SME: 12808]
2024-12-30 22:09:15 -05:00
f4311551ca Add *.bak to .gitignore 2024-11-12 19:19:36 +00:00
e91b8f2256 Deleting spurious *.spec.bak files 2024-11-12 19:19:32 +00:00
c2c7e2c12e Update README with specific Bugzilla links with status options 2024-10-27 14:28:28 +00:00
ea2b4063e3 Update readme bugzilla link to show all outstanding bugs 2024-10-27 12:11:45 +00:00
43d70a14c6 * Wed Apr 17 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-6.sme
- change temp dir from /var/lock to /run/lock [SME: 12620]
2024-04-17 15:12:35 -04:00
15 changed files with 109 additions and 1392 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
*.log
*spec-20*
*.tar.xz
*.bak

View File

@@ -6,7 +6,14 @@ SMEServer Koozali developed git repo for smeserver-email smeserver
<br />https://wiki.koozali.org/
## Bugzilla
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-email&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)\
Show list of outstanding bugs:
[All](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=NEEDINFO&bug_status=IN_PROGRESS&bug_status=RESOLVED&bug_status=VERIFIED&cf_package=smeserver-email&classification=SME+Server&list_id=105756&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Confirmed](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=CONFIRMED&cf_package=smeserver-email&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Unconfirmed](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=UNCONFIRMED&cf_package=smeserver-email&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Need info](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=NEEDINFO&cf_package=smeserver-email&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[In progress](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=IN_PROGRESS&cf_package=smeserver-email&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-email&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-email&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
And a list of outstanding Legacy bugs: (e-smith-email) [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-email&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

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
sme10

View File

@@ -49,9 +49,16 @@ panel_link("pseudonyms", $panel);
#--------------------------------------------------
$event = "console-save";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/smtp-auth-proxy");
event_link('fetchmail-migrate-fetchids', $event, '91');
#--------------------------------------------------
# actions for bootstrap-console-save event:
# write config files and create startup link
#--------------------------------------------------
$event = "bootstrap-console-save";
event_link("pseudonym-cleanup", $event, "03");
#--------------------------------------------------
# actions for domain-create event:
# rewrite config files and restart server
@@ -73,24 +80,30 @@ $event = "domain-delete";
#--------------------------------------------------
$event = "email-update";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/smtp-auth-proxy");
event_link('fetchmail-migrate-fetchids', $event, '91');
event_link("pseudonym-cleanup", $event, "30");
#--------------------------------------------------
# actions for group-create event:
#--------------------------------------------------
$event = "group-create";
event_link("pseudonym-cleanup", $event, "03");
#--------------------------------------------------
# actions for group-delete event:
#--------------------------------------------------
$event = "group-delete";
event_link("pseudonym-cleanup", $event, "03");
#--------------------------------------------------
# actions for group-modify event:
#--------------------------------------------------
$event = "group-modify";
event_link("pseudonym-cleanup", $event, "03");
#--------------------------------------------------
# actions for user-create event:
#--------------------------------------------------
@@ -126,13 +139,14 @@ $event = "smeserver-email-update";
event_link("systemd-reload", $event, "89");
event_link("systemd-default", $event, "88");
event_link('fetchmail-migrate-fetchids', $event, '91');
safe_symlink("try-restart", "root/etc/e-smith/events/$event/services2adjust/smtp-auth-proxy");
event_link("pseudonym-cleanup", $event, "03");
#--------------------------------------------------
# actions for pseudonym-{create,delete,modify}
#--------------------------------------------------
foreach $event ( qw(pseudonym-create pseudonym-modify pseudonym-delete) )
{
event_link("pseudonym-cleanup", $event, "03");
}

View File

@@ -0,0 +1,24 @@
{
my $conf = esmith::ConfigDB->open;
return unless $conf;
my $admin_email = $conf->get_value_and_delete('AdminEmail');
return unless defined $admin_email;
my $admin = $DB->get('admin') ||
$DB->new_record('admin', {type => 'system'});
if ($admin_email)
{
$admin->merge_props(
EmailForward => 'forward',
ForwardAddress => $admin_email,
);
}
else
{
$admin->merge_props(
EmailForward => 'local',
ForwardAddress => '',
);
}
}

View File

@@ -0,0 +1,22 @@
#!/usr/bin/perl -w
use strict;
use esmith::AccountsDB;
use esmith::event;
my $accounts = esmith::AccountsDB->open() or
die "Unable to open accounts db: $!";
my ($self, $account) = @ARGV;
# Find all "pseudonyms" entries in the e-smith accounts database and
# if the pseudonyms has an unexisting Account associated we change
# it to user "admin".
foreach my $pseudo ( $accounts->pseudonyms ) {
unless ( $accounts->get($pseudo->prop('Account')) ) {
$pseudo->set_prop( 'Account', 'admin' );
print "orphaned pseudonym " . $pseudo->key. " has been associated to admin account"
}
}

View File

@@ -6,7 +6,7 @@
if ($status eq "enabled")
{
$command = "/bin/su - qmailr -s /bin/bash -c \\\n";
$command .= "\t\"FETCHMAILHOME=/var/lock/fetchmail";
$command .= "\t\"FETCHMAILHOME=/run/lock/fetchmail";
$command .= " /etc/fetchmail\"";
if ($AccessType eq 'dialup')

View File

@@ -1,12 +0,0 @@
[Unit]
Description=Koozali SME Server SMTP auth proxy
After=network.target remote-fs.target
[Service]
Type=simple
ExecStartPre=/sbin/e-smith/service-status smtp-auth-proxy
ExecStart=/usr/local/sbin/smtp-auth-proxy.pl
[Install]
WantedBy=sme-server.target

View File

@@ -1 +1 @@
d /var/lock/fetchmail 0755 qmailr qmail
d /run/lock/fetchmail 0755 qmailr qmail

View File

@@ -1,174 +0,0 @@
#!/usr/bin/perl -w -T
package esmith::SMTPAuthProxy;
use strict;
use vars qw(@ISA);
use Net::Server::Fork;
use Net::SMTP;
use Net::SMTP::SSL;
use esmith::ConfigDB;
@ISA = qw(Net::Server::Fork);
sub options {
my $self = shift;
my $prop = $self->{server};
my $ref = shift;
$self->SUPER::options($ref);
my $config = esmith::ConfigDB->open_ro || die "Could not open config db";
my $smtp_proxy_rec = $config->get('smtp-auth-proxy');
$prop->{SMTPSmartHost} = $config->get_value('SMTPSmartHost');
$prop->{Blacklist} = $smtp_proxy_rec->prop('Blacklist') || " ";
$prop->{Userid} = $smtp_proxy_rec->prop('Userid');
$prop->{Passwd} = $smtp_proxy_rec->prop('Passwd');
$prop->{Debug} = $smtp_proxy_rec->prop('Debug');
$prop->{SystemName} = $config->get_value('SystemName');
$prop->{DomainName} = $config->get_value('DomainName');
$prop->{PeerPort} = $smtp_proxy_rec->prop('PeerPort') || 25;
$prop->{Helo} = $config->get('qpsmtpd')->prop('HeloHost') ||
"$prop->{SystemName}.$prop->{DomainName}";
}
esmith::SMTPAuthProxy->run(
max_servers => 4,
proto => 'tcp',
user => 'nobody',
group => 'nobody',
host => 'localhost',
port => 26);
exit;
### over-ridden subs below
sub process_request
{
my $self = shift;
my $kidpid;
my $smarthost = $self->get_property('SMTPSmartHost');
my $port = $self->get_property('PeerPort');
my $user = $self->get_property('user');
my $domain_name = $self->get_property('DomainName');
my $system_name = $self->get_property('SystemName');
my $helo = $self->get_property('Helo');
my $name = $self->get_property('Userid');
my $pass = $self->get_property('Passwd');
my $debug = (($self->get_property('Debug') || 'disabled') eq 'enabled')
? 1 : 0;
unless ($smarthost && $system_name && $domain_name && $name && $pass)
{
print "421 Internal error\n";
warn "Insufficient configuration for smtp-auth-proxy (SystemName)!\n"
unless $system_name;
warn "Insufficient configuration for smtp-auth-proxy (DomainName)!\n"
unless $domain_name;
warn "Insufficient configuration for smtp-auth-proxy (SMTPSmartHost)!\n"
unless $smarthost;
warn "Insufficient configuration for smtp-auth-proxy (Userid)!\n"
unless $name;
warn "Insufficient configuration for smtp-auth-proxy (Passwd)!\n"
unless $pass;
exit;
}
my $class = ($port == 465) ? 'Net::SMTP::SSL' : 'Net::SMTP';
my $smtp = $class->new($smarthost,
Hello => $helo,
Debug => $debug,
Port => $port,
);
unless ($smtp)
{
print "451 Upstream SMTP server not available\n";
warn "No SMTP connection to server $smarthost on port $port\n";
exit;
}
my @ehlo = $smtp->message;
if (grep { /STARTTLS$/ } @ehlo)
{
$smtp->command('STARTTLS');
my $response = $smtp->response;
my $status = $smtp->message;
use IO::Socket::SSL;
my $sslret = IO::Socket::SSL->start_SSL(
$smtp,
Timeout => 30,
SSL_startHandshake => 1
);
unless ($sslret) {
my $error = IO::Socket::SSL::errstr();
print("454 TLS not available due to temporary reason [$error]");
}
bless $smtp, 'Net::SMTP::SSL';
$smtp->reset;
$smtp->hello("${system_name}.${domain_name}");
@ehlo = $smtp->message;
}
if ($smtp->supports("AUTH"))
{
my $authenticated = 0;
my $blacklist = $self->get_property('Blacklist') || "";;
foreach my $method (split (/ /, ${*$smtp}{'net_smtp_esmtp'}->{"AUTH"}))
{
# Skip $method if in the blacklist
if ($blacklist =~ /$method/)
{
warn "Skipping blacklisted method $method\n" if $debug;
next;
}
warn "Trying authentication method $method\n" if $debug;
# Only present one auth method at a time to NET::SMTP
{${*$smtp}{'net_smtp_esmtp'}->{"AUTH"} = $method;}
eval { $authenticated = $smtp->auth($name, $pass); };
if ($@)
{
warn "exception during authentication (with $method): $@\n";
next;
}
last if $authenticated;
warn "SMTP authentication (with $method) with ISP server failed\n";
}
unless ($authenticated)
{
print "451 Could not auth to mail server\n";
warn "all SMTP authentication methods failed\n";
$smtp->quit;
exit;
}
}
else
{
warn "Upstream SMTP server does not support authentication\n";
}
print "220 ", $smtp->banner;
my $discard = <STDIN>; # Swallow EHLO
while (my $msg = shift @ehlo) {
my $sep = (@ehlo ? "-" : " ");
print "250$sep$msg";
}
die "can't fork: $!" unless defined ($kidpid = fork());
if ($kidpid)
{
print $smtp $_ while <STDIN>;
kill ("TERM" => $kidpid);
}
else
{
print while <$smtp>;
kill ("TERM" => getppid());
}
}
1;

View File

@@ -336,23 +336,20 @@ sub change_settings_access
$db->set_prop('php',"status", "enabled" );
$db->set_prop('mariadb',"status", "enabled" );
$db->set_prop('imp',"status", 'enabled' );
$db->set_prop('horde',"status", 'enabled' );
$db->set_prop('horde',"access", "public" );
$db->set_prop('horde',"HttpsOnly", "yes" );
$db->set_prop('roundcube',"status", 'enabled' );
$db->set_prop('roundcube',"access", "public" );
}
elsif ( $webmail eq "localnetworkSSL" || $webmail eq "localnetwork" ) {
$db->set_prop('php',"status", "enabled" );
$db->set_prop('mariadb',"status", "enabled" );
$db->set_prop('imp',"status", 'enabled' );
$db->set_prop('horde',"status", 'enabled' );
$db->set_prop('horde',"access", "private" );
$db->set_prop('horde',"HttpsOnly", "yes" );
$db->set_prop('roundcube',"status", 'enabled' );
$db->set_prop('roundcube',"access", "private" );
}
else {
$db->set_prop('imp',"status", 'disabled' );
$db->set_prop('horde',"status", 'disabled' );
$db->set_prop('roundcube',"status", 'disabled' );
}
unless ( system( "/sbin/e-smith/signal-event", "email-update" ) == 0 )
@@ -558,19 +555,16 @@ sub get_current_webmail_status {
# determine status of webmail
my $WebmailStatus = "disabled";
my $IMPStatus = $db->get_prop('imp', 'status') || 'disabled';
my $HordeStatus = $db->get_prop('horde', 'status') || 'disabled';
my $RoundcubeStatus = $db->get_prop('roundcube', 'status') || 'disabled';
my $MysqlStatus = $db->get_prop('mariadb', 'status') || 'disabled';
my $PHPStatus = $db->get_prop('php', 'status') || 'disabled';
my $Networkaccess = $db->get_prop('horde','access') || 'disabled';
my $Networkaccess = $db->get_prop('roundcube','access') || 'disabled';
# all four components must be on for webmail to be working
if ( ( $IMPStatus eq "enabled" )
&& ( $HordeStatus eq "enabled" )
if ( ( $RoundcubeStatus eq "enabled" )
&& ( $MysqlStatus eq "enabled" )
&& ( $PHPStatus eq "enabled" )
&& ( $Networkaccess eq "public"))
@@ -578,8 +572,7 @@ sub get_current_webmail_status {
$WebmailStatus = "enabledSSL" ;
}
elsif ( ( $IMPStatus eq "enabled" )
&& ( $HordeStatus eq "enabled" )
elsif ( ( $RoundcubeStatus eq "enabled" )
&& ( $MysqlStatus eq "enabled" )
&& ( $PHPStatus eq "enabled" )
&& ( $Networkaccess eq "private" ))

View File

@@ -364,7 +364,7 @@ sub print_begin_page {
my $key = $account->key();
push (@emailPseudonyms, $key) if ($type eq 'pseudonym');
}
my $urlprefix = $fm->build_cgi_params(uri_unescape($q->param('pseudonym')));
my $urlprefix = $fm->build_cgi_params(uri_unescape(scalar $q->param('pseudonym')));
print " <tr>\n <td colspan='2'>\n";
print $q->p($q->a({href => "pseudonyms?$urlprefix&wherenext=Create", -class => "button-like"},
$fm->localise("CLICK_TO_CREATE")));

View File

View File

@@ -4,7 +4,7 @@ Summary: smeserver server and gateway - email module
%define name smeserver-email
Name: %{name}
%define version 11.0.0
%define release 5
%define release 12
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@@ -25,7 +25,6 @@ Requires: perl(Net::SMTP)
Requires: perl(Net::SMTP::SSL)
Requires: perl(Authen::SASL)
Requires: perl(Net::Server) >= 0.85
Requires: runit
Requires: smeserver-formmagick >= 1.4.0-12
Obsoletes: e-smith-smtp-authentication
Obsoletes: e-smith-securemail
@@ -49,7 +48,6 @@ 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/lock/fetchmail 'attr(755,qmailr,qmail)' \
--dir '/var/log/smtp-auth-proxy' 'attr(2750,smelog,nofiles)' \
--file '/usr/local/sbin/smtp-auth-proxy.pl' 'attr(0755,root,root)' \
--dir '/home/e-smith/Maildir/.junkmail' 'attr(0700,admin,admin)' \
@@ -78,6 +76,30 @@ fi
smeserver server and gateway software - email module.
%changelog
* Fri Feb 21 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-12.sme
- remove /usr/local/sbin/smtp-auth-proxy.pl [SME: 12939]
* Wed Feb 12 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-11.sme
- fix typo in webmail settings for roundcube [SME: 12743]
* Wed Jan 08 2025 Brian Read <brianr@koozali.org> 11.0.0-10.sme
- Update release due to finger trouble [SME: 12863]
* Wed Jan 08 2025 Brian Read <brianr@koozali.org> 11.0.0-9.sme
- Revert change - reload should be in smeserver-postfix [SME: 12863]
* Tue Jan 07 2025 Brian Read <brianr@koozali.org> 11.0.0-8.sme
- reload-or-restart postfix after pseudonym change [SME: 12863]
* Mon Dec 30 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-7.sme
- fix CGI::param called in list context [SME: 12789]
- update webmail settings for roundcube [SME: 12743]
- remove requires runit [SME: 12566]
- move action pseudonym-cleanup and migrate 10AdminEmail from smeserver-mini-qmail [SME: 12808]
* Wed Apr 17 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-6.sme
- change temp dir from /var/lock to /run/lock [SME: 12620]
* Thu Apr 04 2024 Brian Read <brianr@koozali.org> 11.0.0-5.sme
- Update createlinks to create smeserver-package-update event[SME: 12579]