.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Mail::MtPolicyd::Cookbook::Installation 3pm" .TH Mail::MtPolicyd::Cookbook::Installation 3pm "2017-01-13" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Mail::MtPolicyd::Cookbook::Installation \- How to install mtpolicyd .SH "VERSION" .IX Header "VERSION" version 2.02 .SH "GET STARTED WITH BASIC MTPOLICYD INSTALLATION" .IX Header "GET STARTED WITH BASIC MTPOLICYD INSTALLATION" .SS "\s-1INSTALL MEMCACHED\s0" .IX Subsection "INSTALL MEMCACHED" memcached is required for mtpolicyd. A package of memcached should come with your os distribution. On Debian based distributions it can be installed by: .PP .Vb 1 \& apt\-get install memcached .Ve .PP Check /etc/default/memcached if the service is enabled: .PP .Vb 1 \& ENABLE_MEMCACHED=yes .Ve .PP Start the memcached service .PP .Vb 1 \& /etc/init.d/memcached start .Ve .SS "\s-1INSTALL MTPOLICYD\s0" .IX Subsection "INSTALL MTPOLICYD" \fI\s-1FROM PACKAGE \s0(\s-1RECOMMENDED\s0)\fR .IX Subsection "FROM PACKAGE (RECOMMENDED)" .PP There are prebuild packages of mtpolicyd available for several linux distributions. The easiest way is to install mtpolicyd by installing the package build for your distribution. .PP You can download the packages at: http://www.mtpolicyd.org/download.html .PP Installing the package will create a system user/group mtpolicyd on your system, an init script and a default configuration. .PP After installing the package you should be able to start mtpolicyd by just executing the startup script: .PP .Vb 1 \& /etc/init.d/mtpolicyd start .Ve .PP \fI\s-1FROM SOURCE/CPAN\s0\fR .IX Subsection "FROM SOURCE/CPAN" .PP Since mtpolicyd source is shipped as a perl/CPAN package it could be installed from \s-1CPAN.\s0 To install the Mail::Mtpolicyd package with all dependencies required make sure you have installed cpanminus: .PP .Vb 1 \& apt\-get install cpanminus .Ve .PP Then install the Mail::Mtpolicyd distribution with: .PP .Vb 1 \& cpanm Mail::MtPolicyd .Ve .PP It is recommended to create an system user and group for the daemon. .PP You can get a default configuration file etc/mtpolicyd.conf from the tarball. .PP The init scripts for the debian packages are located at debian/mtpolicyd.init and for redhat systems at rpm/mtpolicyd.init within the tarball. .SS "\s-1TEST MTPOLICYD\s0" .IX Subsection "TEST MTPOLICYD" Now the daemon should be up: .PP .Vb 7 \& $ ps \-u mtpolicyd f \& PID TTY STAT TIME COMMAND \& 2566 ? Ss 0:12 /usr/bin/mtpolicyd (master) \& 2731 ? S 0:28 \e_ /usr/bin/mtpolicyd (idle) \& 19464 ? S 0:26 \e_ /usr/bin/mtpolicyd (idle) \& 28858 ? S 0:26 \e_ /usr/bin/mtpolicyd (idle) \& 32372 ? S 0:24 \e_ /usr/bin/mtpolicyd (idle) .Ve .PP And it should be listening on localhost:12345: .PP .Vb 2 \& $ netstat \-aenpt | grep :12345 \& tcp 0 0 127.0.0.1:12345 0.0.0.0:* LISTEN 0 17333578 \- .Ve .PP Now test it with a simple query: .PP .Vb 1 \& $ policyd\-client \-h localhost:12345 .Ve .PP Paste the following request to the command: .PP .Vb 5 \& reverse_client_name=smtp.google.com \& sender=bob@gmail.com \& client_address=192.168.1.1 \& recipient=ich@markusbenning.de \& helo_name=smtp.google.com .Ve .PP Terminate the request by a blank line. Just press enter. .PP The mtpolicyd should respond with a action like: .PP .Vb 1 \& PREPEND X\-MtScore: NO score .Ve .SS "\s-1ADD A MTPOLICYD QUERY TO YOUR POSTFIX SMTPD\s0" .IX Subsection "ADD A MTPOLICYD QUERY TO YOUR POSTFIX SMTPD" Open you postfix main.cf configuration file in a text editor. It should be located below /etc/postfix. .PP Add a 'check_policyd_service inet:127.0.0.1:12345' check to your smtpd_recipient_restrictions. It should look like this one: .PP .Vb 1 \& smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service inet:127.0.0.1:12345 .Ve .PP Now restart postfix. Now follow your maillog as new mails arrive. There should be a mtpolicyd line for every query. .SS "\s-1CONGRATULATIONS\s0" .IX Subsection "CONGRATULATIONS" Your mtpolicyd is now configured and running with the default configuration. .PP You may now want to continue with reading Mail::MtPolicyd::Cookbook::DefaultConfig which explains what the default configuration does. .SH "AUTHOR" .IX Header "AUTHOR" Markus Benning .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2014 by Markus Benning . .PP This is free software, licensed under: .PP .Vb 1 \& The GNU General Public License, Version 2, June 1991 .Ve