PostfixAdmin (Ubuntu 18.04): Unterschied zwischen den Versionen
| (5 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 33: | Zeile 33: | ||
In dem entpackten Verzeichnis befindet sich auch eine Datei [[Medium:InstallPostfixAdmin32.txt|Install.txt]], wo die grundlegenden Schritte beschrieben werden. | In dem entpackten Verzeichnis befindet sich auch eine Datei [[Medium:InstallPostfixAdmin32.txt|Install.txt]], wo die grundlegenden Schritte beschrieben werden. | ||
Update 07.09.2023: [https://github.com/postfixadmin/postfixadmin https://github.com/postfixadmin/postfixadmin] | |||
=== MySQL === | === MySQL === | ||
| Zeile 55: | Zeile 57: | ||
<pre> | <pre> | ||
Alias /postfixadmin "/var/www/ | Alias /postfixadmin "/var/www/postfixadmin/public/" | ||
<Directory "/var/www/ | <Directory "/var/www/postfixadmin/public"> | ||
Require ip 10.0.0.0/24 | |||
Options +FollowSymLinks | Options +FollowSymLinks | ||
AllowOverride All | AllowOverride All | ||
| Zeile 64: | Zeile 68: | ||
</IfModule> | </IfModule> | ||
SetEnv HOME /var/www/ | SetEnv HOME /var/www/postfixadmin/public | ||
SetEnv HTTP_HOME /var/www/ | SetEnv HTTP_HOME /var/www/postfixadmin/public | ||
</Directory> | </Directory> | ||
</pre> | </pre> | ||
| Zeile 80: | Zeile 84: | ||
Konfigurationsdatei anlegen (überschreibt die Standardwerte in ''config.inc.php''): | Konfigurationsdatei anlegen (überschreibt die Standardwerte in ''config.inc.php''): | ||
<pre> | <pre> | ||
cd /var/www/ | cd /var/www/postfixadmin/ | ||
sudo -u www-data vi config.local.php | sudo -u www-data vi config.local.php | ||
</pre> | </pre> | ||
| Zeile 138: | Zeile 142: | ||
// b) only a localpart ('postmaster' => 'admin') - the alias target will point to the same domain | // b) only a localpart ('postmaster' => 'admin') - the alias target will point to the same domain | ||
$CONF['default_aliases'] = array ( | $CONF['default_aliases'] = array ( | ||
'abuse' => ' | 'abuse' => 'admin', | ||
'hostmaster' => ' | 'hostmaster' => 'admin', | ||
'postmaster' => ' | 'postmaster' => 'admin', | ||
'webmaster' => ' | 'webmaster' => 'admin' | ||
); | ); | ||
| Zeile 179: | Zeile 183: | ||
// b) only a localpart ('postmaster' => 'admin') - the alias target will point to the same domain | // b) only a localpart ('postmaster' => 'admin') - the alias target will point to the same domain | ||
$CONF['default_aliases'] = array ( | $CONF['default_aliases'] = array ( | ||
'abuse' => ' | 'abuse' => 'admin', | ||
'hostmaster' => ' | 'hostmaster' => 'admin', | ||
'postmaster' => ' | 'postmaster' => 'admin', | ||
'webmaster' => ' | 'webmaster' => 'admin' | ||
); | ); | ||
</pre> | </pre> | ||
Aktuelle Version vom 7. September 2023, 08:05 Uhr
Voraussetzungen
LAMP-Server, dazu siehe auch: Apache, MariaDB
Installation
PHP
sudo apt-get install php-imap sudo service apache2 restart
tar-Verzeichnis
Aktuelle Version unter https://sourceforge.net/projects/postfixadmin/files/postfixadmin herunterladen.
wget https://sourceforge.net/projects/postfixadmin/files/postfixadmin/postfixadmin-3.2/postfixadmin-3.2.tar.gz tar -xzf postfixadmin-3.2.tar.gz sudo mv postfixadmin-3.2 /var/www/postfixadmin_3_2/ sudo chown -R www-data:www-data /var/www/postfixadmin_3_2/
sudo -u www-data mkdir /var/www/postfixadmin_3_2/templates_c
cd /var/www sudo ln -s postfixadmin_3_2 postfixadmin
In dem entpackten Verzeichnis befindet sich auch eine Datei Install.txt, wo die grundlegenden Schritte beschrieben werden.
Update 07.09.2023: https://github.com/postfixadmin/postfixadmin
MySQL
mysql -u root -p mysql> create database if not exists postfix; mysql> create user 'postfix'@'%' identified by '<password>'; mysql> grant all privileges on postfix.* to 'postfix'@'%'; mysql> flush privileges; mysql> quit;
Konfiguration
Apache2
cd /etc/apache2/conf-available/ sudo vi /etc/apache2/conf-available/postfixadmin.conf
Alias /postfixadmin "/var/www/postfixadmin/public/"
<Directory "/var/www/postfixadmin/public">
Require ip 10.0.0.0/24
Options +FollowSymLinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/postfixadmin/public
SetEnv HTTP_HOME /var/www/postfixadmin/public
</Directory>
sudo a2enconf postfixadmin sudo service apache2 reload
PostfixAdmin
Grundkonfiguration
Konfigurationsdatei anlegen (überschreibt die Standardwerte in config.inc.php):
cd /var/www/postfixadmin/ sudo -u www-data vi config.local.php
Datei sollte in der Grundkonfiguration etwa so aussehen:
<?php $CONF['configured'] = true; $CONF['database_type'] = 'mysqli'; $CONF['database_user'] = 'postfix'; $CONF['database_password'] = '<password>'; $CONF['database_name'] = 'postfix'; ?>
Nach Abschluss aller Konfigurationen sollte die Datei dann so aussehen:
<?php
$CONF['configured'] = true;
$CONF['setup_password'] = '<setup password>';
$CONF['default_language'] = 'de';
$CONF['database_type'] = 'mysql';
$CONF['database_user'] = 'postfix';
$CONF['database_password'] = '<database password>';
$CONF['database_name'] = 'postfix';
$CONF['admin_email'] = '<mail address>';
$CONF['encrypt'] = 'dovecot:SHA512-CRYPT';
$CONF['dovecotpw'] = "/usr/bin/doveadm pw";
$CONF['transport'] = 'YES';
$CONF['password_validation'] = array(
# '/regular expression/' => '$PALANG key (optional: + parameter)',
'/.{5}/' => 'password_too_short 5', # minimum length 5 characters
'/([a-zA-Z].*){3}/' => 'password_no_characters 3', # must contain at least 3 characters
'/([0-9].*){1}/' => 'password_no_digits 1', # must contain at least 1 digit(s)
);
$CONF['aliases'] = '100';
$CONF['mailboxes'] = '100';
$CONF['maxquota'] = '100';
$CONF['domain_quota_default'] = '2048';
$CONF['footer_text'] = 'Return to mail1.<domain>';
$CONF['footer_link'] = 'https://mail1.<domain>';
$CONF['mailbox_postcreation_script'] = 'sudo -u vmail /usr/local/bin/postfixadmin-mailbox-postcreation.sh';
$CONF['mailbox_postdeletion_script'] = 'sudo -u vmail /usr/local/bin/postfixadmin-mailbox-postdeletion.sh';
$CONF['domain_postdeletion_script'] = 'sudo -u vmail /usr/local/bin/postfixadmin-domain-postdeletion.sh';
// Default Aliases
// The default aliases that need to be created for all domains.
// You can specify the target address in two ways:
// a) a full mail address
// b) only a localpart ('postmaster' => 'admin') - the alias target will point to the same domain
$CONF['default_aliases'] = array (
'abuse' => 'admin',
'hostmaster' => 'admin',
'postmaster' => 'admin',
'webmaster' => 'admin'
);
// If you want to use virtual vacation for you mailbox users set this to 'YES'.
// NOTE: Make sure that you install the vacation module. (See VIRTUAL-VACATION/)
$CONF['vacation'] = 'YES';
// This is the autoreply domain that you will need to set in your Postfix
// transport maps to handle virtual vacations. It does not need to be a
// real domain (i.e. you don't need to setup DNS for it).
// This domain must exclusively be used for vacation. Do NOT use it for "normal" mail addresses.
$CONF['vacation_domain'] = 'autoreply.<domain>';
?>
Setup aufrufen
Wenn die Grundkonfiguration abgeschlossen ist, wird das Setup-Script aufgerufen:
http://10.0.0.156/postfixadmin/setup.php
Default Aliases
Die Datei config.local.php editieren
sudo vi /var/www/postfixadmin/config.local.php
und am Ende folgende Zeilen hinzufügen:
// Default Aliases
// The default aliases that need to be created for all domains.
// You can specify the target address in two ways:
// a) a full mail address
// b) only a localpart ('postmaster' => 'admin') - the alias target will point to the same domain
$CONF['default_aliases'] = array (
'abuse' => 'admin',
'hostmaster' => 'admin',
'postmaster' => 'admin',
'webmaster' => 'admin'
);
Verzeichnisse automatisch erstellen bzw. löschen
Siehe dazu PostfixAdmin Verzeichnisverwaltung
Automatische Urlaub Antwortmails
Siehe dazu PostfixAdmin Autoresponder
Fetchmail
Siehe dazu PostfixAdmin Fetchmail
Probleme
the templates_c directory doesn’t exist or isn’t writeable for the webserver
Einfach ein leeres Verzeichnis template_c unter /var/www/postfixadmin/ anlegen.
Links
http://blog.cboltz.de/uploads/postfixadmin-30-english.pdf
Zurück zu Dovecot
Zurück zu Mailserver einrichten