Wednesday, June 30, 2010

EXIM

* dnsbl.info --> lists blacklisted mail servers.
* spamcop.net --> listed mail servers for spam.

* Commands
1) Count total mails in queue
$ exim -bpc
2) Give mail header
$ exim -Mvh
3) List messages
$ exim -bp
4) Message from a particular user.
5) Lists mail received by a particular user
$ exiqgrep -f
6) List receipients
$ exiqgrep -r

* Frozen Mail --> due to spam
1) Froze a mail
$ exim -f
2) Display message body
$ exim -Mvb
3) Remove a message
$ exim -Mrm
4) Forceful delivery --> If its frzen then exim would try to deliver but fails.
$ exim -M
5) Freeze a message
$ exim -Mf

* All queues are in /var/spool/exim/input/
* Stop exim before removing /var/spool/exim/input/*

Mail log & Services
* Bounced message is indicated by **
* Bounced message --> if sending fails then the message gets bounced back.
* Retry period can be changed inside /etc/exim.conf

Exim log
* mainlog --> /var/log/exim
* paniclog --> error related to exim log
* rejectlog --> shows bounced message

Retry
* Inside /etc/exim.conf search for retry (comment it if working fails)



Q) Create an email-account then send & receive email?
Note: dovecot -->> POP
1) yum install exim
2)rpm -qa|grep exim
3) netstat -panel|grep 25
4) telnet 192.168.2.48 25 ------>>>>>>tests for connection
5) Stop sendmail (if its already installed)
6) vim /etc/exim/exim.conf
.........
ListenInterface 0.0.0.0
............
7) Add s/m user
$ useradd user1
$ passwd user1
8) cd /home/user1
9) vim /etc/exim/exim.conf ------->>>>>create mailbox
..........
local_delivery
........
file = ..... $INBOX:/home/$local_part/Inbox ------->>>>>>>Inbox is a file
................
localdomains=@:localhost:user1.com ----->>>>> defines a local domain
..............
10) start exim
11) exim -bt user1@user1.com ----->>>>> tracing the domain

SENDING MAIL
$ telnet 25
HELO hello
.........
MAIL FROM: user1@gmail.com
RCPT TO: user1@yahoo.com
.....
SUBJECT: my subject
DATA
sdfsdfsdfsdlf
.


$ grep /var/log/exim/main_log ----->>>>> check status

INSTALL DOVECOT (Zimbra --> advanced version of Dovecot)
-->>> dovecot listens on all ports supported by POP2,POP3,POPS2,POPS2,IMAP,IMAPS
$ yum install dovecot
$ telnet localhost 110
$ vim /etc/dovecot.conf
............
mail_location= ........$INBOX=/home/%u/Inbox -->>>>> Inbox is a file
.........
$ restart dovecot
$ telnet localhost 110
user user1
pass passuser1
list
.....
retr 1


INSTALL SQUIRRELMAIL

1) Download squirrelmail
2) Extract it to home directory of user1 /home/user1/
3) cd /home/user1/squirrelmail
4) mkdir attach
5) chmod 755 attach data
6) ./configure
select 1,2&4
7) Browse http:///squirrelmail/index.php

Note:* set the VirtualHost entry @ start
* set "retry" option in /etc/exim/exim.conf
* Enable php and mbstring for running squirrelmail

Cpanel for beginners

Features of CPanel

* Domain management
* Email management
* Site management
* Security management(can be used to block IP's)
* Statistics management
* Database management
* Reseller management


->>> We can install a set of predefined applications using Cpanel
->>> Mail Server used is Exim
->>> Webmail is a mail interface

3 Users in Cpanel
->>> Cpanel : domain owner(username is "root")
->>> Webhost manager : Server Admin & Reseller panel
->>> Webmail panel : webmail access panel

Webhost Manager (WHM)
->> Accessed via
http://:2086
https://:2087

Cpanel Access
->> Accessed via
http://:2082
https://:2083


Initial Setup

1) Change root password
2) Set disk quota
3) Set time
4) Statistics
5) Tweak settings -->>> Spam assassin

* PHP (max upload size) --> /usr/local/lib/php.ini

* Statistics Program (3 locations)
1) Statistical software configuration
2) Tweak settings -> stats. programs
3) Feature manager

* Update Preferences --> A cron job run @ 1 @ night (everyday)

* Network Setup
1) Change hostname
2) Nameserver IP's --> assign IP address
3) Resolver

* Securtiy Center
1) Apache mod_userdir Tweak --> temporary URL -->http:///~username/ -->
bandwidth usage shown as IP address & not in sitename
2) Fix insecure permissions --> check for files with insecure permissions.

* When we install Cpanel any required S/w's would be installed automatically.

* Service Monitoring
1) Run every 5 minutes
2) daemon name is chkscrvd. It monitors all services and if it finds any service down, it would
start it.

* Sending email failed (Issue)
1) check whether SMTP is working by
$ telnet 25
2) Some country specific issues(disallowing port 25) --> (Workaround) enable exim on
another port.
3) We could run exim on another port, say 26.


* Backup
(1) --> sda1 (home)
sda2 (backup)
(2) --> sda1 (/home/backup)
(3) --> server1 (home) -->> max 15 hours for restoring.
server2 (backup)

* Manager
1) Package
2) Feature
3) Theme

* Restore multiple backups
* System reboot
* Server status
* List suspended accounts
* Search accounts
* Showaccounts over quota
* Bandwidth usage -->> reset to 0 every month.
* Unsuspend bandwidth

* Email
1)incoming mail -->>new (directory)-->>after reading-->cur(directory)

* Counter application(Counts hits)
Fantastico -->> Application manager

* /etc/trueuserowners

* Cpanel Script
1) restartsrv
2) makecpphp --> built in php in cpanel
3) /usr/local/cpanel/bin/checkperlmodules -->(Install missing perl modules automatically)
4) /scripts/fixquota -->>(/etc/quota.conf) --> If quota exceed issue arrives
5) /scripts/updateuserdomains --> if domain entry is missing.
6) /scripts/easyapache --> add modules to apache(s/w used is EasyApache)
7) eximup --> apply exim update
8) buildeximconf --> builds exim from start.

*Cpanel User Home Directory
1) /home//.....

* BoxTrapper

* Authentication of mail account
1) /home/check/etc/check.com/passwd
2) /home//.htaccess

* crontab -l -u

* Theme --> modify account (/usr/local/cpanel/base/frontend/)


* Adding a Cpanel user
1) Home directory is created as /home/
2) Entry added to /etc/passwd
3) Entry added to /etc/localdomains
4) Entry added to /etc/userdomains
5) Entry added to /etc/trueuserdomains
6) Created /etc/valiases/
7) Created /etc/vfilters/
8) Added zone entry to /etc/named.conf
9) Created zone entry to /var/named
10) Added VirtualHost entry to /usr/local/apache/conf/httpd.conf
11) Created log files in /usr/local/apache/domlogs/
12) Created file in /etc/proftpd
13) Created an entry in /etc/proftpd/passwd.vhost
14) Created file in /var/cpanel/users/