initial commit of file from CVS for e-smith-email on Wed 12 Jul 08:53:55 BST 2023
This commit is contained in:
3493
root/etc/e-smith/templates/etc/Muttrc/10Muttrc.proto
Normal file
3493
root/etc/e-smith/templates/etc/Muttrc/10Muttrc.proto
Normal file
File diff suppressed because it is too large
Load Diff
3
root/etc/e-smith/templates/etc/Muttrc/20hostname
Normal file
3
root/etc/e-smith/templates/etc/Muttrc/20hostname
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
return "set hostname=$DomainName";
|
||||
}
|
1
root/etc/e-smith/templates/etc/Muttrc/50folder
Normal file
1
root/etc/e-smith/templates/etc/Muttrc/50folder
Normal file
@@ -0,0 +1 @@
|
||||
set folder=imaps://localhost/
|
1
root/etc/e-smith/templates/etc/Muttrc/50spoolfile
Normal file
1
root/etc/e-smith/templates/etc/Muttrc/50spoolfile
Normal file
@@ -0,0 +1 @@
|
||||
set spoolfile=imaps://localhost/INBOX
|
130
root/etc/e-smith/templates/etc/crontab/email
Normal file
130
root/etc/e-smith/templates/etc/crontab/email
Normal file
@@ -0,0 +1,130 @@
|
||||
|
||||
{
|
||||
$OUT = '';
|
||||
|
||||
my $status = $fetchmail{"status"};
|
||||
|
||||
if (defined $status && $status eq "enabled")
|
||||
{
|
||||
my $method = $fetchmail{'Method'};
|
||||
if (($method eq 'etrn') || ($method eq 'multidrop'))
|
||||
{
|
||||
$OUT .= "\n";
|
||||
$OUT .= "# fetchmail times during office hours\n";
|
||||
$OUT .= "\n";
|
||||
|
||||
my $FetchmailFreqOffice = $fetchmail{'FreqOffice'};
|
||||
if ($FetchmailFreqOffice)
|
||||
{
|
||||
if ($FetchmailFreqOffice eq 'every5min')
|
||||
{
|
||||
$OUT .= "*/5\t8-17\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqOffice eq 'every15min')
|
||||
{
|
||||
$OUT .= "*/15\t8-17\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqOffice eq 'every30min')
|
||||
{
|
||||
$OUT .= "*/30\t8-17\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqOffice eq 'everyhour')
|
||||
{
|
||||
$OUT .= "0\t8-17\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqOffice eq 'every2hrs')
|
||||
{
|
||||
$OUT .= "0\t8-17/2\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "# FetchmailFreqOffice - never\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "# FetchmailFreqOffice - not defined\n";
|
||||
}
|
||||
|
||||
$OUT .= "\n";
|
||||
$OUT .= "# fetchmail times outside office hours\n";
|
||||
$OUT .= "\n";
|
||||
|
||||
my $FetchmailFreqOutside = $fetchmail{'FreqOutside'};
|
||||
if ($FetchmailFreqOutside)
|
||||
{
|
||||
if ($FetchmailFreqOutside eq 'every5min')
|
||||
{
|
||||
$OUT .= "*/5\t0-7\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
$OUT .= "*/5\t18-23\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqOutside eq 'every15min')
|
||||
{
|
||||
$OUT .= "*/15\t0-7\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
$OUT .= "*/15\t18-23\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqOutside eq 'every30min')
|
||||
{
|
||||
$OUT .= "*/30\t0-7\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
$OUT .= "*/30\t18-23\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqOutside eq 'everyhour')
|
||||
{
|
||||
$OUT .= "0\t0-7\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
$OUT .= "0\t18-23\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqOutside eq 'every2hrs')
|
||||
{
|
||||
$OUT .= "0\t0-7/2\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
$OUT .= "0\t18-23/2\t*\t*\t1-5\troot\t/etc/startmail\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "# FetchmailFreqOutside - never\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "# FetchmailFreqOutside - not defined\n";
|
||||
}
|
||||
|
||||
$OUT .= "\n";
|
||||
$OUT .= "# fetchmail times during the weekend\n";
|
||||
$OUT .= "\n";
|
||||
|
||||
my $FetchmailFreqWeekend = $fetchmail{'FreqWeekend'};
|
||||
if ($FetchmailFreqWeekend)
|
||||
{
|
||||
if ($FetchmailFreqWeekend eq 'every5min')
|
||||
{
|
||||
$OUT .= "*/5\t*\t*\t*\t6-7\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqWeekend eq 'every15min')
|
||||
{
|
||||
$OUT .= "*/15\t*\t*\t*\t6-7\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqWeekend eq 'every30min')
|
||||
{
|
||||
$OUT .= "*/30\t*\t*\t*\t6-7\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqWeekend eq 'everyhour')
|
||||
{
|
||||
$OUT .= "0\t*\t*\t*\t6-7\troot\t/etc/startmail\n";
|
||||
}
|
||||
elsif ($FetchmailFreqWeekend eq 'every2hrs')
|
||||
{
|
||||
$OUT .= "0\t*/2\t*\t*\t6-7\troot\t/etc/startmail\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "# FetchmailFreqWeekend - never\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "# FetchmailFreqWeekend - not defined\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
15
root/etc/e-smith/templates/etc/fetchmail/20disabled
Normal file
15
root/etc/e-smith/templates/etc/fetchmail/20disabled
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
my $status = $fetchmail{'status'};
|
||||
|
||||
if (!defined $status || $status ne "enabled")
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
my $method = $fetchmail{'Method'};
|
||||
if (!defined $method)
|
||||
{
|
||||
$OUT .= "# This service is enabled but no Method is specified";
|
||||
}
|
||||
}
|
||||
}
|
21
root/etc/e-smith/templates/etc/fetchmail/50ETRN
Normal file
21
root/etc/e-smith/templates/etc/fetchmail/50ETRN
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
$OUT = '';
|
||||
return unless ($fetchmail{status} eq 'enabled' && $fetchmail{Method} eq 'etrn');
|
||||
|
||||
$OUT .= "# ETRN configuration; fetchmail sends ETRN command ";
|
||||
$OUT .= "to flush mail from remote mail server:\n";
|
||||
$OUT .= "\n";
|
||||
|
||||
my $verbosity = $fetchmail{Verbosity} || "--silent";
|
||||
my $SecondaryMailServer = $fetchmail{SecondaryMailServer};
|
||||
|
||||
use esmith::DomainsDB;
|
||||
|
||||
my $ddb = esmith::DomainsDB->open_ro or die "Could not open domains DB\n";
|
||||
|
||||
my @domains = map { $_->key } $ddb->get_all;
|
||||
$OUT .= "/usr/bin/fetchmail --syslog $verbosity --protocol ";
|
||||
$OUT .= "ETRN --fetchdomains " . join(',', @domains);
|
||||
$OUT .= " $SecondaryMailServer ";
|
||||
$OUT .= "> /dev/null 2>&1\n";
|
||||
}
|
72
root/etc/e-smith/templates/etc/fetchmail/50multi-drop
Normal file
72
root/etc/e-smith/templates/etc/fetchmail/50multi-drop
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
$OUT = '';
|
||||
|
||||
my $status = $fetchmail{"status"}
|
||||
|| 'disabled';
|
||||
my $method = $fetchmail{"Method"}
|
||||
|| 'standard';
|
||||
|
||||
if ($status eq "enabled" && $method eq 'multidrop')
|
||||
{
|
||||
# Write a fetchmail command which connects to a POP
|
||||
# server, retrieves all mail from a single account,
|
||||
# and feeds it to the local SMTP server.
|
||||
|
||||
my $envelopeSpec =
|
||||
$fetchmail{"SecondaryMailEnvelope"};
|
||||
my $SecondaryMailServer =
|
||||
$fetchmail{"SecondaryMailServer"};
|
||||
my $SecondaryMailAccount =
|
||||
$fetchmail{"SecondaryMailAccount"};
|
||||
my $SecondaryMailPassword =
|
||||
$fetchmail{"SecondaryMailPassword"};
|
||||
$envelopeSpec = defined $envelopeSpec ?
|
||||
"envelope \"$envelopeSpec\"\n" : "";
|
||||
|
||||
my $verbosity = $fetchmail{"Verbosity"}
|
||||
|| "--silent";
|
||||
|
||||
my $protocol = $fetchmail{"Protocol"}
|
||||
|| "POP3";
|
||||
|
||||
my $ssl = $fetchmail{"SSL"}
|
||||
|| "disabled";
|
||||
|
||||
use esmith::DomainsDB;
|
||||
my $ddb = esmith::DomainsDB->open_ro();
|
||||
|
||||
my $locals = join ' ', map { $_->key } $ddb->domains;
|
||||
|
||||
$OUT .= "# multi-drop configuration; fetchmail ";
|
||||
$OUT .= "retrieves all mail from a remote POP mailbox:\n";
|
||||
$OUT .= "\n";
|
||||
$OUT .= "/usr/bin/fetchmail --syslog $verbosity ";
|
||||
$OUT .= " -i /var/lib/fetchmail/.fetchids "; # fix SME: 11979/12131
|
||||
|
||||
my $AuthenticationMethod =
|
||||
$fetchmail{"AuthenticationMethod"}
|
||||
|| "password";
|
||||
$OUT .= "--auth $AuthenticationMethod ";
|
||||
|
||||
$OUT .= "--fetchmailrc - <<EOF\n";
|
||||
$OUT .= "\n";
|
||||
$OUT .= "set postmaster \"postmaster\@$DomainName\"\n";
|
||||
$OUT .= "set bouncemail\n";
|
||||
$OUT .= "set properties \"\"\n";
|
||||
$OUT .= "\n";
|
||||
$OUT .= "poll $SecondaryMailServer\n";
|
||||
$OUT .= $envelopeSpec;
|
||||
$OUT .= " protocol $protocol\n";
|
||||
$OUT .= " ssl\n" if $ssl eq 'enabled';
|
||||
$OUT .= " no dns\n";
|
||||
$OUT .= " localdomains $locals\n";
|
||||
$OUT .= " username \"$SecondaryMailAccount\" ";
|
||||
$OUT .= "password \"$SecondaryMailPassword\" to * here\n";
|
||||
$OUT .= " smtphost 127.0.0.200" . ($smtpd{TCPPort} ? "/$smtpd{TCPPort}" : "") . "\n";
|
||||
$OUT .= " fetchall\n";
|
||||
$OUT .= " forcecr\n";
|
||||
$OUT .= "\n";
|
||||
$OUT .= "EOF";
|
||||
|
||||
}
|
||||
}
|
1
root/etc/e-smith/templates/etc/fetchmail/template-begin
Symbolic link
1
root/etc/e-smith/templates/etc/fetchmail/template-begin
Symbolic link
@@ -0,0 +1 @@
|
||||
/etc/e-smith/templates-default/template-begin-shell
|
@@ -0,0 +1 @@
|
||||
folder-collection=\{localhost/novalidate-cert\}[]
|
1
root/etc/e-smith/templates/etc/pine.conf/50InboxPath
Normal file
1
root/etc/e-smith/templates/etc/pine.conf/50InboxPath
Normal file
@@ -0,0 +1 @@
|
||||
inbox-path=\{localhost/novalidate-cert\}inbox
|
1
root/etc/e-smith/templates/etc/pine.conf/50LdapServers
Normal file
1
root/etc/e-smith/templates/etc/pine.conf/50LdapServers
Normal file
@@ -0,0 +1 @@
|
||||
ldap-servers=localhost
|
1
root/etc/e-smith/templates/etc/pine.conf/50SmtpServer
Normal file
1
root/etc/e-smith/templates/etc/pine.conf/50SmtpServer
Normal file
@@ -0,0 +1 @@
|
||||
smtp-server=localhost
|
1
root/etc/e-smith/templates/etc/pine.conf/50UserDomain
Normal file
1
root/etc/e-smith/templates/etc/pine.conf/50UserDomain
Normal file
@@ -0,0 +1 @@
|
||||
user-domain={ $DomainName }
|
@@ -0,0 +1 @@
|
||||
default-saved-msg-folder=""
|
28
root/etc/e-smith/templates/etc/rc.d/init.d/masq/35SMTPProxy
Normal file
28
root/etc/e-smith/templates/etc/rc.d/init.d/masq/35SMTPProxy
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
$OUT = "\n";
|
||||
|
||||
# Create new chain to manage SMTPProxy stuff
|
||||
# Note: We send all traffic destined to port 25, regardless of
|
||||
# where it's from, since the filter table will worry about source.
|
||||
|
||||
$OUT .= " /sbin/iptables --table nat --new-chain SMTPProxy\n";
|
||||
$OUT .= " /sbin/iptables --table nat --append PREROUTING\\\n";
|
||||
$OUT .= "\t-p tcp --dport 25 -j SMTPProxy\n";
|
||||
|
||||
# Accept any accesses to the local IPs directly
|
||||
|
||||
$OUT .= " /sbin/iptables --table nat --append SMTPProxy \\\n";
|
||||
$OUT .= "\t--destination 127.0.0.1 --jump ACCEPT\n";
|
||||
$OUT .= " /sbin/iptables --table nat --append SMTPProxy \\\n";
|
||||
$OUT .= "\t--destination $LocalIP --jump ACCEPT\n";
|
||||
|
||||
if (defined $ExternalIP)
|
||||
{
|
||||
# Accept any accesses to the ExternalIP directly
|
||||
$OUT .= " /sbin/iptables --table nat --append SMTPProxy \\\n";
|
||||
$OUT .= "\t--destination \$OUTERNET --jump ACCEPT\n";
|
||||
}
|
||||
|
||||
$OUT .= " /sbin/iptables --table nat --append SMTPProxy\\\n";
|
||||
$OUT .= "\t-p TCP -j DNAT --to $LocalIP:25\n";
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
$OUT .= "\n # Check outbound SMTP\n";
|
||||
|
||||
$OUT .= " /sbin/iptables --new-chain SMTPProxy\n";
|
||||
$OUT .= " /sbin/iptables --append FORWARD \\\n";
|
||||
$OUT .= "\t-p tcp --dport 25 -j SMTPProxy\n";
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
{
|
||||
# Update any rules which may have changed, meaning
|
||||
# - $ExternalIP
|
||||
|
||||
my $rule = 3;
|
||||
if (defined $ExternalIP)
|
||||
{
|
||||
# Accept any accesses to the ExternalIP directly
|
||||
$OUT .= " /sbin/iptables --table nat \\\n";
|
||||
$OUT .= "\t--replace SMTPProxy $rule\\\n";
|
||||
$OUT .= "\t--destination \$OUTERNET --jump ACCEPT\n";
|
||||
$rule++;
|
||||
}
|
||||
|
||||
$OUT .= " /sbin/iptables --flush SMTPProxy\n";
|
||||
|
||||
if (${qpsmtpd}{'Proxy'} eq 'transparent')
|
||||
{
|
||||
$OUT .= " /sbin/iptables --table nat --replace SMTPProxy $rule\\\n";
|
||||
$OUT .= "\t-p TCP -j DNAT --to $LocalIP:25\n";
|
||||
}
|
||||
elsif (${qpsmtpd}{'Proxy'} eq 'blocked')
|
||||
{
|
||||
# Replace it with nothing, but keep the rule entry as a placeholder
|
||||
# for each re-enabling.
|
||||
$OUT .= " /sbin/iptables --table nat --replace SMTPProxy $rule\n";
|
||||
$OUT .= " /sbin/iptables --append SMTPProxy\\\n";
|
||||
$OUT .= "\t-p tcp --dport 25 -i \$INTERNALIF -j denylog\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
# Replace it with nothing, but keep the rule entry as a placeholder
|
||||
# for each re-enabling.
|
||||
$OUT .= " /sbin/iptables --table nat --replace SMTPProxy $rule\n";
|
||||
}
|
||||
}
|
49
root/etc/e-smith/templates/etc/startmail/20body
Normal file
49
root/etc/e-smith/templates/etc/startmail/20body
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
my $status = $fetchmail{status};
|
||||
|
||||
if (defined $status)
|
||||
{
|
||||
if ($status eq "enabled")
|
||||
{
|
||||
$command = "/bin/su - qmailr -s /bin/bash -c \\\n";
|
||||
$command .= "\t\"FETCHMAILHOME=/var/lock/fetchmail";
|
||||
$command .= " /etc/fetchmail\"";
|
||||
|
||||
if ($AccessType eq 'dialup')
|
||||
{
|
||||
$OUT .= "\n";
|
||||
$OUT .= "# dialup connection; if we're already connected, ";
|
||||
$OUT .= "call fetchmail.\n";
|
||||
$OUT .= "# otherwise, bring up the line (which will invoke ";
|
||||
$OUT .= "fetchmail in\n";
|
||||
$OUT .= "# the ip-up script).\n";
|
||||
$OUT .= "\n";
|
||||
$OUT .= "if /sbin/ifconfig | /bin/grep -q 'ppp'\n";
|
||||
$OUT .= "then\n";
|
||||
$OUT .= " ${command}\n";
|
||||
$OUT .= "else\n";
|
||||
$OUT .= " /usr/bin/killall -USR1 diald\n";
|
||||
$OUT .= "fi\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "\n";
|
||||
$OUT .= "# dedicated connection; just call fetchmail to get ";
|
||||
$OUT .= "things started\n";
|
||||
$OUT .= "${command}\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "\n";
|
||||
$OUT .= "# This service has been flagged as 'disabled'\n";
|
||||
$OUT .= "# in the e-smith services database.\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "\n";
|
||||
$OUT .= "# This service does not exist in the e-smith services";
|
||||
$OUT .= " database.\n";
|
||||
}
|
||||
}
|
1
root/etc/e-smith/templates/etc/startmail/template-begin
Symbolic link
1
root/etc/e-smith/templates/etc/startmail/template-begin
Symbolic link
@@ -0,0 +1 @@
|
||||
/etc/e-smith/templates-default/template-begin-shell
|
Reference in New Issue
Block a user