Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
84adebc1
Commit
84adebc1
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Change exim relay when changing network
parent
1e3a25ae
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-base-email
+17
-4
17 additions, 4 deletions
src/freedombone-base-email
src/freedombone-controlpanel
+3
-0
3 additions, 0 deletions
src/freedombone-controlpanel
with
20 additions
and
4 deletions
src/freedombone-base-email
+
17
−
4
View file @
84adebc1
...
...
@@ -804,7 +804,9 @@ function install_email {
echo
"dc_readhost=''"
>>
/etc/exim4/update-exim4.conf.conf
echo
"dc_relay_domains=''"
>>
/etc/exim4/update-exim4.conf.conf
echo
"dc_minimaldns='false'"
>>
/etc/exim4/update-exim4.conf.conf
RELAY_NETS
=
'192.168.1.0/24'
IPv4_address
=
$(
get_ipv4_address
)
IPv4_address_base
=
$(
echo
"
$IPv4_address
"
|
awk
-F
'.'
'{print $1"."$2"."$3}'
)
RELAY_NETS
=
"
${
IPv4_address_base
}
.0/24"
if
[
$LOCAL_NETWORK_STATIC_IP_ADDRESS
]
;
then
RELAY_NETS
=
$(
echo
$LOCAL_NETWORK_STATIC_IP_ADDRESS
|
awk
-F
'.'
'{print $1 "." $2 "." $3 ".0/24"}'
)
fi
...
...
@@ -832,9 +834,9 @@ function install_email {
sed
-i
'/login_saslauthd_server/,/.endif/ s/# *//'
/etc/exim4/exim4.conf.template
if
!
grep
-q
"MAIN_TLS_ENABLE = true"
/etc/exim4/exim4.conf.template
;
then
sed
-i
"/.ifdef MAIN_HARDCODE_PRIMARY_HOSTNAME/i
\M
AIN_HARDCODE_PRIMARY_HOSTNAME =
$DEFAULT_DOMAIN_NAME
\n
MAIN_TLS_ENABLE = true"
/etc/exim4/exim4.conf.template
sed
-i
"/.ifdef MAIN_HARDCODE_PRIMARY_HOSTNAME/i
\M
AIN_HARDCODE_PRIMARY_HOSTNAME =
\n
MAIN_TLS_ENABLE = true"
/etc/exim4/exim4.conf.template
else
sed
-i
"s|MAIN_HARDCODE_PRIMARY_HOSTNAME =.*|MAIN_HARDCODE_PRIMARY_HOSTNAME =
$DEFAULT_DOMAIN_NAME
|g"
/etc/exim4/exim4.conf.template
sed
-i
"s|MAIN_HARDCODE_PRIMARY_HOSTNAME =.*|MAIN_HARDCODE_PRIMARY_HOSTNAME =|g"
/etc/exim4/exim4.conf.template
fi
sed
-i
"s|SMTPLISTENEROPTIONS=''|SMTPLISTENEROPTIONS='-oX 465:25:587 -oP /var/run/exim4/exim.pid'|g"
/etc/default/exim4
if
!
grep
-q
"tls_on_connect_ports=465"
/etc/exim4/exim4.conf.template
;
then
...
...
@@ -847,6 +849,9 @@ function install_email {
adduser
$MY_USERNAME
sasl
addgroup Debian-exim sasl
systemctl restart exim4
if
[
!
-d
/etc/skel/log
]
;
then
mkdir
-m
700 /etc/skel/log
fi
if
[
!
-d
/etc/skel/Maildir
]
;
then
mkdir
-m
700 /etc/skel/.mutt
mkdir
-m
700 /etc/skel/Maildir
...
...
@@ -897,6 +902,14 @@ function install_email {
mark_completed
$FUNCNAME
}
function
email_change_relay
{
curr_ip_address
=
"
$1
"
email_relay_base
=
$(
echo
"
$curr_ip_address
"
|
awk
-F
'.'
'{print $1"."$2"."$3}'
)
RELAY_NETS
=
"
${
email_relay_base
}
.0/24"
sed
-i
"s|dc_relay_nets=.*|dc_relay_nets='
$RELAY_NETS
'|g"
/etc/exim4/update-exim4.conf.conf
dpkg-reconfigure
--frontend
noninteractive exim4-config
}
function
create_procmail
{
if
[
!
-d
/etc/exim4
]
;
then
return
...
...
@@ -1094,7 +1107,7 @@ function spam_filtering {
# this must be accessible by root
chown
-R
$MY_USERNAME
:root /home/
$MY_USERNAME
/.spamassassin
systemctl
re
start spamassassin
systemctl start spamassassin
systemctl restart exim4
systemctl restart cron
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-controlpanel
+
3
−
0
View file @
84adebc1
...
...
@@ -1344,6 +1344,9 @@ Enter a static local IP address for this system.\n\nIt will typically be ${IPv4_
write_config_param
"NETWORK_IS_STATIC"
"1"
write_config_param
"STATIC_IP_ADDRESS"
"
$NEW_STATIC_IP
"
write_config_param
"ROUTER_IP_ADDRESS"
"
$NEW_STATIC_GATEWAY
"
email_change_relay
"
$NEW_STATIC_IP
"
if
[[
$(
config_param_exists
"WIFI_INTERFACE"
)
==
"0"
]]
;
then
# wired network
echo
'# This file describes the network interfaces available on your system'
>
/etc/network/interfaces
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment