0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

better markup

This commit is contained in:
David Goodwin 2017-08-14 21:41:25 +01:00
parent 76f0387313
commit ba8a4ab659

View File

@ -20,6 +20,7 @@ There are a bunch of Perl modules which need installing, depending on your
distribution these may be available through your package management tool, or distribution these may be available through your package management tool, or
will need installing through CPAN. will need installing through CPAN.
```
Email::Valid Email::Valid
Email::Sender Email::Sender
Email::Simple Email::Simple
@ -30,6 +31,7 @@ MIME::EncWords
Log::Log4perl Log::Log4perl
Log::Dispatch Log::Dispatch
GetOpt::Std GetOpt::Std
```
You may install these via CPAN, or through your package tool. You may install these via CPAN, or through your package tool.
@ -39,9 +41,13 @@ CPAN: 'perl -MCPAN -e shell', then 'install Module::Whatever'
## Debian Systems ## Debian Systems
```bash
apt-get install libemail-sender-perl libemail-simple-perl libemail-valid-perl libtry-tiny-perl libdbd-pg-perl libmime-perl liblog-log4perl-perl liblog-dispatch-perl libgetopt-argvfile-perl libmime-charset-perl libmime-encwords-perl libmime-encwords-perl apt-get install libemail-sender-perl libemail-simple-perl libemail-valid-perl libtry-tiny-perl libdbd-pg-perl libmime-perl liblog-log4perl-perl liblog-dispatch-perl libgetopt-argvfile-perl libmime-charset-perl libmime-encwords-perl libmime-encwords-perl
```
and one of : libdbd-pg-perl or libdbd-mysql-perl and one of :
```bash
libdbd-pg-perl or libdbd-mysql-perl ```
# Installing Virtual Vacation # Installing Virtual Vacation
@ -60,16 +66,19 @@ Also create a separate "vacation" group.
This should look like this: This should look like this:
```raw
#/etc/passwd #/etc/passwd
vacation:*:65501:65501:Virtual Vacation:/nonexistent:/sbin/nologin vacation:*:65501:65501:Virtual Vacation:/nonexistent:/sbin/nologin
```
```raw
#/etc/group #/etc/group
vacation:*:65501: vacation:*:65501:
```
## 2. Create a log directory or log file ## 2. Create a log directory or log file
If you want to log to a file ($log_to_file), create a log directory or an If you want to log to a file ($log\_to\_file), create a log directory or an
empty log file. empty log file.
This file or directory needs to be writeable for the "vacation" user. This file or directory needs to be writeable for the "vacation" user.
@ -81,46 +90,61 @@ Note: If you are logging to syslog, you can skip this step.
Create a directory /usr/lib/postfixadmin/ and copy the vacation.pl file to it: Create a directory /usr/lib/postfixadmin/ and copy the vacation.pl file to it:
$ mkdir /usr/lib/postfixadmin ```bash
$ cp vacation.pl /usr/lib/postfixadmin/vacation.pl mkdir /usr/lib/postfixadmin
$ chown -R root:vacation /usr/lib/postfixadmin cp vacation.pl /usr/lib/postfixadmin/vacation.pl
$ chmod 750 /usr/lib/postfixadmin/ /usr/lib/postfixadmin/vacation.pl chown -R root:vacation /usr/lib/postfixadmin
chmod 750 /usr/lib/postfixadmin/ /usr/lib/postfixadmin/vacation.pl
```
Which will then look something like: Which will then look something like:
```raw
-rwxr-x--- 1 root vacation 3356 Dec 21 00:00 vacation.pl* -rwxr-x--- 1 root vacation 3356 Dec 21 00:00 vacation.pl*
```
## 4. Setup the transport type ## 4. Setup the transport type
Define the transport type in the Postfix master file: Define the transport type in the Postfix master file:
```raw
#/etc/postfix/master.cf: #/etc/postfix/master.cf:
vacation unix - n n - - pipe vacation unix - n n - - pipe
flags=Rq user=vacation argv=/usr/lib/postfixadmin/vacation.pl -f ${sender} -- ${recipient} flags=Rq user=vacation argv=/usr/lib/postfixadmin/vacation.pl -f ${sender} -- ${recipient}
```
## 5. Setup the transport maps file ## 5. Setup the transport maps file
Tell Postfix to use a transport maps file, so add the following to your Tell Postfix to use a transport maps file, so add the following to your
Postfix main.cf: Postfix main.cf:
```raw
#/etc/postfix/main.cf: #/etc/postfix/main.cf:
transport_maps = hash:/etc/postfix/transport transport_maps = hash:/etc/postfix/transport
```
Then add the transport definition to the newly created transport file. Then add the transport definition to the newly created transport file.
Obviously, change yourdomain.com to your own domain. This can be any Obviously, change yourdomain.com to your own domain. This can be any
arbitrary domain, and it is easiest if you just choose one that will be used arbitrary domain, and it is easiest if you just choose one that will be used
for all your domains. for all your domains.
```raw
#/etc/postfix/transport #/etc/postfix/transport
autoreply.yourdomain.com vacation: autoreply.yourdomain.com vacation:
```
(You may need to create an entry in /etc/hosts for your non-existant domain) (You may need to create an entry in /etc/hosts for your non-existant domain)
Execute "postmap /etc/postfix/transport" to build the hashed database. Execute ```bash
postmap /etc/postfix/transport
```
Execute "postfix reload" to complete the change. Execute ```
postfix reload
```
to complete the change.
## 6. Configure vacation.pl ## 6. Configure vacation.pl
@ -130,9 +154,9 @@ how to connect to the database.
Namely : Namely :
Change any variables starting with '$db_' and '$db_type' to either 'mysql' or 'pgsql'. Change any variables starting with '$db\_' and '$db\_type' to either 'mysql' or 'pgsql'.
Change the $vacation_domain variable to match what you entered in your /etc/postfix/transport Change the $vacation\_domain variable to match what you entered in your /etc/postfix/transport
file. file.
You can do this in two ways: You can do this in two ways:
@ -143,13 +167,17 @@ b) create /etc/postfixadmin/vacation.conf and enter your settings there
Just use perl syntax there to fill the config variables listed in vacation.pl Just use perl syntax there to fill the config variables listed in vacation.pl
(without the "our" keyword). Example: (without the "our" keyword). Example:
$db_username = 'mail'; ```perl
$db_username = 'mail';
```
To make sure nobody except vacation.pl can read your vacation.conf (including the To make sure nobody except vacation.pl can read your vacation.conf (including the
database password), run database password), run
$ chown root:vacation /etc/postfixadmin/vacation.conf ```bash
$ chmod 640 /etc/postfixadmin/vacation.conf chown root:vacation /etc/postfixadmin/vacation.conf
chmod 640 /etc/postfixadmin/vacation.conf
```
## 7. Check the alias expansion ## 7. Check the alias expansion
@ -161,10 +189,14 @@ another content filtering system when mail is re-injected into Postfix using the
If you are, it's likely that alias expansion may happen more than once, in which case you If you are, it's likely that alias expansion may happen more than once, in which case you
may see vacation-style responses duplicated. To suppress this behaviour, you need to add: may see vacation-style responses duplicated. To suppress this behaviour, you need to add:
```raw
-o receive_override_options=no_address_mappings -o receive_override_options=no_address_mappings
```
For example : For example :
```raw
smtp inet n - - - 12 smtpd smtp inet n - - - 12 smtpd
-o content_filter=amavis:[127.0.0.50]:10024 -o content_filter=amavis:[127.0.0.50]:10024
-o receive_override_options=no_address_mappings -o receive_override_options=no_address_mappings
@ -178,6 +210,8 @@ smtp inet n - - - 12 smtpd
-o mynetworks=127.0.0.0/8 -o mynetworks=127.0.0.0/8
-o receive_override_options=no_header_body_checks -o receive_override_options=no_header_body_checks
```
^^^ Alias expansion occurs here, so we don't want it to happen again for the ^^^ Alias expansion occurs here, so we don't want it to happen again for the
first smtpd daemon (above). If you have per-user settings in amavis, first smtpd daemon (above). If you have per-user settings in amavis,
you might want to have no_address_mappings in the smtpd on port 10025 you might want to have no_address_mappings in the smtpd on port 10025