-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install script for full install of mailwatch including all dependencies #512
Install script for full install of mailwatch including all dependencies #512
Conversation
…es (apache, mariadb, postfix) on debian. nginx, sendmail, exim and other os still to be done (fixes #453 partly)
Great work on this @Skywalker-11 - your script looks very similar to mine, but neater :) If you need / want any help with it let me know. |
May be install.sh will be better than setup.sh. I'll will send you later details and files for exim4. |
@Skywalker-11 - my unfinished version is here, there might be bits you want to use. It's no where near finished, but it implements checks for existing installs of apache / nginx / php / mysql etc and autodetects the OS. I'll do any testing of redhat/centos/fedora (and any other OS's that need testing). |
Sorry did a mistake. Again. For Exim4 on Debian 8. With all this, you just needed to to I've also the default MailScanner config to post and one file missing for Exim4. |
New version with MaiScanner file and missing Exim file in /etc/default/exim4. |
Must also support apache 2.2 |
@stefaweb can you tell which settings in the mailscanner conf file are necessary for mailscanner install and which are optional? EDIT: It would be nice if you can tell what configuration changes are needed escpecially to get mailscanner work. The changes that have nothing to do with mailscanner/mailwatch but with getting "default" exim without mailscanner to work shouldn't be part of this configuration process. |
The basic idea is to do not modify something in MailScanner.conf. For this reason, I inserted in conf.d all the most needed variables. If the user want to use others variables not included, he can add them after. I would suggest to use all the variables that I placed in conf.d/mailwatch.conf (was server.conf). Example: If you setup %org-name% in conf.d/mailwatch.conf but forgot to include all the variables which contains %org-name% inside it, you will not initialise them as they are read before in MailScanner.conf. For exim, when you install it with apt-get (installed by default in debian). All is fine out of the box. You just have to run When this is done, if you copy all the files I placed in install.zip in the right place, the system will work after an exim restart. You just have to place domains and relay host in relay_domains and hubbed_hosts. You should also create output spool and log folders for exim, copy /etc/default/exim4 and apply rights. |
Another point. |
Good idea @stefaweb I did that |
Sorry, remove exim.crt and exim.key |
Another error. I forgot to "empty" setup.examples/exim/exim-configs/sender_local_deny_exceptions Just keep the commented lines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to activate "review" for a file?
chmod 750 /var/spool/exim4/input | ||
chown Debian-exim:Debian-exim /var/spool/exim4/msglog | ||
chmod 750 /var/spool/exim4/msglog | ||
chown Debian-exim:Debian-exim /var/spool/exim4/exim-process.info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete exim-process.info, this is not a permanent file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
chmod 640 /var/spool/exim4_outgoing/db/retry.lockfile | ||
chown Debian-exim:Debian-exim /var/spool/exim4_outgoing/db/wait-remote_smtp | ||
chmod 640 /var/spool/exim4_outgoing/db/wait-remote_smtp | ||
chown Debian-exim:Debian-exim /var/spool/exim4_outgoing/db/wait-remote_smtp.lockfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete all files inside db, they is not a permanent files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Sorry, did mistake when I listed the files. /var/spool/exim4 exist after deb install. Just check right.
exim4_outgoing should be created and the 3 directories inside and right applied.
|
Verify that in /etc/aliases you have these or install them.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new comments
#helo_verify_hosts = !* | ||
#helo_try_verify_hosts = !* | ||
#helo_accept_junk_hosts = !* | ||
#helo_allow_chars = _ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cab ve removed
+#helo_verify_hosts = !*
+#helo_try_verify_hosts = !*
+#helo_accept_junk_hosts = !*
+#helo_allow_chars = _
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too "specialized"
can be dangerous for "novice" user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
chmod -R 644 /etc/exim4 | ||
chmod 755 /etc/exim4/conf.d/ | ||
chmod 755 /etc/exim4/eximconfig/ | ||
chown root:Debian-exim /etc/exim4/exim.key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+chown root:Debian-exim /etc/exim4/exim.key
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
chmod 755 /etc/exim4/conf.d/ | ||
chmod 755 /etc/exim4/eximconfig/ | ||
chown root:Debian-exim /etc/exim4/exim.key | ||
chmod 640 /etc/exim4/exim.key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+chmod 640 /etc/exim4/exim.key
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
#!/bin/bash | ||
# Script to apply adjustments for exim | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if done somewhere
stop exim before mods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if [ -z $(grep -r "root: $rootAddress" /etc/aliases) ]; then | ||
read -p "To which mail address shall mails for root user relayed to?: " rootMail | ||
echo "root: $rootMail" >> /etc/aliases | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that exim reconfigure ask now to create root=mymail
I need to check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,
with Debian 8 and dpkg-reconfigure exim4-config
if root=mymail do not exist reconfigure ask to create one and ask for one email
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done is removed
#!/bin/bash | ||
# Configuration script for mailwatch with postfix | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you stop postfix before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mailwatch-postfix.sh
Only this to do in main.cf to have Postfix running "out of box"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. only header_checks and file permissions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work on RH systems
sed -i -e "s/ALLGRANTED/Order allow,deny\n Allow from all/" "$DIR/etc/apache2/conf-enabled/mailwatch.conf" | ||
fi | ||
|
||
sed -i -e "s/WEBFOLDER/$WebFolder/" "$DIR/etc/apache2/conf-enabled/mailwatch.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+sed -i -e "s/WEBFOLDER/$WebFolder/" "$DIR/etc/apache2/conf-enabled/mailwatch.conf"
+cp "$DIR/etc/apache2/conf-enabled/mailwatch.conf" /etc/apache2/conf-enabled/mailwatch.conf
For Debian 8 and Apache 2.4
in conf-available
a2enconf mailwatch.conf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using ln in case a2enconf is not available
setup.sh
Outdated
fi | ||
|
||
EndNotice="" | ||
Webuser="www-data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be set when we check for installed web servers or select the web server we want.
Also need to make sure this is passed to the other scripts that currently use "www-data"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
setup.sh
Outdated
elif [ $response == 1 ]; then | ||
#Apache | ||
logprint "Installing apache" | ||
$PM install apache2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [[ $PM == "yum" ]]; then
$PM install httpd
Webuser="apache"
else
$PM install apache2
Webuser="www-data"
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
setup.sh
Outdated
logprint "Clearing temp dir" | ||
rm -rf /tmp/mailwatchinstall/* | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check that wget is installed before we call it below
if ! ( type "wget" > /dev/null 2>&1 ) ; then
$PM install wget
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
setup.sh
Outdated
#Nginx | ||
logprint "Installing nginx" | ||
$PM install nginx | ||
WebServer="nginx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need Webuser as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
# Use specific "local" routine: | ||
# conf.d/main/000_localmacros | ||
# conf.d/main/01_mailscanner_config | ||
# conf.d/acl/30_exim4-config_check_callback_relay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# conf.d/acl/30_exim4-config_check_callback_relay
replace by
# acl_check_recipient_relay
#smtp_accept_max = 100 | ||
#smtp_accept_reserve = 15 | ||
#queue_run_max = 6 | ||
#deliver_queue_load_max |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#smtp_load_reserve = 5
#deliver_queue_load_max = 10
setup.sh
Outdated
##ask directory for web files | ||
read -p "In what location should MailWatch be installed?[/var/www/mailscanner/]:" WebFolder | ||
if [ -z $WebFolder ]; then | ||
WebFolder="/var/www/mailscanner/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- WebFolder="/var/www/html/mailscanner/"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
# Exim deamon listening port | ||
daemon_smtp_ports = 25 : 587 | ||
|
||
# Activate TLS/SSL configuration for exim as an SMTP server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add # exim.crt and exim.key files needed before activating the feature.
@@ -0,0 +1,5 @@ | |||
# Domain routing list for relayed domain names (domains/relay) - Mail sent | |||
# to these domains will be routed via the specified mail server(s). | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+#
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
Webuser="$1" | ||
|
||
/etc/init.d/exim4 stop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or better.
service exim4 stop
service exim4 start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the service binary exist for suse/redhat/centos/fedora?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure at 100% but more "independent" from type of init systems installed.
- service may run scripts from either upstart, System V or systemd.
- select automatically between systemV, upstart or systemd
- service runs scripts in a predictable environment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asuweb does this apply for redhat etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fedora / RHEL / CentOS Linux
In fact RedHad started to use "service" many years before Debian.
|
||
# Various Debian's variables | ||
MAIN_TIMEOUT_FROZEN_AFTER = 2d | ||
MAIN_FREEZE_TELL = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MAIN_FREEZE_TELL = postmaster
Hello! In my opinion, a working mailwatch setup need a complete working mta install too. If you don't do this, the support will be very high. I prefer to think setup.sh for a "standard" user first not for a power user with special needs or the knowledge to install all these stuff manually. If you look on Google for mailscanner/mailwatch, 80% of support is about the mta part in fact. Except the use of razor and pyzor, others points I posted are for me needed and respect default packaged binary configs and guideline. No problem to forget these points. But this This is only my personal opinion too. ;) |
CHECK_RCPT_VERIFY_SENDER = true | ||
CHECK_RCPT_LOCAL_LOCALPARTS = true | ||
CHECK_RCPT_REMOTE_LOCALPARTS = true | ||
#CHECK_RCPT_VERIFY_SENDER = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+#CHECK_RCPT_VERIFY_SENDER = true
double
I'm going to echo @asuweb here. Be careful trying to be everything for everybody. Although you may be trying to help out those who don't necessarily know how to configure their systems, you are probably going to set yourself up for a support nightmare of your own when you realize just how much you are trying to tackle. What you are doing is a similar thing that I do just on CentOS, and I can tell you that trying to expand what I do to multiple distros and MTA combinations would be a mountainous task. |
@@ -0,0 +1,82 @@ | |||
# General config for MailScanner Gateway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error, the file should be in /etc/exim4/conf.d/main/
EDIT:
New version for conf.d/main/00_mailscanner_listmacrosdefs
I reduced options to the minimum and added some comments.
# General Exim config for MailScanner Gateway
# conf.d/main/00_mailscanner_listmacrosdefs
# Use these specific config files:
# conf.d/main/01_mailscanner_config
# mailscanner_acldefs
# If you have your own Exim setup remove this file
# and mailscanner_acldefs
# Exim deamon listening port
daemon_smtp_ports = 25 : 587
# Activate TLS/SSL configuration for Exim
# exim.crt and exim.key files needed before activating the feature
#MAIN_TLS_ENABLE = Yes
# Do a reverse DNS lookup on all incoming IP calls
MAIN_HOST_LOOKUP = Yes
# Access list of domains to relay
# Domains to route are in /etc/exim4/hubbed_hosts
MAIN_RELAY_TO_DOMAINS = /etc/exim4/relay_domains
# Link to specific ACLs
CHECK_RCPT_LOCAL_ACL_FILE = CONFDIR/mailscanner_acldefs
# To activate sender callback on remote host (mailhub)
# Useful to avoid bad bounce (do verify at SMTP time)
#RECIPIENT_VERIFY_CALLBACK_RELAY = true
# Deny if the sender host does not have valid reverse DNS.
#CHECK_RCPT_REVERSE_DNS_DENY = true
# Various Debian's ACL check
CHECK_MAIL_HELO_ISSUED = true
CHECK_RCPT_VERIFY_SENDER = true
CHECK_RCPT_LOCAL_LOCALPARTS = true
CHECK_RCPT_REMOTE_LOCALPARTS = true
# Various Debian's variables
MAIN_TIMEOUT_FROZEN_AFTER = 2d
MAIN_FREEZE_TELL = postmaster
MESSAGE_SIZE_LIMIT = 50M
MAIN_IGNORE_BOUNCE_ERRORS_AFTER = 3h
# Various Exim variables
rfc1413_hosts = *
rfc1413_query_timeout = 0s
smtp_banner = $smtp_active_hostname ESMTP $tod_full
# To activate logging
MAIN_LOG_SELECTOR = +address_rewrite \
+all_parents \
-arguments \
+connection_reject \
+delay_delivery \
+delivery_size \
+dnslist_defer \
+incoming_interface \
+incoming_port \
+lost_incoming_connection \
+queue_run \
+received_sender \
+received_recipients \
-retry_defer \
+sender_on_delivery \
+size_reject \
-skip_delivery \
+smtp_confirmation \
+smtp_connection \
+smtp_protocol_error \
+subject \
+tls_cipher \
+tls_peerdn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,12 @@ | |||
# Config for MailScanner Gateway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the filename from acl_check_recipient_relay
to mailscanner_acldefs
EDIT:
Updated content.
# Config for MailScanner Gateway
# /etc/exim4/mailscanner_acldefs
# Use with CHECK_RCPT_LOCAL_ACL_FILE = CONFDIR/mailscanner_acldefs
# To activate sender callback on remote host (mailhub) at SMTP time
# Useful to avoid bad bounce (do verify at SMTP time)
.ifdef RECIPIENT_VERIFY_CALLBACK_RELAY
# Recipient verification for relay domains with callback
deny !acl = acl_local_deny_exceptions
log_message = 550 Unknown user ${local_part}@${domain} (Recipient relay callback verification failed)
message = 550 Unknown user
! verify = recipient/defer_ok/callout=10s,defer_ok
.endif
# Deny if the sender host does not have valid reverse DNS.
#
# If your system can do DNS lookups without delay or cost, you might want
# to enable this.
# If sender_host_address is defined, it's a remote call. If
# sender_host_name is not defined, then reverse lookup failed. Use
# this instead of !verify = reverse_host_lookup to catch deferrals
# as well as outright failures.
.ifdef CHECK_RCPT_REVERSE_DNS_DENY
deny
condition = ${if and{{def:sender_host_address}{!def:sender_host_name}}\
{yes}{no}}
add_header = X-Host-Lookup-Failed: Reverse DNS lookup failed for $sender_host_address (${if eq{$host_lookup_failed}{1}{failed}{deferred}})
.endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
Webuser="$1" | ||
|
||
/etc/init.d/exim4 stop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure at 100% but more "independent" from type of init systems installed.
- service may run scripts from either upstart, System V or systemd.
- select automatically between systemV, upstart or systemd
- service runs scripts in a predictable environment
I agree. Difficult and painful to support all distributions. Start with Debian - Ubuntu / RedHat - CentOS will be enough. |
/etc/init.d/exim4 stop | ||
|
||
cp -f "$DIR/etc/default/exim4" /etc/default/exim4 | ||
cp -R "$DIR"/etc/exim4/* /etc/exim4/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove cp -R "$DIR"/etc/exim4/* /etc/exim4/
Should be:
cp -f "$DIR"/etc/exim4/mailscanner_acldefs /etc/exim4/.
cp -f "$DIR"/etc/exim4/hubbed_hosts /etc/exim4/.
cp -f "$DIR"/etc/exim4/relay_domains /etc/exim4/.
cp -f "$DIR"/etc/exim4/conf.d/main/00_mailscanner_listmacrosdefs /etc/exim4/conf.d/main/.
cp -f "$DIR"/etc/exim4/conf.d/main/01_mailscanner_config /etc/exim4/conf.d/main/.
And to simplify again, remove all these not essential files:
host_local_deny_exceptions
local_host_blacklist
local_rcpt_callout
local_sender_blacklist
local_sender_callout
sender_local_deny_exceptions
Should be over now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
chown -R root:root /etc/exim4 | ||
chmod -R 644 /etc/exim4 | ||
chmod 755 /etc/exim4/conf.d/ | ||
chmod 755 /etc/exim4/eximconfig/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete chmod 755 /etc/exim4/eximconfig/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
setup.sh
Outdated
cp "$InstallFilesFolder"/MailScanner_perl_scripts/* /etc/MailScanner/custom/ | ||
|
||
logprint "Restart mailscanner service" | ||
/etc/init.d/mailscanner restart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add before restart:
check if run_mailscanner=1 in /etc/MailScanner/defaults, if not add it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If mailscanner is installed by the script at the end the user gets a message that he has to configure needed settings in mailscanner.conf and the defaults file. And because the user should at least look at mailscanner configuration he should set this himself I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I understand.
@@ -0,0 +1,29 @@ | |||
# Example config for exim /etc/MailScanner/conf.d/mailwatch.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%org-name% and all occurrence missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I'm wrong to try to put in /etc/MailScanner/conf.d/mailwatch.conf "personal" informations.
We just need to have in mailwatch.conf the essential values needed by MailWatch and say to the user to define another file as /etc/MailScanner/conf.d/server.conf where he will put is own personal informations.
If we do this, may be this is not needed in mailwatch.conf:
Max Unscanned Messages Per Scan = 50
Max Unsafe Messages Per Scan = 50
Max Normal Queue Size = 2000
Deliver Unparsable TNEF = yes
Find UU-Encoded Files = yes
Max Children = 10
To check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to split in 2 files in conf.d. Work fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up to be as postfix version (same variable order).
# Example config for Exim /etc/MailScanner/conf.d/mailwatch.conf
Run As User = Debian-exim
Run As Group = Debian-exim
MTA = exim
Incoming Work User = Debian-exim
Incoming Work Group = mtagroup
Incoming Work Permissions = 0660
Detailed Spam Report = yes
Quarantine Whole Message = yes
Quarantine Whole Messages As Queue Files = no
Include Scores In SpamAssassin Report = yes
Quarantine User = Debian-exim
Quarantine Group = mtagroup
Quarantine Permissions = 0644
Always Looked Up Last = &MailWatchLogging
Is Definitely Not Spam = &SQLWhitelist
Is Definitely Spam = &SQLBlacklist
Incoming Queue Dir = /var/spool/exim4/input
Outgoing Queue Dir = /var/spool/exim4_outgoing/input
Sendmail = /usr/sbin/exim4
Sendmail2 = /usr/sbin/exim4 -DOUTGOING
SpamAssassin Local State Dir = /var/lib/spamassassin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,5 @@ | |||
# Example config for apache /etc/apache2/conf-enabled/mailwatch.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path for RH based systems is:
/etc/httpd/conf.d/
apacheBin="httpd" | ||
fi | ||
if [ -z $("$apacheBin" -v | grep "Apache/2.4") ] | ||
sed -i -e "s/ALLGRANTED/Require all granted/" "$DIR/etc/apache2/conf-available/mailwatch.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to pass OS specific directories (/etc/httpd/conf.d/ for RH based systems)
sed -i -e "s/ALLGRANTED/Order allow,deny\n Allow from all/" "$DIR/etc/apache2/conf-available/mailwatch.conf" | ||
fi | ||
# a2enconf mailwatch.conf | ||
ln -r -s /etc/apache2/conf-enabled/mailwatch.conf /etc/apache2/conf-available/mailwatch.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No symbolic links required for RH
sed -i -e "s/WEBFOLDER/$WebFolder/" "$DIR/etc/apache2/conf-enabled/mailwatch.conf" | ||
cp "$DIR/etc/apache2/conf-enabled/mailwatch.conf" /etc/apache2/conf-enabled/mailwatch.conf | ||
|
||
a2enmod ssl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debian specific, no "a2" commands on RH
cp "$DIR/etc/apache2/conf-enabled/mailwatch.conf" /etc/apache2/conf-enabled/mailwatch.conf | ||
|
||
a2enmod ssl | ||
service apache2 reload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
service httpd reload
for RH
@@ -0,0 +1,16 @@ | |||
# Config for MailScanner Gateway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No conf.d
on RH for exim
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
Webuser="$1" | ||
|
||
service exim4 stop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
service exim stop
for RH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better if this is separated as not compatible with RH - probably better to use separate exim setup script for RH if we decide we want it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better if this is separated as not compatible with RH - probably better to use separate exim setup script for RH if we decide we want it.
Not only for exim, for all. rpm and deb distributions are too differents.
#!/bin/bash | ||
# Configuration script for mailwatch with postfix | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work on RH systems
#copy web files | ||
logprint "Moving MailWatch web files to new folder and setting permissions" | ||
mv "$InstallFilesFolder/mailscanner/" $WebFolder | ||
chown root:mtagroup $WebFolder/images |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check that mtagroup
exists before we run the chown
- it exists by default in centos 7.
Doesn't appear to exist by default in in debian 8, centos 6, Ubuntu 14.04 / 16.04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be create if not existant but I think mailscanner setup would do this too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are correct, mailscanner install creates the group :)
fi | ||
fi | ||
|
||
read -p "MailWatch requires the php packages php5 php5-gd and php5-mysqlnd. Do you want to install them if missing?(y/n)[y]: " installPhp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably check is PHP is already installed, and what version.
On debian based systems the below will install php5 regardless of any other versions of php.
On RH systems, only 1 version of PHP can be installed by yum - and packages are defined as php php-gd
etc default version is v5.
If useful, I propose some ideas for the hierarchy and scripts for rpm and deb based distributions. May be complex but can manage all cases. Its modular and easy to maintain. Bash script can be called as this (example with exim): exim.sh (--help, without param do nothing) We can add more -- parameters as --db, --webroot, --debian, --ubuntu, and others. We have a branch/directory only when we have a "template" to place inside it.
And others branches if some missing. If you like, I can complete with the 'template" files inside the directories. |
@stefaweb the downside on that is that large parts are equal on deb and rpm and when doing maintenance you always have to check two files if both need the changes |
No problem. I propose. ;) And you have a tree for free! |
Seems @endelwar is back! |
Good work guys! |
Is it possible to have a "debug simulation" feature? We see "action", but nothing is done... |
@Skywalker-11 - can you push this branch to the new install repo please? |
pr is now in that develop branch |
@endelwar is it on purpose that we have GPL-3 in that new repo and GPL-2 here? |
Install script that installs all necessary dependencies and basic configuration of mta, webserver and MailScanner for use with MailWatch.
The current version installs postfix, apache, MailScanner and MailWatch for Debian (tested with Debian 8.7 netinstall) and configures them. Should also work with Ubuntu >= 14.0
TODO: