Bearbeiten von „StuRa:Server/srs14

Zur Navigation springen Zur Suche springen
Warnung: Du bist nicht angemeldet. Deine IP-Adresse wird bei Bearbeitungen öffentlich sichtbar. Melde dich an oder erstelle ein Benutzerkonto, damit Bearbeitungen deinem Benutzernamen zugeordnet werden. Ein eigenes Benutzerkonto hat eine ganze Reihe von Vorteilen.

Die Bearbeitung kann rückgängig gemacht werden. Bitte prüfe den Vergleich unten, um sicherzustellen, dass du dies tun möchtest, und veröffentliche dann unten deine Änderungen, um die Bearbeitung rückgängig zu machen.

Aktuelle Version Dein Text
Zeile 1: Zeile 1:
[[PT]] und [[bommel]] 2018-02-09 bauen nach der Doku [[Server/Jails/SRS14]].
[[PT]] und [[bommel]] 2018-02-09 bauen nach der Doku [[Server/Jails/SRS14]].
== Dienste ==
: Ersatz von [[Server/SRS14/2018]]
* Erhalt von Mails für [[Mail-Adresse]]n für die Domain ''stura.htw-dresden.de''
*: [[postfix]]
* Verwaltung von Mail-Adressen (von Personen und Funktionen)
** Einträge für die Weiterleitung an andere Mail-Adressen
**: [[aliases]]
** Versand von Mails
**: [[postfix]]
** <s>grafische Oberfläche für die Verwaltung von Mail-Adressen</s>
* Verteilung von Mails für Mail-Adressen (für Funktionen)
*: [[mailman]]
* Archivierung von Mails für Mail-Adressen (für Funktionen)
*: [[mailman]]
* grafische Oberfläche für die Verwaltung von Mail-Verteilern
*: [[mailman]]
* Vermeidung der Weiterleitung von SPAM
*: [[postfix]]
* <!-- Soll das so? Der Dienst wurde "nur" übernommen, da er wohl seit vielen Jahren schon läuft. --> (Archivierung (als Sicherheitskopie) für [[Mail-Adresse]]n von [[Angestellte]]n)
*: [[maildrop]]
== Betriebssystem ==
: [[Maschine/nyx]]
:: Jail [[FreeNAS]]
: [[FreeBSD]]
:: STABLE
:: (11.1)


== Installation ==
== Installation ==


== Konfiguration ==
=== eingehängter Massenspeicher ===


==== Datasets ====
: pkg update
: pkg install apache24 maildrop sudo


