Posts

Showing posts from 2012

Configuring SASL Auth in Postfix

A)  SASL  Configuration    First ensure that Cyrus- SASL  and salsauthd are installed.  Then configure /etc/sysconfig/saslauthd so that  SASL  uses IMAP  authentication  => MECH=rimap FLAGS="-O localhost"  (Assuming that localhost is the IMAP Server) restart saslauthd service  test  sasl  by using the command - testsaslauthd.  The testsaslauthd command for a user should return success. If it does,  SASL  configuration is fine. Now to configure Postfix. B) Configure Postfix to use this underlying  SASL  => 1.  Edit  main.cf  => # vim /etc/postfix/main.cf smtpd_sasl_auth_enable = yes broken_sasl_auth_clients = yes smtpd_sasl_security_options = noanonymous 2. Edit /usr/lib/sasl2/smtpd.conf => pwcheck_method: saslauthd mech_list: PLAIN LOGIN To ensure that username and the "from" address in an email client match => Create the File vim /etc/postfix/controlled_ envelope_senders # envelope sender owners ( S

POSTFIX VIRTUAL VACATION WITH MYSQL

VIRTUAL VACATION  DOC. # useradd -s /sbin/nologin vacation # mkdir /var/spool/vacation # cp /var/www/html/mailadmin/VIRTUAL_VACATION/vacation.pl /var/spool/vacation/ # chown -R vacation.vacation /var/spool/vacation/ # chmod 700 /var/spool/vacation/vacation.pl # cd /var/spool/vacation/ ### Install Cpan Command ### # perl -MCPAN -e shell ### Modules Install Example ### # cpan cpan> install DBD::mysql ### Requirements - The Following Perl Modules Are Required: ### DBD::mysql , Mail::Sender , Email::Valid , MIME::Charset , Log::Log4perl , Log::Dispatch , MIME::EncWords and Class::Load # wget http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Log-Dispatch-2.32.tar.gz # tar -xvf Log-Dispatch-2.32.tar.gz # cd Log-Dispatch-2.32 # perl Makefile.PL # make # make install # wget http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Params-Validate-1.06.tar.gz # tar -xvf Params-Validat

Amavis & Clamd Installation

                                                                                                                          Install amavis 1. install perl* [root@mail ~]#  yum install perl 2. install cpan [root@mail ~]# perl -MCPAN -e shell 3. login cpan [root@mail ~]# cpan ==> enter example [root@test ~]# cpan Terminal does not support AddHistory. cpan shell --CPAN exploration and modules installation (v1.7602) ReadLine support available (try 'install Bundle::CPAN') cpan> install Compress::Raw::Zlib ######## Modeuls ############## Compress::Raw::Zlib IO::Compress::Base IO::Compress::Zlib Compress::Zlib IO::Zlib Algorithm::Diff Text::Diff Archive::Tar File::Which Archive::Zip BerkeleyDB IO::stringy MailTools MIME::Base MIME::tools Convert::TNEF Convert::BinHex Convert::UUlib Data::UUID Digest::MD5 Net::Server Time::HiRes zlib Unix::Syslog Sys::Hostname::Long Socket IP::Country Net::CIDR::Lite Net_SSLeay.pm IO::Socket::SSL

Restricting users cannot send mail to off-site Domains

Problem     Restricting users cannot send mail to off-site Domains Solution   # cd /etc/postfix/   Create The File   1.   local_domains  => edit the file your Domain Name new.com   OK 2.   senders_user =>  edit the file restricted Users Name this users cannot send mail to off-site Domains fl@new.com          local_only amit@new.com          local_only ############################## #################### # vim /etc/postfix/ main.cf smtpd_restriction_classes =   local_only local_only   =    check_recipient_access hash:/etc/postfix/local_ domains, reject smtpd_recipient_restrictions =         check_sender_access hash:/etc/postfix/senders_ user,         permit_mynetworks,         reject_unauth_destination,         permit # postmap hash:/etc/postfix/local_domains # postmap hash:/etc/postfix/sender_user # /etc/init.d/postfix restart Testing  [raju@a]# telnet localhost 25  ====>  fl@new.com Not send Other Domains Trying 127.0.0.1... Connected to localhost.localdoma

Transparent Proxy With Squid

I am using 2 lan card  :- eth0 – 192.168.0.100  ( Private Line ) eth1 – 192.168.100.100 ( BSNL  Line ) [root@localhost ~]# yum install squid* [root@localhost ~]# yum install caching-nameserver* [root@localhost ~]# yum install dhcp* [root@localhost ~]# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample  /etc/dhcpd.conf [root@localhost ~]# vim /etc/dhcpd.conf ===> Change The Lines ddns-update-style interim; ignore client-updates; subnet 192.168.0.0 netmask 255.255.255.0 { # --- default gateway         option routers                  192.168.0.10;         option subnet-mask              255.255.255.0; #       option nis-domain               "domain.org";         option domain-name              "raju.com";         option domain-name-servers      192.168.0.10;         option time-offset              -18000; # Eastern Standard Time #       option ntp-servers              192.168.1.1; #       option netbios-name-servers     192.168.1.1; # --- Selects point-to-point node (d

Squid authentication With Ldap

