Saturday, March 11, 2017

Copy all Incoming Outgoing Emails - Employee monitor

How can we monitor employee's email conversations ?

If we are running company, It's too impotent to monitoring employee's email conversations which is traveled by company domain name. If you are using WHM with Exim mail server, it's too easy.

Let's consider "domain.com" is your company domain, you have 50's of mail IDs. You are having a mail ID "[email protected]" and you need to archive / monitor all your mails incoming and outgoing mails to "[email protected]".

To do this, you must have access to server with ssh (root access) and WHM (root access).

1. "/usr/local/cpanel/etc/exim/sysfilter/options" is path where you can store all custom filters.

#cd /usr/local/cpanel/etc/exim/sysfilter/options

2. Create a empty file for store your filter rules. You can create as much of filter as you want, so create a file with understandable name with domain name, replace domain_com to your company domain name.

#vim incoming_outgoing_domain_com

3. Copy paste bellow code to this file and replace "domain.com" to your company domain name and "[email protected]" to your mail that you created for archive all mails,

For incoming mails only,

if ("$h_to:, $h_cc:, $h_bcc" contains "domain.com")
then
     unseen deliver "[email protected]"
endif

For outgoing mails only,

if $sender_address: contains "domain.com"
then
     unseen deliver "[email protected]"
endif

For incoming and outgoing mails,

if ("$h_to:, $h_cc:, $h_bcc" contains "domain.com")
   or ("$sender_address:" contains "domain.com")
then
   unseen deliver "[email protected]"
endif


Note: Forwarding to other domains, outside server won't work.

Wednesday, March 8, 2017

Device eth0 does not seem to be present, delaying initialization - Virtual Box Error - CentOS 6.6

Hello everyone,

Today I've faced an error on Virtual Box with CentOS 6.6 today, If you are frequently use virtual machines, you'll see these kind of errors. Let's explain my situation.

I've installed and used CentOS 6.6 for python before 2 months, later I've deleted it's account (not files) from Virtual Box because of no frequent use. Today I need to test something on that server. So I've created account and pointed this virtual machine to newly created account.

Once server up, logged to server and tried to ping for check the network. Network not succeeded, when I check IP with ifconfig, I can see only loopback network. "service network restart" says "Device eth0 does not seem to be present, delaying initialization".

Okay, What is solution now ?

Reason for this issue: When we install guest OS with virtual box, It'll assign mac address to it's guest OS's device. But in our case, we have installed guest OS already and it already assigned some mac address. When we create account again and merge guest OS with it, we will get conflict with 2 different mac address. One was created during original installation of guest OS, another one is created during recreate of virtualbox guest OS account.

To fix this,

Login to OS, remove the file as mentioned bellow, which have old mac address.

# rm /etc/udev/rules.d/70-persistent-net.rules

Reboot server, so that new fill will be generated again,

# reboot

Now open the file,
# cat /etc/udev/rules.d/70-persistent-net.rules

It'll look as mentioned bellow,

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:17:ef:c5:08", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Note down the ATTR{address}

open following file

# vim /etc/sysconfig/network-scripts/ifcfg-eth0

Replace mac address which you copied to HWADDR
Remove line with UUID

Now restart the network service,

# service network restart

That's It. Now you can able access network on guest OS.