Für die individuelle Behandlung der besonders nennenswerten Daten (z.B. Mail-Archive und Mail-Konten) zu erhalten, werden diese jeweils als ein separates Dataset (für ZFS) verwaltet. Die Datasets (für ZFS) sind als Dataset (für ZFS) auf dem Host erstellt ([[srs100034#Datasets]]) und Sind vom Host in die Jail eingehängt.
Mailman und Postfix muss aus den Ports gebaut werden, weil die Paket sendmail als MTA unterstuetzt, wir aber Postfix benoetigen. Es gibt sonst Permission Probleme mit dem wrapper script.


: portsnap fetch extract
: cd /usr/ports/mail/mailman
: ALLOW_UNSUPPORTED_SYSTEM=1 make config
<pre>
<pre>
/mnt/znyx/data/maildrop/rossberg on /mnt/znyx/jails/srs14/usr/home/rossberg/Mail (nullfs, local)
    DOCS=on: Build and/or install documentation
/mnt/znyx/data/maildrop/spam on /mnt/znyx/jails/srs14/usr/home/spam/Mail (nullfs, local)
    HTDIG=off: - EXPERIMENTAL - htdig integration patches
/mnt/znyx/data/mailman/archives on /mnt/znyx/jails/srs14/usr/local/mailman/archives (nullfs, local)
    NAMAZU2=off: Make private archives searchable with namazu2
/mnt/znyx/data/mailman/data on /mnt/znyx/jails/srs14/usr/local/mailman/data (nullfs, local)
    NLS=on: Native Language Support
/mnt/znyx/data/mailman/lists on /mnt/znyx/jails/srs14/usr/local/mailman/lists (nullfs, local)
  Integrate with which MTA?: you have to select exactly one of them
</pre>
    COURIER=off: for use with courier
 
    EXIM4=off: for use with exim4
=== Dienste ===
    OPENSMTPD=off: for use with opensmtpd - EXPERIMENTAL -
 
    POSTFIX=on: for use with postfix
==== SSH ====
    SENDMAIL=off: for use with sendmail
 
SSH wird benötigt, um sich sicher auf [[{{PAGENAME}}]] verbinden zu können. Das ist bei [[{{PAGENAME}}]] insbesondere für die (leider noch leidliche) Verwaltung der Einträge für [[Mail-Adresse]]n nötig.
 
; andauernde Aktivierung des Dienstes SSH:
 
: <code>service sshd status</code>
<pre>
Cannot 'status' sshd. Set sshd_enable to YES in /etc/rc.conf or use 'onestatus' instead of 'status'.
</pre>
: <code>service sshd onestatus</code>
<pre>
sshd is not running.
</pre>
: <code>sysrc sshd_enable</code>
<pre>
sshd_enable: NO
</pre>
: <code>sysrc sshd_enable=YES</code>
<pre>
sshd_enable: NO -> YES
</pre>
: <code>service sshd status</code>
<pre>
sshd is not running.
</pre>
: <code>service sshd start</code>
<pre>
Generating RSA host key.
</pre>
 
<pre>
Performing sanity check on sshd configuration.
Starting sshd.
</pre>
: Es wurden automatisch Schlüsselpaare für den Account ''root'' (für ''RSA'', ''ECDSA'' und ''ED25519'') generiert.
: <code>service sshd status</code>
<pre>
sshd is running as pid 12345.
</pre>
: <code>sysrc sshd_enable</code>
<pre>
sshd_enable: YES
</pre>
 
; Konfiguration vom Dienst SSH (auf Schnell)
 
(optionale) Sicherung der standardmäßigen Datei für die Konfiguration vom Dienst SSH
: <code>cp /etc/ssh/sshd_config /etc/ssh/sshd_config.default</code>
 
Anpassen der Konfiguration vom Dienst SSH
* Ändern vom Port an dem der Dienst SSH erreichbar ist
*: aus "Tradition")
* Zulassen vom der Anmeldung mit Passwort für den Dienst SSH
*: Es gibt Menschen, denen nicht bekannt ist wie das Verwalten von persönlichen Schlüsselpaaren funktioniert (und auch nicht erklärten werden müssen soll), die dennoch bei der Verwaltung von Mail-Adressen mitwirken können sollen und sich dazu auch aus der Ferne anmelden können sollen.
: <code>$EDITOR /etc/ssh/sshd_config</code>
::: <code>diff /etc/ssh/sshd_config.default /etc/ssh/sshd_config</code>
<pre>
17a18
> Port 1234
75a77
> PasswordAuthentication yes
</pre>
:: oder
::: <code>diff /etc/ssh/sshd_config.default /etc/ssh/sshd_config</code>
<pre>
17c17
< #Port 22
---
> Port 1234
75c75
< #PasswordAuthentication no
---
> PasswordAuthentication yes
</pre>
 
=== Konten ===
 
Hinzufuegen von System Konten.
 
==== Mail - Angestellten ====
: Rossberg
Shell: nologin
 
  remote: cd /home/rossberg && tar -cvf rossberg.tar .mailfilter Mail .mail_aliases .rhosts
cd /home/rossberg && tar -xvf rossberg.tar
 
==== Mail - spam ====
: Spam
Shell: nologin
 
===== Clean SPAM older 30 Days =====
 
Quelle des Programms http://forum.directadmin.com/attachment.php?s=b1485c6c4b4d501d922e5b7f48d6e07c&attachmentid=427&d=1167030675 und modifiziert durch [[PT]].
 
Datei ist abgelegt unter /etc/periodic/daily/900.cleanspam und wird taeglich ausgefuehrt.
 
<pre>
#!/bin/sh                                                                                                                                                                                                                                                                                                 
# Cleanning SPAM older than x days under Maildir system (Test under DA + Dovecot + SA)                 
# Published 27 Oct 2006 under GNU/GPL License By, Pinkkeyhost.com, Korakot Eamopas (kkeonline[at]yahoo.com)                                                                                                       
# Bugfix 25 Dec 2006                                                                                   
# Modified 25.02.2018 from pwnytail to run under Postfix maildrop
                                                                                                                                                                                                                 
# settings                                                                                             
# delete spam older than x days                                                                         
DAYS=30 ;                                                                                                                                                                                                         
# your logfile                                                                                         
logfile="/var/log/cleanspam.log" ;                                                                     
                                                   
if [ "$#" -lt 1 ]                                 
then                                               
        echo -n "usage: $0 <list of users>"       
        exit 1                                     
fi                                                 
                                                   
# Start a new log or append to old one            
#echo "" > $logfile ;                             
echo "" >> $logfile ;
 
# Nothing to be change from here
LOGDATE=`date "+%y-%m-%d %H:%M"` ;
DA="/usr/home" ;
SP="Mail" ;
USERS=$@
echo "===============================" >> $logfile ;
echo "SCRIPT RUNNING ON $LOGDATE" >> $logfile
echo "===============================" >> $logfile ;
 
# list users from da folder
for user in $USERS ; do
{
        # skip if not a user folder
        if [ ! -d $DA/$user ] ; then
          continue
        fi
 
        echo " " >> $logfile
        echo "CHECKING USER : $user" >> $logfile
 
 
        # Check Main account
        if [ -d /home/$user/$SP ]; then
                echo " " >> $logfile
                echo "CHECKING FOR : $user" >> $logfile
                for nct in new cur tmp ; do
                        {
                                if [ -d /home/$user/$SP/$nct ]; then
                                        # find file older than 30 days
                                        for oldfile in `find /home/$user/$SP/$nct/ -mtime +$DAYS`; do
                                                {
                                                        if [ -f $oldfile ]; then
                                                                echo -n "DELETE : $oldfile" : >> $logfile
                                                                # Keep a bit info of what we going to delete
                                                                head -n 1 $oldfile >> $logfile
                                                                # Bugfix 25 Dec 2006
                                                                #rm -f /home/$user/$SP/$nct/$oldfile >> /dev/null
                                                                rm -f $oldfile >> /dev/null
                                                        fi
                                                }
                                        done;
                                fi
                        }
                done;
        fi
};
done;
</pre>
</pre>
: ALLOW_UNSUPPORTED_SYSTEM=1 make install


== Pakete ==
=== Verwaltung von Paketen ===
In erster Linie wird die normale (einfache) Verwaltung von Paketen (mit <code>[[man:pkg|pkg]]</code>) verwendet.
Aber die Verwendung der Sammlung von Ports ([[freebsd-handbook:ports-using]]) wurde notwendig.
: Die vorherige Instanz verwendete die Kombination der Pakete Postfix und Mailman. Das standardmäßige Paket für Mailman ist ohne die Option für Postfix gebaut (<code>[[man:pkg-search|pkg search]] -Q options mailman</code>).
:: Damn!
:: Anstatt das Risiko einzugehen sich mit der Konfiguration beim Verzicht auf Postfix auseinanderzusetzen und anstelle sendmail zu verwenden, bauen wir das Paket eben einfach selbst. Dafür ist dann aber auch die Verwendung der Sammlung von Ports notwendig.
==== Sammlung von Ports ====


: <code>portsnap fetch extract</code>
: cd /usr/ports/mail/postfix
 
: ALLOW_UNSUPPORTED_SYSTEM=1 make config
===== Notwendigkeit für die Verwendung der [[#Sammlung von Ports|Sammlung von Ports]] =====
 
Mailman und Postfix muss aus den Ports gebaut werden, weil das Paket mailman sendmail als MTA unterstuetzt, wir aber Postfix benoetigen. Es gibt sonst Permission Probleme mit dem wrapper script zwischen postfix
und mailman.
 
Error Nachricht 1 bevor Mailman aus den Ports gebaut wurde:
: [...]Mailman mail-wrapper: Group mismatch error.  Mailman expected the mail wrapper script to be executed as group "mailnull", but the system's mail server executed the mail script as group "mailman".  Try tweaking the mail server to run the script as group "mailnull", or re-run configure,  providing the command line option `--with-mail-gid=mailman'.
 
dann aendert sich die Nachricht zu:
Error Nachricht 2 bevor Postfix aus den Ports gebaut wurde:
: [...]Mailman mail-wrapper: Group mismatch error.  Mailman expected the mail wrapper script to be executed as group "mailman", but the system's mail server executed the mail script as group "nobody".  Try tweaking the mail server to run the script as group "mailman", or re-run configure,  providing the command line option `--with-mail-gid=nobody'.
 
=== Aktualisierung von Paketen ===
 
: <code>pkg update && pkg upgrade -y</code>
 
=== Pakete für Anwendungen ===
 
==== sendmail ====
 
==== Postfix ====
 
===== Installation von Postfix =====
 
Wechseln in den Ordner vom Port ''postfix''
: <code>cd /usr/ports/mail/postfix</code>
 
Festlegen der Konfiguration für das angepasste Bauen des Paketes (''postfix'')
: <code>make config</code>
<pre>
<pre>
         BDB            : off
         BDB            : off
Zeile 284: Zeile 50:
         TLS            : on
         TLS            : on
</pre>
</pre>
: ALLOW_UNSUPPORTED_SYSTEM=1 make install
INFO: Alle folgenden Abfragen im build-Prozess werden mit der vorgeschlagenden Einstellung uebernommen.
== Konfiguration ==
=== Dienste ===
'''/etc/rc.conf'''


<pre>
<pre>
/!\ ERROR: /!\
apache24_enable="YES"
mailman_enable="YES"
postfix_enable="YES"
sendmail_enable="NO"
</pre>
 
=== Konten ===
 
Hinzufuegen von System Konten.


Ports Collection support for your FreeBSD version has ended, and no ports are
==== Mail - Angestellten ====
guaranteed to build on this system. Please upgrade to a supported release.
: Rossberg
Shell: nologin


No support will be provided if you silence this message by defining
remote: cd /home/rossberg && tar -cvf rossberg.tar .mailfilter Mail .mail_aliases .rhosts
ALLOW_UNSUPPORTED_SYSTEM.
cd /home/rossberg && tar -xvf rossberg.tar
</pre>
Bauen des Paketes (''postfix'') entsprechend der angepassten Konfiguration
: <code>ALLOW_UNSUPPORTED_SYSTEM=1 make install clean</code>


<?!? />
==== Mail - spam ====
INFO: Alle folgenden Abfragen im build-Prozess werden mit der vorgeschlagenden Einstellung übernommen.
: Spam
Shell: nologin


: <code>sysrc postfix_enable=YES</code>
==== Aliases ====
: <code>sysrc sendmail_enable=NO</code>
'''/etc/aliases.stura'''


===== Konfiguration Postfix =====
newaliases
postmap /etc/aliases.stura


=== Postfix ===
'''/usr/local/etc/postfix/main.cf'''
'''/usr/local/etc/postfix/main.cf'''
<pre>
<pre>
Zeile 311: Zeile 95:
mydomain = stura.htw-dresden.de  
mydomain = stura.htw-dresden.de  


#smtp_bind_address = 141.56.50.14
smtp_bind_address = 141.56.50.14
smtp_bind_address = 141.56.51.14


myorigin = $myhostname
myorigin = $myhostname
Zeile 324: Zeile 107:
# 141.56.16.134 - 141.56.16.136 mailexchanger vom RZ
# 141.56.16.134 - 141.56.16.136 mailexchanger vom RZ
# 141.56.16.231 - 232 mailrelay vom RZ
# 141.56.16.231 - 232 mailrelay vom RZ
mynetworks = 141.56.16.131, 141.56.16.134, 141.56.16.135, 141.56.16.136, 141.56.16.231, 141.56.16.232, 141.56.50.0/26, 127.0.0.0/24, 192.168.100.12, 141.56.51.0/24
mynetworks = 141.56.16.131, 141.56.16.134, 141.56.16.135, 141.56.16.136, 141.56.16.231, 141.56.16.232, 141.56.50.0/26, 127.0.0.0/24, 192.168.100.12
 


alias_maps = hash:/etc/aliases, hash:/etc/aliases.stura, hash:/usr/local/mailman/data/aliases
alias_maps = hash:/etc/aliases, hash:/etc/aliases.stura, hash:/usr/local/mailman/data/aliases
Zeile 334: Zeile 116:


mail_spool_directory = /var/mail
mail_spool_directory = /var/mail
mailbox_command = /usr/local/bin/maildrop -d ${USER}
mailbox_command = /usr/local/bin/maildrop -d ${USER}


header_checks = pcre:$config_directory/header_checks
header_checks = pcre:$config_directory/header_checks
####
sendmail_path = /usr/local/sbin/sendmail
newaliases_path = /usr/local/bin/newaliases
mailq_path = /usr/local/bin/mailq
setgid_group = maildrop
html_directory = /usr/local/share/doc/postfix
manpage_directory = /usr/local/man
sample_directory = /usr/local/etc/postfix
readme_directory = /usr/local/share/doc/postfix
inet_protocols = ipv4
####


smtpd_sender_restrictions =
smtpd_sender_restrictions =
Zeile 389: Zeile 158:
<pre>
<pre>
/^X-HTW-Spam-Flag:\s+YES/  REDIRECT spam@stura.htw-dresden.de
/^X-HTW-Spam-Flag:\s+YES/  REDIRECT spam@stura.htw-dresden.de
/^X-Spam-Flag:\s+YES/  REDIRECT spam@stura.htw-dresden.de
</pre>
</pre>


Zeile 418: Zeile 186:
  postfix/postfix-script: starting the Postfix mail system
  postfix/postfix-script: starting the Postfix mail system


===== Benutzung von Postfix =====
=== Apache ===


[[#Postfix]] ist der Ersatz von [[#sendmail]].
'''/usr/local/etc/apache24/httpd.conf'''
 
; Verwaltung von Einträgen für Mail-Adressen:
 
Bearbeitung der Datei für Mail-Adressen (speziell für den StuRa) ''/etc/aliases.stura''
: <code>$EDITOR /etc/aliases.stura</code>
(vielleicht notwendiges) Neubauen der Datenbank zwecks sendmail für Mail-Adressen
: <code>newaliases</code>
(vielleicht notwendiges) Neubauen der Datenbank zwecks postfix für Mail-Adressen (speziell für den StuRa)
: <code>postalias /etc/aliases.stura</code>
 
===== Problem zum Ableiten von SPAM wegen geänderter Eintrag von erkannten SPAM im Header =====


Seit 2020-02-27 wurde plötzlich (mutmaßlich nach den Wartungsarbeiten [https://www.htw-dresden.de/news/wartungsarbeiten-im-netzwerk]) (wieder) erkannter SPAM weitergeleitet.
Es konnte festgestellt werden, dass im Header der Mail nicht mehr die Markierung ''X-HTW-Spam-Flag'' verwendet wird, sondern (wieder standardmäßig) ''X-Spam-Flag''.
So wurde in der Datei <code>/usr/local/etc/postfix/header_checks</code>
<pre>
<pre>
/^X-HTW-Spam-Flag:\s+YES/  REDIRECT spam@stura.htw-dresden.de
...
</pre>
ServerAdmin webmaster@stura.htw-dresden.de
<pre>
/^X-Spam-Flag:\s+YES/  REDIRECT spam@stura.htw-dresden.de
</pre>
hinzugefügt.


==== sudo ====
...
 
ServerName lists.stura.htw-dresden.de:80
===== Installation ''sudo'' =====
...
 
# Virtual hosts
Installation vom Paket ''sudo''
Include etc/apache24/extra/httpd-vhosts.conf
: <code>pkg install -y sudo</code>
...
 
===== Konfiguration ''sudo'' =====
 
Eintragen der Accounts, die ''sudo'' benutzen dürfen sollen
: <code>$EDITOR /usr/local/etc/sudoers</code>
 
===== Problem ''Undefined symbol "memset_s"'' =====
 
; Problem: ''sudo'' funktioniert (für die einzelnen Accounts) nicht.
 
: <code>sudo su</code>
<pre>
/usr/local/bin/sudo: Undefined symbol "memset_s"
</pre>
</pre>


; Ursache: Ein Vergleich mit der standardmäßigen Datei zur Verwaltung des Verhaltens von ''sudo'' für berechtigte Accounts und Gruppen ''/usr/local/etc/sudoers'' ergab, dass sich der Fehler aus dem
'''/usr/local/etc/apache24/extra/httpd-vhosts.conf'''
 
; Lösung: Berichtigung der Konfiguration in der Datei zur Verwaltung des Verhaltens von ''sudo'' für berechtigte Accounts und Gruppen ''/usr/local/etc/sudoers''


Hinzufügen der Festlegung, dass für ''sudo'' standardmäßig nach dem Password des jeweiligen Accounts gefragt wird
: <code>$EDITOR /usr/local/etc/sudoers</code>
<pre></pre>
<pre>
<pre>
# Defaults targetpw  # Ask for the password of the target user
<VirtualHost lists.stura.htw-dresden.de:80>
Defaults targetpw 
  ServerAdmin webmaster@stura.htw-dresden.de
# ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'
  DocumentRoot "/usr/local/mailman/lists"
  ServerName lists.stura.htw-dresden.de
  ServerAlias lists.stura.htw-dresden.de
  <Directory /usr/local/mailman/archives/>
      Options FollowSymLinks
      AllowOverride None
  </Directory>
  Alias /pipermail/ /usr/local/mailman/archives/public/
  Alias /images/mailman/ /usr/share/images/mailman/
  ScriptAlias /admin /usr/local/mailman/cgi-bin/admin
  ScriptAlias /admindb /usr/local/mailman/cgi-bin/admindb
  ScriptAlias /confirm /usr/local/mailman/cgi-bin/confirm
  ScriptAlias /create /usr/local/mailman/cgi-bin/create
  ScriptAlias /edithtml /usr/local/mailman/cgi-bin/edithtml
  ScriptAlias /listinfo /usr/local/mailman/cgi-bin/listinfo
  ScriptAlias /options /usr/local/mailman/cgi-bin/options
  ScriptAlias /private /usr/local/mailman/cgi-bin/private
  ScriptAlias /rmlist /usr/local/mailman/cgi-bin/rmlist
  ScriptAlias /roster /usr/local/mailman/cgi-bin/roster
  ScriptAlias /subscribe /usr/local/mailman/cgi-bin/subscribe
  ScriptAlias /mailman/ /usr/local/mailman/cgi-bin/
  ScriptAlias / /usr/local/mailman/cgi-bin/listinfo
  <Directory "/usr/local/mailman">
      AllowOverride All
      Options FollowSymlinks
      Require all granted
  </Directory>
  ErrorLog /var/log/mailman-error.log
#   CustomLog /var/log/mailman-access.log combined
</VirtualHost>
</pre>
</pre>
<pre></pre>
==== maildrop ====


===== Installation maildrop =====
=== maildrop ===
 
Installieren vom Paket ''maildrop''
: <code>pkg install -y maildrop</code>
 
===== Konfiguration maildrop =====


MDA: maildrop
MDA: maildrop
Zeile 508: Zeile 259:
   mailbox_command = /usr/local/bin/maildrop -d ${USER}
   mailbox_command = /usr/local/bin/maildrop -d ${USER}


==== Mailman ====
=== Mailman ===
 
; Installieren des Paketes Mailman:
: Erst einmal brauchen wir schnell Mailman mit Postfix.
Wechseln in den Ordner vom Port ''mailman''
: <code>cd /usr/ports/mail/mailman</code>
Festlegen der Konfiguration für das angepasste Bauen des Paketes (''mailman'')
:: <?!?>Wozu müssen wir die Umgebungsvariable ''ALLOW_UNSUPPORTED_SYSTEM=1'' setzen?</?!?>
: <code>make config</code>
<pre>
    DOCS=on: Build and/or install documentation
    HTDIG=off: - EXPERIMENTAL - htdig integration patches
    NAMAZU2=off: Make private archives searchable with namazu2
    NLS=on: Native Language Support
Integrate with which MTA?: you have to select exactly one of them
    COURIER=off: for use with courier
    EXIM4=off: for use with exim4
    OPENSMTPD=off: for use with opensmtpd - EXPERIMENTAL -
    POSTFIX=on: for use with postfix
    SENDMAIL=off: for use with sendmail
</pre>
 
<pre>
/!\ ERROR: /!\
 
Ports Collection support for your FreeBSD version has ended, and no ports are
guaranteed to build on this system. Please upgrade to a supported release.
 
No support will be provided if you silence this message by defining
ALLOW_UNSUPPORTED_SYSTEM.
</pre>
Bauen des Paketes (''mailman'') entsprechend der angepassten Konfiguration
: <code>ALLOW_UNSUPPORTED_SYSTEM=1 make install clean</code>
 
: <code>sysrc mailman_enable=YES</code>
 
===== Konfiguration Mailman =====
: Mailmanumzug :[[http://www.vuksan.com/linux/mailman_moving_lists.html]]
: Mailmanumzug :[[http://www.vuksan.com/linux/mailman_moving_lists.html]]


Zeile 550: Zeile 265:
  cd /usr/local/mailman && tar xvf mailman.tar
  cd /usr/local/mailman && tar xvf mailman.tar


====== Mailman/mm_cfg.py ======
==== Mailman/mm_cfg.py ====


<pre>
<pre>
Zeile 744: Zeile 459:
</pre>
</pre>


==== Apache ====
===== Mounts =====


===== Installation Apache =====
Um eine bessere Handhabung fuer die Daten (z.B. Mail Archive und Mailkonten) zu erhalten, werden diese in ein separates ZFS Dataset ausgelagert und dann in die Jail gehangen.


Installieren vom Paket ''apache24''
: <code>pkg install -y apache24</code>
----
: <code>sysrc apache24_enable=YES</code>
: <code>service apache24 start</code>
===== Konfiguration Apache =====
'''/usr/local/etc/apache24/httpd.conf'''
<pre></pre>
<pre>
<pre>
ServerAdmin webmaster@stura.htw-dresden.de
/mnt/znyx/data/maildrop/rossberg on /mnt/znyx/jails/srs14/usr/home/rossberg/Mail (nullfs, local)
</pre>
/mnt/znyx/data/maildrop/spam on /mnt/znyx/jails/srs14/usr/home/spam/Mail (nullfs, local)
<pre>
/mnt/znyx/data/mailman/archives on /mnt/znyx/jails/srs14/usr/local/mailman/archives (nullfs, local)
ServerName lists.stura.htw-dresden.de:80
/mnt/znyx/data/mailman/data on /mnt/znyx/jails/srs14/usr/local/mailman/data (nullfs, local)
</pre>
/mnt/znyx/data/mailman/lists on /mnt/znyx/jails/srs14/usr/local/mailman/lists (nullfs, local)
<pre>
# Virtual hosts
Include etc/apache24/extra/httpd-vhosts.conf
</pre>
</pre>
<pre></pre>


'''/usr/local/etc/apache24/extra/httpd-vhosts.conf'''
===== Clean SPAM older 30 Days =====


<pre>
Quelle des Programms http://forum.directadmin.com/attachment.php?s=b1485c6c4b4d501d922e5b7f48d6e07c&attachmentid=427&d=1167030675 und modifiziert durch [[PT]]
<VirtualHost lists.stura.htw-dresden.de:80>
  ServerAdmin webmaster@stura.htw-dresden.de
  DocumentRoot "/usr/local/mailman/lists"
  ServerName lists.stura.htw-dresden.de
  ServerAlias lists.stura.htw-dresden.de
  <Directory /usr/local/mailman/archives/>
      Options FollowSymLinks
      AllowOverride None
  </Directory>
  Alias /pipermail/ /usr/local/mailman/archives/public/
  Alias /images/mailman/ /usr/share/images/mailman/
  ScriptAlias /admin /usr/local/mailman/cgi-bin/admin
  ScriptAlias /admindb /usr/local/mailman/cgi-bin/admindb
  ScriptAlias /confirm /usr/local/mailman/cgi-bin/confirm
  ScriptAlias /create /usr/local/mailman/cgi-bin/create
  ScriptAlias /edithtml /usr/local/mailman/cgi-bin/edithtml
  ScriptAlias /listinfo /usr/local/mailman/cgi-bin/listinfo
  ScriptAlias /options /usr/local/mailman/cgi-bin/options
  ScriptAlias /private /usr/local/mailman/cgi-bin/private
  ScriptAlias /rmlist /usr/local/mailman/cgi-bin/rmlist
  ScriptAlias /roster /usr/local/mailman/cgi-bin/roster
  ScriptAlias /subscribe /usr/local/mailman/cgi-bin/subscribe
  ScriptAlias /mailman/ /usr/local/mailman/cgi-bin/
  ScriptAlias / /usr/local/mailman/cgi-bin/listinfo
  <Directory "/usr/local/mailman">
      AllowOverride All
      Options FollowSymlinks
      Require all granted
  </Directory>
  ErrorLog /var/log/mailman-error.log
#  CustomLog /var/log/mailman-access.log combined
</VirtualHost>
</pre>


== Wartung ==
==== Aktualisierung von Paketen ====
{|
|
<pre>
<pre>
pkg lock -y postfix
#!/bin/sh                                                                                                                                                                                                  [18/311]
#Locking postfix-3.3.0.r1,1
                                                                                                       
# Cleanning SPAM older than x days under Maildir system (Test under DA + Dovecot + SA)                 
# Published 27 Oct 2006 under GNU/GPL License By, Pinkkeyhost.com, Korakot Eamopas (kkeonline[at]yahoo.com)                                                                                                       
# Bugfix 25 Dec 2006                                                                                   
# Modified 25.02.2018 from pwnytail to run under Postfix maildrop
                                                                                                                                                                                                                 
# settings                                                                                             
# delete spam older than x days                                                                         
DAYS=30 ;                                                                                                                                                                                                         
# your logfile                                                                                         
logfile="/var/log/cleanspam.log" ;                                                                     
                                                   
if [ "$#" -lt 1 ]                                 
then                                               
        echo -n "usage: $0 <list of users>"       
        exit 1                                    
fi                                                 
                                                   
# Start a new log or append to old one             
#echo "" > $logfile ;                             
echo "" >> $logfile ;


pkg lock -y mailman
# Nothing to be change from here
#Locking mailman-2.1.26_4
LOGDATE=`date "+%y-%m-%d %H:%M"` ;
DA="/usr/home" ;
SP="Mail" ;
USERS=$@
echo "===============================" >> $logfile ;
echo "SCRIPT RUNNING ON $LOGDATE" >> $logfile
echo "===============================" >> $logfile ;


pkg update
# list users from da folder
pkg upgrade -y
for user in $USERS ; do
{
        # skip if not a user folder
        if [ ! -d $DA/$user ] ; then
          continue
        fi


portsnap fetch update
        echo " " >> $logfile
        echo "CHECKING USER : $user" >> $logfile


cd /usr/ports/mail/postfix
ALLOW_UNSUPPORTED_SYSTEM=1 make build
ALLOW_UNSUPPORTED_SYSTEM=1 make deinstall


pkg unlock -y postfix
        # Check Main account
#Unlocking postfix-3.3.0.r1,1
        if [ -d /home/$user/$SP ]; then
ALLOW_UNSUPPORTED_SYSTEM=1 make install clean
                echo " " >> $logfile
pkg lock -y postfix
                echo "CHECKING FOR : $user" >> $logfile
 
                for nct in new cur tmp ; do
cd /usr/ports/mail/mailman
                        {
ALLOW_UNSUPPORTED_SYSTEM=1 make build
                                if [ -d /home/$user/$SP/$nct ]; then
ALLOW_UNSUPPORTED_SYSTEM=1 make deinstall
                                        # find file older than 30 days
pkg unlock -y mailman
                                        for oldfile in `find /home/$user/$SP/$nct/ -mtime +$DAYS`; do
#Unlocking mailman-2.1.26_4
                                                {
ALLOW_UNSUPPORTED_SYSTEM=1 make install clean
                                                        if [ -f $oldfile ]; then
pkg lock -y mailman
                                                                echo -n "DELETE : $oldfile" : >> $logfile
</pre>
                                                                # Keep a bit info of what we going to delete
|
                                                                head -n 1 $oldfile >> $logfile
: <code>service postfix stop</code>
                                                                # Bugfix 25 Dec 2006
: <code>service postfix status</code>
                                                                #rm -f /home/$user/$SP/$nct/$oldfile >> /dev/null
<pre>
                                                                rm -f $oldfile >> /dev/null
postfix is not running.
                                                        fi
</pre>
                                                }
: <code>pkg lock -y postfix</code>
                                        done;
 
                                fi
: <code>service mailman stop</code>
                        }
: <code>service mailman status</code>
                done;
<pre>
        fi
mailman is not running.
};
</pre>
done;
: <code>pkg lock -y mailman</code>
 
: <code>cd /usr/ports/mail/postfix</code>
: <code>ALLOW_UNSUPPORTED_SYSTEM=YES make build</code>
: <code>pkg unlock -y postfix</code>
: <code>ALLOW_UNSUPPORTED_SYSTEM=YES make deinstall</code>
: <code>ALLOW_UNSUPPORTED_SYSTEM=YES make install clean</code>
: <code>pkg lock -y postfix</code>
 
: <code>cd /usr/ports/mail/mailman</code>
: <code>ALLOW_UNSUPPORTED_SYSTEM=YES make build</code>
: <code>pkg unlock -y mailman</code>
: <code>ALLOW_UNSUPPORTED_SYSTEM=YES make deinstall</code>
: <code>ALLOW_UNSUPPORTED_SYSTEM=YES make install clean</code>
: <code>pkg lock -y mailman</code>
 
: <code>service mailman start</code>
<pre>
Fixing mailman permissions:
Warning: Private archive directory is other-executable (o+x).
        This could allow other users on your system to read private archives.
        If you're on a shared multiuser system, you should consult the
        installation manual on how to fix this.
No problems found
Starting mailman.
</pre>
: <code>service postfix start</code>
<pre>
postfix: Postfix is running with backwards-compatible default settings
postfix: See http://www.postfix.org/COMPATIBILITY_README.html for details
postfix: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
postfix/postfix-script: starting the Postfix mail system
</pre>
 
: <code>pkg info -ak | grep yes</code>
<pre>
mailman-2.1.26_4              yes
postfix-3.3.1,1                yes
</pre>
|
|}
 
== Umzug ==
 
==== Einzug von [[Server/SRS14/2018]] ====
 
; Aktualisierung von ZFS:
 
: <code>zfs upgrade</code>
<pre>
This system is currently running ZFS filesystem version 5.
 
The following filesystems are out of date, and can be upgraded.  After being
upgraded, these filesystems (and any 'zfs send' streams generated from
subsequent snapshots) will no longer be accessible by older software versions.
 
 
VER  FILESYSTEM
---  ------------
4  znyx/migration/srs14
</pre>
 
: <code>zfs upgrade znyx/migration/srs14</code>
<pre>
1 filesystems upgraded
</pre>
</pre>
: <code>zfs upgrade</code>
<pre>
This system is currently running ZFS filesystem version 5.
All filesystems are formatted with the current version.
</pre>
== Probleme ==
==== 403 bei den Archiven von öffentlichen Mail-Verteilern ====
Alle Inhalte von Mailman über den Webserver unter ''/pipermail/'', also insbesondere was auch einfach öffentlich archivierte Inhalte sind (zum Beispiel
http://lists.stura.htw-dresden.de/pipermail/stg.htw-dresden.de/) konnten wegen [[wikipedia:de:HTTP-Statuscode#4xx – Client-Fehler|Fehler ''403'']] nicht einfach öffentlich ausgeliefert werden. Praktisch handelt es sich um alle Inhalte im Ordner <code>/usr/local/mailman/archives/public/</code> (Links).
Der Webserver, der als Account ''www'' läuft, braucht Berechtigungen (und gehört (pauschal) zu ''[[wikipedia:de:Unix-Dateirechte#Benutzerklassen|others]]'').
<code>chmod o=rx /usr/local/mailman/archives/private</code>
: (Irgendwie erscheint das "falsch", aber …) Das hat früher wohl auch schon [https://www.freebsddiary.org/mailman.php dan.langille.org] so gemacht. :-D
=== DNSBL ===
[[wikipedia:de:DNS-based Blackhole List]]
* http://dnsbllookup.com/
** http://dnsbllookup.com/?ip=141.56.51.14
** http://dnsbllookup.com/?ip=141.56.51.2
* http://multirbl.valli.org/dnsbl-lookup/
** http://multirbl.valli.org/dnsbl-lookup/141.56.51.14.html
** http://multirbl.valli.org/dnsbl-lookup/srs14.stura.htw-dresden.de.html
** http://multirbl.valli.org/dnsbl-lookup/mail.stura.htw-dresden.de.html
** http://multirbl.valli.org/dnsbl-lookup/141.56.51.2.html
** http://multirbl.valli.org/dnsbl-lookup/srs2.stura.htw-dresden.de.html

Bitte beachte, dass alle Beiträge zu Wiki StuRa HTW Dresden von anderen Mitwirkenden bearbeitet, geändert oder gelöscht werden können. Reiche hier keine Texte ein, falls du nicht willst, dass diese ohne Einschränkung geändert werden können.

Du bestätigst hiermit auch, dass du diese Texte selbst geschrieben hast oder diese von einer gemeinfreien Quelle kopiert hast (weitere Einzelheiten unter StuRa HTW Dresden:Urheberrechte). ÜBERTRAGE OHNE GENEHMIGUNG KEINE URHEBERRECHTLICH GESCHÜTZTEN INHALTE!

Bitte beantworte die folgende Frage, um diese Seite speichern zu können (weitere Informationen):

Abbrechen Bearbeitungshilfe (wird in einem neuen Fenster geöffnet)