install The Squid # yum install Squid* and in am already using  The  Ldap with Mail Server as discussed earlier my ==>  super admin  is  cn=admin,dc=new,dc=com my  ==> Domain is dc=new,dc=com # vim /etc/squid/squid.conf first search auth_param , paste the Following line and change the According to your Domain   auth_param basic program /usr/lib/squid/squid_ldap_auth -R -b "dc=new,dc=com" -D "cn=admin,dc=new,dc=com" -wkeenable@123 -f mail=%s -h 192.168.100.96 auth_param basic children 5 auth_param basic realm Your Organisation Name auth_param basic credentialsttl 5 minutes next search CONNECT paste the Following line acl ldapauth proxy_auth REQUIRED http_access allow ldapauth http_access deny all and save & Quit squid File now give setting of your proxy server in client machine with ip and port no 3128. now when you go in browser for any site it will ask for user name and password. give the user name and password and enjoy.

Postfix With LDAP

                POstfix Wiht Ldap # yum install postfix* php* http*  openldap* rpm* # yum install system-switch-mail* # system-switch-mail Change sendmail to postfix [*] sendmail [] postfix change [] sendmail [*] postfix # useradd  raju #password raju # useradd  virtual # vim /etc/passwd  ==> change virtual:x:1001:1001::/home/virtual:/bin/bash # vim /etc/group ==> change virtual:x:1001: Download Sum Tar & RPM # su - raju $ wget http://ftp.wl0.org/official/2.8/SRPMS/postfix-2.8.2-1.src.rpm $ wget http://citylan.dl.sourceforge.net/project/courier/imap/4.9.2/courier-imap-4.9.2.tar.bz2 $ wget https://sourceforge.net/projects/courier/files/authlib/0.63.0/courier-authlib-0.63.0.tar.bz2/download $ echo "%_topdir    $HOME/rpm" >> $HOME/.rpmmacros $ mkdir rpm $ cd rpm/ $ mkdir  BUILD  RPMS  SOURCES  SPECS  SRPMS $ cd RPMS/ $ mkdir  i386 $ rpm -ivh postfix-2.8.2-1.src.rpm $ cd rpm/SPECS/ $ vim postfix.spec  ===> Change The Lines %d

KVM-VIRTUAL-MACHINE

Install the RHEL FOR 64Bit. Create the Yum Server For RHEL 64Bit. [root@station27 ~]# yum install kvm* qemu* libvirt* python-virtinst* [root@station27 ~]# /etc/init.d/libvirtd start [root@station27 ~]# virsh -c qemu:///system list [root@station27 ~]# yum install bridge-utils* [root@station27 ~]# /etc/init.d/NetworkManager stop [root@station27 ~]# chkconfig NetworkManager off [root@station27 ~]# /etc/init.d/network restart [root@station27 ~]# cd /etc/sysconfig/network-scripts/ [root@station27 ~]# vim ifcfg-br0 ################################################################ DEVICE=br0 TYPE=Bridge BOOTPROTO=static GATEWAY=192.168.0.1 IPADDR=192.168.0.100 NETMASK=255.255.255.0 ONBOOT=yes ################################################################ [root@station27 ~]# vim ifcfg-eth0 ############################################################## DEVICE=eth0 HWADDR=00:1e:90:f3:f0:02 ONBOOT=yes TYPE=Ethernet IPV6INIT=no USERCTL=no BRIDGE=br0 ##############################################

Mysql Authentication in Squid

[root@station39 ~]# yum install *mysql* *squid* *gcc* -y ===> Download mysql_auth-0.8.tar.gz [root@station39 ~]# /etc/init.d/mysqld restart [root@station39 ~]# mysqladmin password "password" [root@station39 ~]# useradd proxy [root@station39 ~]# passwd proxy [root@station39 ~]# su - proxy [proxy@station39 ~]$ wget http://people.arxnet.hu/airween/mysql_auth/mysql_auth-0.8.tar.gz [proxy@station39 ~]$ tar xvzf mysql_auth-0.8.tar.gz [proxy@station39 ~]$ cd mysql_auth-0.8 [proxy@station39 mysql_auth-0.8]$ vim squid.sql ####################################################### CREATE DATABASE squid; use squid; DROP TABLE IF EXISTS `auth`; CREATE TABLE `auth` ( `username` varchar(25) default NULL, `password` varchar(25) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; LOCK TABLES `auth` WRITE; INSERT INTO `auth` VALUES ('username','username '); UNLOCK TABLES; ####################################################### [proxy@station39 mysql_auth-0.8]$ exit [r

SNMP With CACTI

SNMP+CACTI =========================================== What is SNMP Simple Network Management Protocol ( SNMP ) is an "Internet-standard protocol for managing devices on IP networks.Devices that typically support SNMP include routers, switches, servers, workstations, printers, modem racks, and more. It is used mostly in network management systems to monitor network-attached devices. Required software(s) MySQL Server : Store cacti data. NET-SNMP server - SNMP (Simple Network Management Protocol) is a protocol used for network management. PHP with net-snmp module - Access SNMP data using PHP. Apache / lighttpd / ngnix webserver : Web server to display graphs created with PHP and RRDTOOL Install the software [root@localhost ~]# yum install mysql* php* http* -y Configure MySQL server [root@localhost ~]# /etc/init.d/mysqld restart [root@localhost ~]# mysqladmin password "redhat"