The document provides instructions for configuring Postfix to integrate with Active Directory for user authentication. It includes configuring Postfix configuration files and LDAP settings to query user information from Active Directory for mail delivery, alias lookups, and more. Commands are provided to install required packages, configure ClamAV for antivirus scanning, and set up virtual users on the mail server using directories mounted from an iSCSI LUN.
Using Mikko Koppanen's PHP ZMQ extension we will look at how you can easily distribute work to background processes, provide flexible service brokering for your next service oriented architecture, and manage caches efficiently and easily with just PHP and the ZeroMQ libraries. Whether the problem is asynchronous communication, message distribution, process management or just about anything, ZeroMQ can help you build an architecture that is more resilient, more scalable and more flexible, without introducing unnecessary overhead or requiring a heavyweight queue manager node.
Conférence données à l'Open World Forum, 05 octobre 2013.
Comment créer une base de données noSQL par paires clés-valeurs en moins d'une heure, en se basant sur le bibliothèques Nanomsg et LightningDB.
This document discusses various tools for handling files, images, and asynchronous tasks in Symfony applications. It introduces the Gaufrette filesystem abstraction layer, VichUploaderBundle for file uploads, LiipImagineBundle for image processing, Enqueue for asynchronous message queues, and Symfony Messenger component. It provides code examples for integrating these tools and addressing common issues like file storage, processing, and background tasks.
This document provides an overview of 0MQ (also known as ZeroMQ), a messaging library that enables various messaging patterns like request/reply, publish/subscribe, and queueing. It includes code examples in multiple languages like Erlang, Python, and PHP demonstrating how to implement common 0MQ patterns. Links are also provided for additional 0MQ resources.
This document provides an overview of 0MQ and examples of how to use it with PHP. It introduces 0MQ patterns like request/response, pub/sub, queue, and pipeline. Code snippets in PHP demonstrate implementing these patterns using 0MQ sockets. Additional resources for learning more about 0MQ and using it with PHP are provided at the end.
GUN Make is a tool used to automate the building of executables from source code. It determines which files need to be recompiled based on timestamps and builds the necessary targets. Rules define dependencies and commands to transform files. Variables, macros, conditionals, and functions allow for complex logic and reuse in the makefile. Includes allow splitting makefiles into modular pieces.
Using Mikko Koppanen's PHP ZMQ extension we will look at how you can easily distribute work to background processes, provide flexible service brokering for your next service oriented architecture, and manage caches efficiently and easily with just PHP and the ZeroMQ libraries. Whether the problem is asynchronous communication, message distribution, process management or just about anything, ZeroMQ can help you build an architecture that is more resilient, more scalable and more flexible, without introducing unnecessary overhead or requiring a heavyweight queue manager node.
Conférence données à l'Open World Forum, 05 octobre 2013.
Comment créer une base de données noSQL par paires clés-valeurs en moins d'une heure, en se basant sur le bibliothèques Nanomsg et LightningDB.
This document discusses various tools for handling files, images, and asynchronous tasks in Symfony applications. It introduces the Gaufrette filesystem abstraction layer, VichUploaderBundle for file uploads, LiipImagineBundle for image processing, Enqueue for asynchronous message queues, and Symfony Messenger component. It provides code examples for integrating these tools and addressing common issues like file storage, processing, and background tasks.
This document provides an overview of 0MQ (also known as ZeroMQ), a messaging library that enables various messaging patterns like request/reply, publish/subscribe, and queueing. It includes code examples in multiple languages like Erlang, Python, and PHP demonstrating how to implement common 0MQ patterns. Links are also provided for additional 0MQ resources.
This document provides an overview of 0MQ and examples of how to use it with PHP. It introduces 0MQ patterns like request/response, pub/sub, queue, and pipeline. Code snippets in PHP demonstrate implementing these patterns using 0MQ sockets. Additional resources for learning more about 0MQ and using it with PHP are provided at the end.
GUN Make is a tool used to automate the building of executables from source code. It determines which files need to be recompiled based on timestamps and builds the necessary targets. Rules define dependencies and commands to transform files. Variables, macros, conditionals, and functions allow for complex logic and reuse in the makefile. Includes allow splitting makefiles into modular pieces.
This document provides information about using the PHP command line interface (CLI) SAPI. It discusses when to use the CLI SAPI, such as for cron jobs, batch tasks, daemons, and process control. It also provides examples of using the PHP binary to execute scripts from the command line, pass arguments, read from STDIN, and use options like -a for interactive mode, -r to run PHP code directly, and -i to get PHP configuration information.
Introduction to CloudForecast / YAPC::Asia 2010 TokyoMasahiro Nagano
The document introduces CloudForecast, an open source tool for monitoring server resources and metrics. It provides instructions for installing dependencies, configuring CloudForecast, and running the fetcher, updater and radar components to collect and visualize server performance data. Tips are also included for debugging and optimizing the number of worker processes used by CloudForecast.
This Bash script provides a POP3 email client called pop3ck that allows users to connect to a POP3 server, view message summaries and headers, and read or delete messages. It handles configuration, connection, and interaction with the POP3 protocol. The script defines numerous functions to handle tasks like getting user input, displaying messages and prompts, and managing the connection and message data structures.
Redis & ZeroMQ: How to scale your applicationrjsmelo
Presented at #PHPLX 11 July 2013
When you need to do some heavy processing how do you scale you application?
You can use Redis and ZeroMQ to leverage the heavy work for you!
With this presentation we will know more about this two technologies and how they can be used to help solve problems with the performance and scalability of your application.
ZeroMQ Is The Answer: PHP Tek 11 VersionIan Barber
This document provides an overview of ZeroMQ (0MQ), an asynchronous messaging library. It discusses 0MQ concepts like request/response, publish/subscribe, and pipelines. It includes code examples in PHP and Python demonstrating how to implement these patterns using 0MQ sockets and messaging. Additional sections cover 0MQ transport types, installation, and integrating 0MQ with other systems like Mongrel2.
The document discusses using Perl libraries to interact with cloud computing platforms like Amazon EC2 and Rackspace to launch and manage virtual servers and instances. It provides code examples for creating instances on EC2 and Rackspace using the Net::Amazon::EC2 and Net::RackSpace::CloudServers libraries, checking for instances to become active, and connecting to instances securely via SSH.
The document discusses several technologies for building real-time web applications, including PSGI/Plack, AnyEvent, AnyMQ, AMQP, comet techniques, WebSockets, and Web::Hippie. Specifically, it covers:
- PSGI and Plack for building web applications and middleware in Perl.
- AnyEvent for asynchronous programming and handling connections.
- AnyMQ for message queueing with support for AMQP via plugins.
- Comet techniques like long-polling for server-push capabilities before WebSockets.
- The WebSocket protocol standard and APIs for bidirectional communication.
- Web::Hippie for building real-time web applications in Perl using WebSockets.
This document contains PHP code for a backdoor shell. It defines various configuration settings like directories, login credentials, command aliases, and other functionality. The code authenticates the user, handles requests, and provides a basic interface for accessing the system.
Fabien Potencier presented information about Symfony 2. He discussed that Symfony 2 is an evolution of Symfony 1 that aims to be more flexible and fast. Some key components of Symfony 2 include the dependency injection container, templating framework, and improved controller handling. The presentation highlighted the request handler as the backbone of Symfony 2's improved controller implementation. Events like application.request and application.response allow listeners to modify the request and response.
This document contains PHP code for a backdoor shell. It defines configuration variables like login credentials, directories, command aliases, and other settings. It also handles authentication, sets up sessions and cookies, and has code to update the backdoor. The goal is to provide a remote access shell that can execute commands, browse files, and perform other operations on the compromised server.
This document contains PHP code for a backdoor shell. It defines configuration variables and settings for features like authentication, file operations, command aliases, and updating. Functions are defined for buffer handling, sorting parameters, and copying directories. The code sets configurations, checks for updates, handles authentication, and prepares for requested actions.
Debugging: Rules And Tools - PHPTek 11 VersionIan Barber
The document provides rules and tools for debugging. It discusses understanding the system, making failures reproducible, quitting thinking and closely observing behaviors, dividing problems into smaller pieces, changing one thing at a time, and maintaining an audit trail of changes. Tools mentioned include Xdebug, Selenium, PHPUnit, strace, and source control systems. Logging, instrumentation, and testing techniques are also covered.
Teaching Your Machine To Find FraudstersIan Barber
The slides from my talk at PHP Tek 11.
When dealing with money online, fraud is an ongoing problem for both
consumers and sellers. Researchers have been developing statistical
and machine learning techniques to detect shady sellers on auction
sites, spot fraudulent payments on e-commerce systems and catch click
fraud on adverts. While there is no silver bullet, you will learn to
flag suspicious activity and help protect your site from scammers
using PHP and a little help from some other technologies.
The document describes a trash command that provides a recycle bin functionality for Linux similar to Windows. It works by moving deleted files to the $HOME/.trash directory instead of permanently removing them. Users can restore deleted files by running the rm -l command and specifying the file row number. The trash command also checks the trash directory size and automatically deletes the oldest files if the space limit is exceeded.
Workshop on command line tools - day 1Leandro Lima
Slides of the I Workshop on command-line tools with the collaboration of CAG (Center for Applied Genomics - Children's Hospital of Philadelphia) bioinformatics analysts.
1st day
The document discusses parsing JSON with a single regular expression in Perl. It describes using grammars, recursion, and code execution within the regex to build a data structure that is returned. Key features include using (?&NAME) to recurse on named patterns, (?{ CODE }) to execute code during matching, and $^R to build and return a data structure.
This document contains the configuration and settings for a PHP web shell. It defines variables for authentication, file types, commands, colors, and other options. It also contains code to check the request, merge parameters, and start the shell session.
This document discusses Symfony 2.0 and its new features.
[1] Symfony 2.0 will require PHP 5.3 and features a new lightweight request handling system. Key components like the event dispatcher and dependency injection container have been extracted into standalone packages.
[2] The request handler is responsible for dispatching events, loading controllers, and ensuring requests are converted to responses. It is very lightweight, being under 100 lines of code.
[3] Symfony 2.0 aims to be highly flexible and optimized for performance. Benchmark tests show the new request handling system can be up to 10 times faster than Symfony 1.x.
Thijs Feryn gave a presentation on the CLI (command line interface) SAPI for PHP. The CLI SAPI allows PHP scripts to be run from the command line/terminal instead of through a web server. Some key points of the CLI SAPI include reading arguments from $argv, reading input from STDIN, writing output to STDOUT, and having full control over script execution without timeouts. The CLI SAPI is useful for tasks like cronjobs, batch processing, and applications without a web frontend.
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
The document describes using Log::Minimal to log messages with timestamps, severity levels, and stack traces. Log::Minimal provides functions like debugf(), infof(), warnf() that log messages, and configuration options like AUTODUMP and PRINT to customize the output format. It can be used to log messages from multi-threaded or distributed applications.
This document provides an overview of using Perl web frameworks Catalyst and Mojolicious. It discusses MVC architecture and components like routers, controllers, models, and views. It also covers installing frameworks via CPAN, creating Catalyst applications, adding controllers, views using Template Toolkit, and models using DBIC. Authentication and authorization plugins for Catalyst are also mentioned.
This document provides information about using the PHP command line interface (CLI) SAPI. It discusses when to use the CLI SAPI, such as for cron jobs, batch tasks, daemons, and process control. It also provides examples of using the PHP binary to execute scripts from the command line, pass arguments, read from STDIN, and use options like -a for interactive mode, -r to run PHP code directly, and -i to get PHP configuration information.
Introduction to CloudForecast / YAPC::Asia 2010 TokyoMasahiro Nagano
The document introduces CloudForecast, an open source tool for monitoring server resources and metrics. It provides instructions for installing dependencies, configuring CloudForecast, and running the fetcher, updater and radar components to collect and visualize server performance data. Tips are also included for debugging and optimizing the number of worker processes used by CloudForecast.
This Bash script provides a POP3 email client called pop3ck that allows users to connect to a POP3 server, view message summaries and headers, and read or delete messages. It handles configuration, connection, and interaction with the POP3 protocol. The script defines numerous functions to handle tasks like getting user input, displaying messages and prompts, and managing the connection and message data structures.
Redis & ZeroMQ: How to scale your applicationrjsmelo
Presented at #PHPLX 11 July 2013
When you need to do some heavy processing how do you scale you application?
You can use Redis and ZeroMQ to leverage the heavy work for you!
With this presentation we will know more about this two technologies and how they can be used to help solve problems with the performance and scalability of your application.
ZeroMQ Is The Answer: PHP Tek 11 VersionIan Barber
This document provides an overview of ZeroMQ (0MQ), an asynchronous messaging library. It discusses 0MQ concepts like request/response, publish/subscribe, and pipelines. It includes code examples in PHP and Python demonstrating how to implement these patterns using 0MQ sockets and messaging. Additional sections cover 0MQ transport types, installation, and integrating 0MQ with other systems like Mongrel2.
The document discusses using Perl libraries to interact with cloud computing platforms like Amazon EC2 and Rackspace to launch and manage virtual servers and instances. It provides code examples for creating instances on EC2 and Rackspace using the Net::Amazon::EC2 and Net::RackSpace::CloudServers libraries, checking for instances to become active, and connecting to instances securely via SSH.
The document discusses several technologies for building real-time web applications, including PSGI/Plack, AnyEvent, AnyMQ, AMQP, comet techniques, WebSockets, and Web::Hippie. Specifically, it covers:
- PSGI and Plack for building web applications and middleware in Perl.
- AnyEvent for asynchronous programming and handling connections.
- AnyMQ for message queueing with support for AMQP via plugins.
- Comet techniques like long-polling for server-push capabilities before WebSockets.
- The WebSocket protocol standard and APIs for bidirectional communication.
- Web::Hippie for building real-time web applications in Perl using WebSockets.
This document contains PHP code for a backdoor shell. It defines various configuration settings like directories, login credentials, command aliases, and other functionality. The code authenticates the user, handles requests, and provides a basic interface for accessing the system.
Fabien Potencier presented information about Symfony 2. He discussed that Symfony 2 is an evolution of Symfony 1 that aims to be more flexible and fast. Some key components of Symfony 2 include the dependency injection container, templating framework, and improved controller handling. The presentation highlighted the request handler as the backbone of Symfony 2's improved controller implementation. Events like application.request and application.response allow listeners to modify the request and response.
This document contains PHP code for a backdoor shell. It defines configuration variables like login credentials, directories, command aliases, and other settings. It also handles authentication, sets up sessions and cookies, and has code to update the backdoor. The goal is to provide a remote access shell that can execute commands, browse files, and perform other operations on the compromised server.
This document contains PHP code for a backdoor shell. It defines configuration variables and settings for features like authentication, file operations, command aliases, and updating. Functions are defined for buffer handling, sorting parameters, and copying directories. The code sets configurations, checks for updates, handles authentication, and prepares for requested actions.
Debugging: Rules And Tools - PHPTek 11 VersionIan Barber
The document provides rules and tools for debugging. It discusses understanding the system, making failures reproducible, quitting thinking and closely observing behaviors, dividing problems into smaller pieces, changing one thing at a time, and maintaining an audit trail of changes. Tools mentioned include Xdebug, Selenium, PHPUnit, strace, and source control systems. Logging, instrumentation, and testing techniques are also covered.
Teaching Your Machine To Find FraudstersIan Barber
The slides from my talk at PHP Tek 11.
When dealing with money online, fraud is an ongoing problem for both
consumers and sellers. Researchers have been developing statistical
and machine learning techniques to detect shady sellers on auction
sites, spot fraudulent payments on e-commerce systems and catch click
fraud on adverts. While there is no silver bullet, you will learn to
flag suspicious activity and help protect your site from scammers
using PHP and a little help from some other technologies.
The document describes a trash command that provides a recycle bin functionality for Linux similar to Windows. It works by moving deleted files to the $HOME/.trash directory instead of permanently removing them. Users can restore deleted files by running the rm -l command and specifying the file row number. The trash command also checks the trash directory size and automatically deletes the oldest files if the space limit is exceeded.
Workshop on command line tools - day 1Leandro Lima
Slides of the I Workshop on command-line tools with the collaboration of CAG (Center for Applied Genomics - Children's Hospital of Philadelphia) bioinformatics analysts.
1st day
The document discusses parsing JSON with a single regular expression in Perl. It describes using grammars, recursion, and code execution within the regex to build a data structure that is returned. Key features include using (?&NAME) to recurse on named patterns, (?{ CODE }) to execute code during matching, and $^R to build and return a data structure.
This document contains the configuration and settings for a PHP web shell. It defines variables for authentication, file types, commands, colors, and other options. It also contains code to check the request, merge parameters, and start the shell session.
This document discusses Symfony 2.0 and its new features.
[1] Symfony 2.0 will require PHP 5.3 and features a new lightweight request handling system. Key components like the event dispatcher and dependency injection container have been extracted into standalone packages.
[2] The request handler is responsible for dispatching events, loading controllers, and ensuring requests are converted to responses. It is very lightweight, being under 100 lines of code.
[3] Symfony 2.0 aims to be highly flexible and optimized for performance. Benchmark tests show the new request handling system can be up to 10 times faster than Symfony 1.x.
Thijs Feryn gave a presentation on the CLI (command line interface) SAPI for PHP. The CLI SAPI allows PHP scripts to be run from the command line/terminal instead of through a web server. Some key points of the CLI SAPI include reading arguments from $argv, reading input from STDIN, writing output to STDOUT, and having full control over script execution without timeouts. The CLI SAPI is useful for tasks like cronjobs, batch processing, and applications without a web frontend.
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
The document describes using Log::Minimal to log messages with timestamps, severity levels, and stack traces. Log::Minimal provides functions like debugf(), infof(), warnf() that log messages, and configuration options like AUTODUMP and PRINT to customize the output format. It can be used to log messages from multi-threaded or distributed applications.
This document provides an overview of using Perl web frameworks Catalyst and Mojolicious. It discusses MVC architecture and components like routers, controllers, models, and views. It also covers installing frameworks via CPAN, creating Catalyst applications, adding controllers, views using Template Toolkit, and models using DBIC. Authentication and authorization plugins for Catalyst are also mentioned.
The document discusses Perl web frameworks Catalyst and Mojolicious. It provides an overview of key MVC concepts like routers, controllers, models and views. It then demonstrates how to install and create a basic Catalyst application with a root controller and default action. It also covers additional Catalyst controller features like actions, routes, context object and chained actions.
The document contains configuration commands and instructions for network services and security tools like Squid, Snort, iptables etc. It discusses configuring proxy, firewall and intrusion prevention rules to allow or block certain sites, file types and ports. It also contains commands to restart services like Squid, DNS, mail etc and check their status. System monitoring commands like ps, netstat are also included to check if processes are running.
The document discusses deploying a Rails application to Amazon EC2. It explains that the goals are to launch an EC2 instance, connect to it, set up the environment, deploy the application, and profit. It then outlines the plan to launch an instance, connect to it, install necessary packages like Ruby, Rails, and Nginx, configure Nginx and Unicorn, deploy the application using Capistrano, and start the Unicorn process.
This document contains a lecture on working with arrays, scripts, and SSH/SCP in UNIX systems. It discusses special variables used in scripts, how to define and manipulate arrays, examples of useful scripts for renaming files, backing up data, and extracting video files from DVDs, and how to use SSH to securely connect to remote systems and SCP to securely transfer files between systems. It also covers generating and using public/private key pairs for passwordless SSH login.
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
HA websites are where the rubber meets the road - at 200km/h. Traditional separation of dev and ops just doesn't cut it.
Everything is related to everything. Code relies on performant and resilient infrastructure, but highly performant infrastructure will only get a poorly written application so far. Worse still, root cause analysis in HA sites will more often than not identify problems that don't clearly belong to either devs or ops.
The two options are collaborate or die.
This talk will introduce 3 core principles for improving collaboration between operations and development teams: consistency, repeatability, and visibility. These principles will be investigated with real world case studies and associated technologies audience members can start using now. In particular, there will be a focus on:
- fast provisioning of test environments with configuration management
- reliable and repeatable automated deployments
- application and infrastructure visibility with statistics collection, logging, and visualisation
Vagrant file samples for various Hadoop distributionsAkshay Gore
This document contains Vagrant configuration files for setting up virtual machine clusters for the Cloudera, Hortonworks, and MapR Hadoop distributions. It defines scripts to install each distribution's packages and configure SSH keys and host files on the VMs. The Vagrantfiles configure multiple VMs with private networking and provisioning to install and set up the different Hadoop distributions.
Going from zero to Puppet by Pedro Pessoa, Operations Engineer at Server Density.
Abstract: Using out-of-the-box Puppet for non-sysadmin work - steps from going from no config management to managing 100 nodes and allowing non-sysadmin tasks to be performed.
Speaker Bio: Linux admin for 10+ years. Java/Python/C developer 12+ years. Ops engineer at http://www.serverdensity.com - a hosted server and website monitoring service. Currently processing 12TB+ per month into MongoDB running on dedicated and virtual instances.
www.serverdensity.com/puppetcamp/
The document discusses using Docker and Docker Compose to run Python and Django applications. It shows commands for pulling Docker images, running containers, linking databases, mounting volumes, building images, and using Docker Compose to define and run multi-container applications. Key aspects covered include using Dockerfiles to build images, linking containers, mounting host directories as volumes, setting environment variables, and running commands on container startup.
This document provides tips and examples for deploying applications using Capistrano and related tools. It demonstrates how to provision virtual machines with Vagrant, configure multi-machine deployments, use Git for faster deployments, set up RVM and Bundler integration, add exception tracking and logging, and schedule tasks with Whenever. It also discusses monitoring tools like New Relic RPM and best practices like log rotation, coming soon pages, and development database dumps.
The document discusses UBIC, a toolkit for writing daemons, init scripts, and services in Perl. It provides several key classes for common service tasks like starting, stopping, and getting the status of services. These classes standardize service management and make services more robust. UBIC sees wide use at Yandex across many packages, clusters, and hosts to manage services.
The document describes UBIC, a toolkit for writing daemons, init scripts, and services in Perl. It provides common classes that handle tasks like starting, stopping, and monitoring services that simplify writing init scripts. Services can be organized hierarchically and non-root users can run services. The toolkit also provides HTTP status endpoints and watchdog functionality to restart services that fail. UBIC sees widespread use at Yandex across many packages, clusters, and hosts.
This document summarizes an overview of the ELK stack presented at LinuxCon Europe 2016. It discusses the components of ELK including Beats, Logstash, Elasticsearch, and Kibana. It provides examples of using these components to collect, parse, store, search, and visualize log data. Specific topics covered include collecting log files using Filebeat and Logstash, parsing logs with Logstash filters, visualizing data in Kibana, programming Elasticsearch with REST APIs and client libraries, and alerting using the open source ESWatcher tool.
This document discusses using ngx_lua with UPYUN CDN. It provides examples of using Lua with Nginx for tasks like caching, health checking, and configuration as a service. Key points include using Lua for base64 encoding, Redis lookups, and upstream health checking. Lua provides a more flexible alternative to C modules for tasks like these by leveraging its embedding in Nginx via ngx_lua.
OSMC 2014: Monitoring VoIP Systems | Sebastian DammNETWAYS
While delivering VoIP solutions to customers for more than ten years, at sipgate we have gained experience in monitoring our VoIP setup. The talk will give an insight on how to monitor Asterisk, Kamailio, Yate and other vital parts of our setup through standard checks and own scripts. We will not only show how to monitor standard SIP, but also how to detect bottlenecks and misfunctions.
This document discusses how Sebastian Damm's company monitors their VoIP systems including Asterisk, Kamailio, Yate, and RTP proxies. They use Icinga for system monitoring with over 1,000 hosts and 5,000 services checked. Custom scripts monitor SIP connectivity and extract data from Asterisk via its manager interface and from Kamailio via XMLRPC. Monitoring checks various metrics like uptime, memory usage, call volume and answer seizure ratio (ASR).
Design Patterns avec PHP 5.3, Symfony et PimpleHugo Hamon
Cette conférence présente deux grands motifs de conception : l'observateur et l'injection de dépendance. Ce sujet allie à la fois théorie et pratique. Le composant autonome EventDispatcher de Symfony ainsi que le conteneur d'injection de dépendance Pimple sont mis à l'honneur avec des exemples pratiques d'usage. Ces cas pratiques combinent du code de l'ORM Propel ainsi que le composant autonome Zend\Search\Lucene du Zend Framework 2
This document contains PHP code for a backdoor shell. It defines configuration variables and settings for features like authentication, file operations, command aliases, and updating. Functions are defined for buffer handling, sorting parameters, and copying directories. The code sets constants, merges request data, checks for updates, and handles authentication before dispatching to different actions.
2. vim /etc/postfix/master.cf
smtp inet n - - - - smtpd -v -v -v -D
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
-o fallback_relay=
showq unix n - - - - showq
error unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
maildrop unix - n n - 20 pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -w 90 -d ${recipient}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
retry unix - - n - - error
proxywrite unix - - n - 1 proxymap
policy unix - n n - - spawn user=nobody argv=/usr/bin/perl /usr/lib/postfix/policyd-spf-perl
smtp inet n - n - - smtpd -o content_filter=clamav:clamav
clamav unix - n n - - pipe flags=Rq user=clamav argv=/usr/lib/postfix/clamav-filter.sh -f ${sender} -- ${recipient}
vim /etc/maildroprc
USER=`echo "$LOGNAME" | cut -d@ -f1`
MAILBOX="$HOME/$USER/"
MAILDIR="$HOME/$USER/Maildir/"
MESSAGE="/etc/courier/overquota"
DELIVERQUOTA="/usr/bin/deliverquota.courier"
ASSUNTO="CAIXA CHEIA!"
MAILER="MAILER-DAEMON@mailserver.solisc.org.br"
if ( /^From: *.*/ )
{
ADDR=getaddr($MATCH)
}
`test -d "$MAILDIR"`
if ($RETURNCODE != 0)
{
exception {
`mkdir -p "$MAILBOX"`
`maildirmake.courier "$MAILDIR"`
}
}
if (/^X-Spam-Status: Yes/)
{
`test -d "$MAILDIR/.Spam/"`
if ($RETURNCODE != 0)
{
`maildirmake.courier -f Spam "$MAILDIR"`
`echo "INBOX.Spam" >> $MAILDIR/courierimapsubscribed`
}
exception {
to "$MAILDIR/.Spam/"
}
}
`test -f "$MAILDIR/vacation.txt"`
if ($RETURNCODE==0)
{
`test -f "$MAILDIR/vacation_subject.txt"`
if ($RETURNCODE==0)
{
SUBJECT=`cat "$MAILDIR/vacation_subject.txt"`
cc "| mailbot -t "$MAILDIR/vacation.txt" -A 'From: $USER' -A 'Subject: $SUBJECT' /usr/sbin/sendmail -t $ADDR"
}
else
{
cc "| mailbot -t "$MAILDIR/vacation.txt" -A 'From: $USER' /usr/sbin/sendmail -t $ADDR"
}
`test -f "$MAILDIR/vacation_cc_addresses.txt"`
3. if ($RETURNCODE==0)
{
CCADDRESSES=`cat "$MAILDIR/vacation_cc_addresses.txt"`
`test -f "$MAILDIR/vacation_keep_messages.txt"`
if ($RETURNCODE==0)
{
cc "! -f "$ADDR" $CCADDRESSES"
}
else
{
to "! -f "$ADDR" $CCADDRESSES"
}
}
}
exception {
to "$MAILDIR/"
}
exception {
xfilter "$DELIVERQUOTA -w 90 $MAILDIR"
}
if ($RETURNCODE==75)
{
cc "| mailbot -t "$MESSAGE" -A 'From: $MAILER' /usr/sbin/sendmail -t $ADDR"
}
vim /usr/lib/postfix/clamav-filter.sh
#!/bin/sh
export PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games
INSPECT_DIR=/AV
SENDMAIL="/usr/bin/spamc -f -e /usr/sbin/sendmail -i"
MYHOSTNAME=`postconf -h myhostname`
REPORTHOST=`postconf -h myhostname`
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
EX_DENIED=77
nome_arquivo=`date +%Y%m%d%H%M%S`
nome_arquivo=in.$$.$nome_arquivo
AVCMD="/usr/bin/clamdscan --disable-summary --stdout "
NOTIFY_VIRUS=no
NOTIFY_POSTMASTER=yes
viruscan() {
VIRUS=`$AVCMD $nome_arquivo`
SAIDA=$?
VIRUS=`echo $VIRUS | cut -d" " -f2-`
if [ $SAIDA -eq 1 ]; then
postlog -t postfix/virus-filter message-id=$msgid status=virus from=<$from> to=<$rcpts> 2>/dev/null
if [ "$NOTIFY_VIRUS" = "yes" ]; then
echo "From: Virus Scanner <mailer-daemon@$MYHOSTNAME>
Subject: AVISO: Email rejeitado: VIRUS Detectado
To: $from
Seu email para ($rcpts) com assunto ($subj) foi rejeitado por conter virus.
Virus encontrados: $VIRUS
" | $SENDMAIL -f MAILER-DAEMON -- $from
fi
if [ "$NOTIFY_POSTMASTER" = "yes" ]; then
echo "From: Virus Scanner <mailer-daemon@$MYHOSTNAME>
Subject: Postmaster Copy: VIRUS Detectado
To: postmaster@solisc.org.br
Um email de $from para $rcpts com assunto ($subj) foi rejeitado por conter virus.
Virus encontrados: $VIRUS
" | $SENDMAIL -f MAILER-DAEMON – postmaster@solisc.org.br
fi
exit 0
fi
}
trap "rm -rf $nome_arquivo*" 0 1 2 3 15
cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
cat >$nome_arquivo || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }
from=$2
if [ "$from" != "--" ]; then
shift
else
$from=""
fi
shift ; shift
dominio=`echo $from | cut -d"@" -f2`
email=`echo $from | cut -d"@" -f1`
subj=`head -n 200 $nome_arquivo | grep -i "^Subject:" | cut -d":" -f2- | head -n 1`
msgid=`head -n 200 $nome_arquivo | grep -i "^message-id" | cut -d: -f 2- | sed 's/^ *//' | head -n 1`
saida="-f $from -- $@"
rcpts=$@
viruscan
$SENDMAIL $saida <$nome_arquivo>
4. exit 0
vim /etc/courier/authldaprc
LDAP_URI ldap://172.86.23.171
LDAP_SERVER 172.86.23.171
LDAP_PORT 389
LDAP_PROTOCOL_VERSION 3
LDAP_AUTHBIND 1
LDAP_BASEDN dc=ad,dc=solisc
LDAP_BINDDN cn=bind,cn=users,dc=solisc
LDAP_BINDPW Solisc2010
LDAP_TIMEOUT 5
LDAP_FILTER (objectClass=organizationalPerson)
LDAP_DOMAIN solisc
LDAP_FULLNAME cn
LDAP_CLEARPW clearPassword
LDAP_CRYPTPW userPassword
LDAP_MAIL mail
LDAP_GLOB_UID 1000
LDAP_GLOB_GID 1000
LDAP_MAILDIR wWWHomePage
LDAP_HOMEDIR streetAddress
LDAP_DEREF never
LDAP_MAILDIRQUOTA st
vim /etc/courier/authdaemonrc
authmodulelist="authldap"
authmodulelistorig="authldap"
daemons=50
authdaemonvar=/var/run/courier/authdaemon
DEBUG_LOGIN=0
DEFAULTOPTIONS=""
LOGGEROPTS=""
vim /etc/spamassassin/local.cf
rewrite_header Subject *****SPAM*****
trusted_networks 172.86.0.0/16
required_score 5.0
use_bayes 1
bayes_auto_learn 1
bayes_ignore_header X-Bogosity
bayes_ignore_header X-Spam-Flag
bayes_ignore_header X-Spam-Status
touch /etc/postfix/helo-invalid; touch /etc/postfix/header_checks; postmap /etc/postfix/helo-invalid; postmap /etc/postfix/header_checks
adduser vmail (senha vmail)
Alterar o home do usuário para /vmail
mkdir /AV; chown clamav /AV; chgrp clamav /AV; mkdir /vmail; chown vmail /vmail; chgrp vmail /vmail
ln -s /etc/maildroprc /etc/courier/maildroprc
Habilite o Spamassassin, substituindo o 0 por 1 no arquivo /etc/default/spamassassin – ENABLED=1
5. Campos utilizados no Active Directory
Criação de usuários:
E-mail: Preencher com e-mail do usuário.
Página do Web: Preencher com o Maildir do usuário.
Rua: Home do Postfix (igual para todos usuários)
Cidade: Redirecionamento (repetir email do usuario para desabilitar)
Estado: Quota de disco em bytes (não esquecer do S no final)
Criação de listas:
Para cada lista deve ser criada uma ACL no arquivo no Posftix e criado um grupo no AD com o mesmo username do email da lista.
Nome do grupo: Deve ser o mesmo username do email da lista
E-Mail: Endereço de e-mail da lista.
Incluir e/ou remover aqui os usuários ativos na lista.
Configuração do SPF
perl -MCPAN -e shell
install Mail::SPF
q
Editar o arquivo de DNS e incluir a linha do SPF abaixo do MX
mailserver.solisc.org.br. IN TXT "v=spf1 ipv4:172.86.23.39/32 mx -all"
Incluir no final do arquivo /etc/postfix/master.cf
6. vim /etc/postfix/master.cf
policy unix - n n - - spawn user=nobody argv=/usr/bin/perl /usr/lib/postfix/policyd-spf-perl
Testando: host -t txt mailserver.solisc.org.br
mailserver.solisc.org.br descriptive text "v=spf1 ipv4:172.86.23.39/32 mx -all"
Obs.: OS ARQUIVOS INCLUIDOS NESSE DOCUMENTO JÁ INCLUEN AS ALTERAÇÕES ACIMA.
Disco virtua RAMDISK para a Queue
Inlcuir no /etc/rc.local: mount -t tmpfs none /AV
Configuração do OpenISCSI
iscsiadm -m iface -I iface4 --op=new
iscsiadm -m iface -I iface4 --op=update -n iface.hwaddress -v d8:d3:85:b8:5d:8a
iscsiadm -m discovery -t st -p 10.0.30.2 iface4 -P 1
iscsiadm -m node -T iqn.1986-03.com.hp:storage.msa2324i.0944da4fac -l
mount -t ext3 /dev/sdg1 /vmail
vim /etc/iscsi/iscsid.conf
isns.address = 10.0.30.2
isns.port = 3260
node.startup = automatic
node.session.timeo.replacement_timeout = 120
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 20
node.session.initial_login_retry_max = 8
node.session.queue_depth = 32
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.conn[0].iscsi.MaxRecvDataSegmentLength = 131072
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
node.session.iscsi.FastAbort = Yes
vim /etc/fstab
/dev/sda1 /vmail ext3 rw,sync,auto,_netdev 0 0
Verificação de portas
nmap 127.0.0.1
22/tcp | 25/tcp | 111/tcp | 143/tcp | 734/tcp | 783/tcp
Relação de arquivos utilizados:
/etc/passwd
/etc/group
/etc/rc.local
/etc/fstab
/etc/crontab
/etc/resolv.conf
/etc/iscsi/iscsid.conf
/etc/postfix/main.cf
/etc/postfix/master.cf
/etc/postfix/helo-invalid
/etc/postfix/header_checks
/etc/courier/authldaprc
/etc/courier/authdaemonrc
/etc/spamassassin/local.cf
/etc/maildroprc
/etc/default/spamassassin
/usr/lib/postfix/clamav-filter.sh
Obs.: Os arquivos de configuração não podem conter espaços em branco no final das linhas.