")); + } + + if ( -e "/usr/share/zarafa/VERSION" ) + { + my $Gzar = db_get_prop(\%conf, 'zarafa-server', "GlobalForward") || ''; + if ($Gzar eq 'enabled') + { print $q->p (esmith::cgi::genSmallRedCell ($q, "Mail is being delivered globally to Zarafa.
")); } + else + { print $q->p (esmith::cgi::genSmallRedCell ($q, "Mail is being selectivly delivered to Zarafa.
")); } + } + + print $q->p ($q->td ($q->a ({href => $q->url (-absolute => 1) . + "?state=globalEnableProc"}, 'Modify'), " global mailfiltering rules and system settings.
"));
+
+ #------------------------------------------------------------
+ # accounts and user names
+ #------------------------------------------------------------
+ print $q->h4 ('Individual accounts.');
+
+ my @userAccounts = ();
+ foreach (sort keys %accounts)
+ {
+ push (@userAccounts, $_)
+ if (db_get_type(\%accounts, $_) eq "user");
+ }
+
+ my @Pseudonyms = ();
+ foreach (sort keys %accounts)
+ {
+ push (@Pseudonyms, $_)
+ if (db_get_type(\%accounts, $_) eq "pseudonym");
+ }
+
+ my $numAccts = @userAccounts +1;
+ if ($numAccts == 0)
+ {
+ print $q->h4 ('There are no user accounts in the system.');
+ }
+ else
+ {
+ print $q->p ('Review and modify a user\'s email delivery settings below.
+ Details in the Help link below');
+
+ my $showPseudonym = db_get(\%processmail, 'showPseudonym') || 'no';
+ if ($showPseudonym eq 'yes')
+ {
+ print $q->Tr ($q->td ($q->a ({href => $q->url (-absolute => 1) . "?state=showhide"},
+ 'Hide'),
+ "the . and _ Pseudonyms.
")); + } + else + { + print $q->Tr ($q->td ($q->a ({href => $q->url (-absolute => 1) . "?state=showhide&action=yes"}, + 'Show'), + "the . and _ Pseudonyms.
")); + } + + print "
".
+
+ 'Then set TMDA as enabled in the SME Accounts database
+ this sets the users .qmail file up the SME way.
+ the user can also do this himself at /user > tmda settings');
+
+ print $q->p ("TMDA Delivery:",
+ $q->popup_menu (-name => 'tmda',
+ -values => ['off', 'on'],
+ -default => $tmda));
+ }
+
+ ############# Mailfilter ####################
+ # test if Mailfilter is installed
+ print $q->h4 ('Mailsorting rules');
+ if ( -e "/etc/e-smith/web/functions/userpanel-mailsort" )
+ {
+ my %filterLabels = ('on' => "Adopt system default: $FilterType",
+ 'bypass' => "Bypass $FilterType");
+
+ my $MailFilter = db_get_prop(\%accounts, $acct, "MailFilter") || 'on';
+ print $q->p (esmith::cgi::genWidgetRow ($q, "Mailfilter",
+ $q->popup_menu (-name => 'MailFilter',
+ -values => ['on', 'bypass'],
+ -default => $MailFilter,
+ -labels => \%filterLabels )));
+
+ print $q->table ({border => 0, cellspacing => 0, cellpadding => 4});
+
+ #hide table if you have no rules
+ my @pmRules = ();
+ foreach (sort keys %processmail)
+ {
+ push (@pmRules, $_)
+ if (db_get_type(\%processmail, $_) eq "$acct");
+ }
+
+ my $pmRules = @pmRules || 'no rules';
+ if ($pmRules eq 'no rules')
+ {
+ print $q->p ($q->a ({href => $q->url (-absolute => 1) . "?state=advmodifyRule&acct=new&acctName=$acct"},
+ 'Click here'),
+ 'to define the first procmail rule.');
+ }
+ else
+ {
+ print $q->p ($q->a ({href => $q->url (-absolute => 1) . "?state=advmodifyRule&acct=new&acctName=$acct"},
+ 'Click here'),
+ "to add another rule. You currently have $pmRules rules.");
+
+ print $q->p ;
+
+ print "
+* Global rules +* Individual accounts +* Delivery options +* Mail Rules + +Global rules
+If smeserver-mailsorting is installed you can enable all mail +to be directed through either procmail or maildrop. + +Default leaves the system in the original state +When procmail or maildrop is enabled mail can be sorted according to +any rules created, if unsorted the mail is delivered according to the +standard email setting of the user ie local, forward or both. + +Maildrop includes a rule to match content in the body of the email +for email smaller the 5000 bytes it compares the list of words +or regular expressions you create in the file /opt/wordfilter + +Individual accounts
+The Individual accounts table of users provides an overview. +The Account name provies a link to individual settings. +Name shows the users real name. +Pseudomnys give additional email addresses that go to the account +Delivery is either + local - mail stays on server + forward - mail is forwarded to another address + both - keeps a copy and forwards the mail +The Forwarding address is show only if forwarding is enabled + +Delivery options
+Values in the options column may include: +internal, users can only recieve local mail + +The following options require additional software. + +bypass, exclude this user for global mailfiltering ie. procmail/maildrop +vacation, a vacation message reply is sent +tmda, challenge and response email system +zarafa, deliver to zarafa + +smeserver-mailsorting +Provides configuration files to create mail rules +that are processed by either procmail or maildrop + +smeserver-vacation +Provides for a vacation message to be sent, +for example the user is out of the office + +dungog-tmda-cgi +tmda.net +A combination of challenge and responce, and tagged email address that reduces spam + +Note. tmda needs two values set + +> tmda : the sme setting is enabled and the user has enabled tmda at /tmda +> tmda* : the sme setting is NOT enabled but the user has enabled tmda at /tmda +> tmda- : the sme setting is enabled but the user never enabled tmda at /tmda +> tmda! : the user has disabled tmda at /tmda but not the sme setting + +tmda + tmda is correctly configured + +tmda* + tmda will work but without vacation, forwarding or procmail, + until .qmail file is recreated, then mail does not get sent to tmda. + +tmda- + tmda setting is ignored + +tmda! + /tmda was enabled but now is not, its likely mail will be lost + .qmail is sending mail to tmda, see the cron job below for a fix + +To enable TMDA +1. enable and configure at /tmda +2. make SME aware of the change here + +To disable TMDA +1. Tell SME we are no longer going to use TMDA +- once you have done that here SME has disabled tmda +[optional but recommended] +2. disable at /tmda to release pending mail +3. Tell SME again, to confirm current settings are restored + +To Check users who may disable /tmda but not the SME setting +enable the cron job *Fix incorrect TMDA settings* +which is visible if you have dungog-cron + +Admin can change the default domain for new tmda users +db dungog set tmdaDomain domain.net +expand-template /usr/lib/python2.3/site-packages/tmda-cgi/skel/install/.tmda/config + +If you have procmail enabled the daily *TMDA pending summary* +will be deleted automatically if it is empty + +Mail Rules
+Rules to match email then perform an action + +Match against the emails size, To, From, or other headers +You can combine two elements before you call it a match +it may be helpful to view the headers of your emails to check if things +are not matching as expected, +to get an idea of the size of emails check the log file + +when matched you can +sort to an existing mail folder +forward to another email address +or delete it + +links are available to review the rules file, +you can review the log file to check which rules are matched +the log file is rotated weekly and kept for two weeks but you can delete it +if for example you are checking current activity and have a lot of information + +'))); + + print $q->p ('Review qmail/current or + Review qpsmtpd/current in the View log files panel.'); + + print $q->endform; + print $q->p ($q->hr, $q->font ({size => "-1"}, "https://wiki.koozali.org", + $q->a ({href => $q->url (-absolute => 1) . ""}, 'Return to main'), " ...")); + print $q->end_html; + return; +} + diff --git a/root/etc/e-smith/web/panels/manager/cgi-bin/user-email b/root/etc/e-smith/web/panels/manager/cgi-bin/user-email new file mode 120000 index 0000000..c31c040 --- /dev/null +++ b/root/etc/e-smith/web/panels/manager/cgi-bin/user-email @@ -0,0 +1 @@ +../../../functions/user-email \ No newline at end of file diff --git a/smeserver-email-management.spec b/smeserver-email-management.spec new file mode 100644 index 0000000..6c7e53a --- /dev/null +++ b/smeserver-email-management.spec @@ -0,0 +1,266 @@ +# $Id: smeserver-email-management.spec,v 1.3 2021/02/23 03:52:15 jpp Exp $ +# Authority: dungog +# Name: Stephen Noble + +Summary: modify and monitor maildelivery for all users +%define name smeserver-email-management +Name: %{name} +%define version 1.3 +%define release 6 +Version: %{version} +Release: %{release}%{?dist} +License: GPL +URL: http://www.dungog.net/sme +Group: SMEserver/addon +Source: %{name}-%{version}.tar.xz + +BuildArchitectures: noarch +BuildRoot: /var/tmp/%{name}-%{version} +Provides: dungog-email = %{version}-%{release} +Requires: e-smith-release >= 9.0, +Requires: smeserver-vacation +Requires: smeserver-mailsorting +#Requires: smeserver-userpanel, userpanel causes endless problems +BuildRequires: e-smith-devtools >= 1.13.1-03 +AutoReqProv: no + +%description +SME Server panel to allow admin to enable and configure procmail, +maildrop, vacation or forwarding for users, +see all users mail delivery methods in a table. +Admin can add global rules and apply them to all users, +set advanced mail properties. +Original work of Stephen Noble dungog.net. + +%prep +%setup +mkdir -p root/etc/e-smith/events/smeserver-email-management-update + +%build +perl createlinks + +#LEXICONS=$(find root/etc/e-smith/{locale/,web/functions/} -type f ) +#for lexicon in $LEXICONS +#do +# /sbin/e-smith/validate-lexicon $lexicon +#done + +%install +rm -rf $RPM_BUILD_ROOT +(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) +rm -f %{name}-%{version}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist +echo "%doc COPYING" >> %{name}-%{version}-filelist + +%clean +%pre +%preun +%post +%postun + +%files -f %{name}-%{version}-filelist +%defattr(-,root,root) + +%changelog +* Sat Sep 07 2024 cvs2git.sh aka Brian Read1.3-6.sme +- Roll up patches and move to git repo [SME: 12338] + +* Sat Sep 07 2024 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Mon Feb 22 2021 Jean-Philipe Pialasse 1.3-5.sme +- fix wrong link in function [SME: 11373] +- add event to avoid reboot [SME: 10951] + +* Fri Oct 23 2020 Brian Read 1.3-4.sme +- Initial import to SME10 tree [SME: 10951] + +* Sat Feb 02 2019 Jean-Philipe Pialasse 1.3-3.sme +- fix not able to display log and config files for users [SME: 10731] + +* Mon May 29 2017 Jean-Philipe Pialasse 1.3-2.sme +- add support for admin account [SME: 9737] + +* Mon Aug 08 2016 Jean-Philipe Pialasse 1.3-1.sme +- initial import to SME 9 + +* Wed Jul 21 2010 Stephen Noble 1.2-12 +- fix remember destination when modifying + +* Tue Jun 09 2009 Stephen Noble 1.2-11 +- fix path for ssl template expansion + +* Sat Mar 07 2009 Stephen Noble 1.2-10 +- Configure user settings for zarafa + +* Tue Oct 31 2006 Stephen Noble 1.2-9 +- MaxScannerSize added + +* Tue Oct 31 2006 Stephen Noble 1.2-8 +- qmail settings added + +* Mon Oct 30 2006 Stephen Noble +- qpsmtpd settings available in globals page +- [1.2-7] + +* Sat Oct 28 2006 Stephen Noble +- review domain mailserver delegation +- review group Visible property +- set qpsmtpd Bcc setting for mail archiving +- [1.2-6] + +* Wed Aug 23 2006 Stephen Noble +- remove strict check on mailrule criterion +- [1.2-5] + +* Thu May 04 2006 Stephen Noble +- TMDA support added +- [1.2-4] + +* Wed Apr 05 2006 Stephen Noble +- cosmetic, comment fixed +- [1.2-3] + +* Fri Mar 24 2006 Stephen Noble +- maildrop forwarding note added +- vacation system call changed to actions/qmail-update-user +- spamboss note added +- [1.2-2] + +* Thu Sep 22 2005 Stephen Noble +- simplified and updated for sme7 +- [1.2-1] + +* Fri Jul 01 2005 Stephen Noble +- removed requirement for perl-Unicode-IMAPUtf7 +- [1.0-6] + +* Tue Apr 26 2005 Stephen Noble +- removed junkfilter option for simplification +- corrected messages due to changes in other rpms +- mailblocking and pattern matching msg removed +- [1.0-5] + +* Sat Jan 29 2005 Stephen Noble +- supports spamassassin ver.3 / sme-spamfilter +- fixed global systemdefault spam sorting +- modify user TMDA usage +- [1.0-4] + +* Tue Dec 07 2004 Stephen Noble +- shows TMDA usage +- [1.0-3] + +* Mon Oct 18 2004 Stephen Noble +- cosmetic changes, refreshes correctly, log filter rblsd changed to rbls +- [1.0-2] + +* Thu Aug 12 2004 Stephen Noble +- rpm renamed dungog-email +- function processmail renamed dungog-email, will affect any userpanel delegations +- display users MailDomains & MailLocal settings from dungog-mailblocking +- display each users pseudonyms, option to hide . and _ versions +- display 'virtual domain' pseudonyms and domain delegations from dungog-vdomain +- display admin in user table +- antivirus and filtering status consolidated into one sub panel +- make admin aware of the pattern matching rpms +- junkfilter userpanel removed +- [1.0-1] + +* Wed Jul 28 2004 Stephen Noble +- removed tmda +- you now modify junkfilter rules from the command line +- [0.2-11] + +* Wed Jul 28 2004 Stephen Noble +- cosmetic, altered comment about spamassassin +- [0.2-10] + +* Wed Apr 07 2004 Stephen Noble +- smtp/rbls settings saved correctly +- individual email forwarding address shown on summary page +- [0.2-9] + +* Sun Mar 28 2004 Stephen Noble +- requires sme 6.0 +- smtp settings added + rbls, max message size +- updates userpanel panel links on install and uninstall +- [0.2-8] + +* Fri Mar 05 2004 Stephen Noble +- procmail forward to user fixed +- procmail says folder not in correct format fixed +- userpanel-procmail-pro moved to GPL userpanel +- [0.2-7] + +* Thu Dec 04 2003 Stephen Noble +- individual setting = systemdefault unless set otherwise +- dovecoat imap folders fixed in procmail dropdown lists +- rbls only works on 5.6, custom fragments added + requires e-smith-mailfront-1.0.0-02rbl.noarch.rpm +- spamassasin sme5/sme6 differences added + +- [0.2-7] + +* Thu Dec 04 2003 Stephen Noble +- individual setting = systemdefault unless set otherwise +- dovecoat imap folders fixed in procmail dropdown lists +- rbls only works on 5.6, custom fragments added + requires e-smith-mailfront-1.0.0-02rbl.noarch.rpm +- spamassasin sme5/sme6 differences added +- [0.2-6] + +* Mon Sep 08 2003 Stephen Noble +- larger text field for rbls entry +- logic improved deciding between individual and global delivery + will use individual setting until individual setting is systemdefault +- logic improved in creating .procmailrc + if you have both junkfilter and spamassassin installed +- [0.2-5] + +* Thu Aug 21 2003 Stephen Noble +- SME 6.0 support, servermanager navigation & shows tables correctly +- minor bug fixes +- [0.2-4] + +* Sun Aug 03 2003 Stephen Noble +- mail sent with offline dialup server with rbls installed but off is not delayed +- new delivery action option, tag spam but leave for mail client to sort +- [0.2-3] + +* Mon Jun 02 2003 Stephen Noble +- added notes, where to get spamassassin, contibs.org +- a filtering spamboss needs this procmail rule 'custom headers' "spamboss@" > 'spamfolder' +- [0.2-2] + +* Thu May 29 2003 Stephen Noble +- lots of changes, test before using on production machine +- improved display on dungog > emailfiltering panel + shows individual override on spamfilter + shows which global spamfilter and the sort/delete/fwd action +- uses tmda-0.78, + and tmda-cgi-0.9 for user interface, NB tmda-cgi-0.9 is later than 0.71 + www.servername/tmda, authenticates against users system password + admin or user still has to enable tmda with panels +- adds userpanel-procmail-pro, + adds second test for procmail, if x & if y then... + restricts characters in criterion to avoid broken rules, it may be too strict + email characters you want added to the allowed list +- incorporates better notification and seperate control of spamassassin + deliver tagged spamassassin spam to folder/spammboss/delete it + junkfilter spam folder changed to junkmail to be consistant with spamassassin +- server-manager > emailfiltering > global > filters + choose between junkfilter or spammassassin or use both + tmda runs before/without procmail and stops 99.9%% + function added to reset individual overrides to null + the default in now 'null' but was 'disabled' + this was a bug as the individual setting overrides the global setting + userpanel-procmail-pro is fixed, userpanel-procmail will be in userpanel.v12 +- [0.2-1] + +* Tue Jul 23 2002 Stephen Noble +- initial release +- [0.1-1] +