Blog

CNERIS

CNERIS

Website URL: http://www.cneris.com
Monday, 23 January 2017 10:06

Find attachments in Gmail

How can you find an attachment in Gmail? 

It's very simple. Imagine you want to seek all email sent to This email address is being protected from spambots. You need JavaScript enabled to view it. with attachment.

So you need to introduce in gmail

to:This email address is being protected from spambots. You need JavaScript enabled to view it. has:attachment

 

Tuesday, 15 November 2016 23:50

How to disable SSH timeout?

SSH clients will automatically be disconnected from the server and prompt the below message after being idle or inactive for a while.

This is due to the SSH servers' configuration (often by default) to avoid hanging sessions and free up resources. These are the related options in the SSH server configuration;

TCPKeepAlive

Whether or not to send TCP “alive” message to the connecting clients to test for connection issues. Defaults to yes.

ClientAliveInterval

A timeout interval to send encrypted alive message to clients if no data has been received from connection. Defaults to 0 (not sending any message).

ClientAliveCountMax

Number of times to send the encrypted alive message before disconnecting clients if no response are received. Defaults to 3.

If you have administrative access to the SSH servers, you can change the options so that you will not easily be disconnected. Edit the SSH server configuration file (normally in /etc/ssh/sshd_config for Unix based operating systems) and set the related options as the followings (uncomment or add if necessary);

TCPKeepAlive no 

ClientAliveInterval 30

ClientAliveCountMax 100

What it basically means is that the server will not send the TCP alive packet to check if the client's connection is working, yet will still send the encrypted alive message every 30 seconds but will only disconnect after 24 hours of inactivity. Be sure to restart the SSH service after the reconfiguration. The following command would work for most Unix based servers;

sudo service sshd restart

If you don't have administrative access to the server, you can configure the SSH client to send the alive message to the server instead. The key here is the ServerAliveInterval option for the SSH client.

You can do this by updating /etc/ssh/ssh_config (applying the setting to every user in the system) or in ~/.ssh/config (single user). Set the following option to have the client send the alive packet every 30 seconds to the server;

 

ServerAliveInterval 30

Killing process will not get you far. I would rather recommend stop so you can inspect what is going on. By running

kill -TERM 17757

You will kill the process (notice PID column value for sync_supers may have changed since. Instead of killing immediately try doing

kill -STOP 17757

Then inspect procfs for this process ID

ls -al /proc/17757/

It will be informative to see cwd line; it says from which dir this process was started Examine also

cat /proc/17757/cmdline

To see how process was started

And also possibly interesting info in

ls -la /proc/17757/fd

Which will tell you if any files are opened by process.

If you want to interactively snoop on what process is doing, you can attach to it with system call tracer  strace like this

strace -p 17757

However if process is stopped, you would not see much since it's stopped, so this may be something to consider before doing anything to the process.

About Spamassassin

Spamassassin is a free and open-source mail filter written in Perl that is used to identify spam using a wide range of heuristic tests on mail headers and body text. It will save your mailbox from much unwanted spam emails.

 

1. Prerequisites

Before installing Spamassassin, you need to install and setup a mail transfer agent such as Postfix on your virtual private server.

You can find instructions on that here

 

2. Install Spamassassin

Use apt-get to install Spamassassin and spamc.

apt-get install spamassassin spamc

Once Spamassassin is installed, there are a few steps that has to be taken to make it fully functional.

 

3. Adding Spamassassin User

To run Spamassassin you need to create a new user on your VPS.

4. First add the group spams:

groupadd spamd

then add the user spamd with the home directory /var/log/spamassassin:

useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd

then create the directory /var/log/spamassassin:

mkdir /var/log/spamassassin

and change the ownership of the directory to spams:

chown spamd:spamd /var/log/spamassassin

Let's set up Spamassassin now.

 

5. Setting Up Spamassassin

Open the spamassassin config file using:

nano /etc/default/spamassassin

To enable Spamassassin find the line

ENABLED=0

and change it to

ENABLED=1

6. To enable automatic rule updates in order to get the latest spam filtering rules find the line

CRON=0

and change it to

CRON=1

Now create a variable named SAHOME with the Spamassassin home directory:

SAHOME="/var/log/spamassassin/"

Find and change the OPTIONS variable to

OPTIONS="--create-prefs --max-children 2 --username spamd -H ${SAHOME} -s ${SAHOME}spamd.log"

This specifies the username Spamassassin will run under as spamd, as well as add the home directory, create the log file, and limit the child processes that Spamassassin can run.

 

7. If you have a busy server, feel free to increase the max-children value.

Start the Spamassassin daemon by using the following code:

service spamassassin start

 

Now, let's config Postfix.

Configuring Postfix

The emails still do not go through Spamassasin. To do that, open Postfix config file using:

nano /etc/postfix/master.cf

Find the the line

smtp      inet  n       -       -       -       -       smtpd

and add the following

-o content_filter=spamassassin

Now, Postfix will pipe the mail through Spamassassin.

 

To setup after-queue content filter add the following line to the end of the file

 

spamassassin unix -     n       n       -       -       pipe

        user=spamd argv=/usr/bin/spamc -f -e  

        /usr/sbin/sendmail -oi -f ${sender} ${recipient}

For the changes to take effect restart postfix:

service postfix restart

Now postfix will use spamassassin as a spam filter.

 

 

Configuring Spamassassin on your VPS

To get the maximum use of Spamassassin you have to create rules.

 

Open the Spamassassin default rules file using:

 

nano /etc/spamassassin/local.cf

To activate a rules uncomment line remove the # symbol.

 

To add a spam header to spam mail uncomment or add the line:

 

rewrite_header Subject [***** SPAM _SCORE_ *****]

Spamassassin gives a score to each mail after running different tests on it. The following line will mark the mail as spam if the score is more than the value specified in the rule.

 

required_score           3.0

To use bayes theorem to check mails, uncomment or add the line:

 

use_bayes               1

To enable bayes auto learning, uncomment or add the line:

 

bayes_auto_learn        1

After adding the above details, save the file and restart spam assassin.

 

service spamassassin restart

 

Testing

To see if Spamassassin is working, you can check the spamassassin log file using:

 

nano /var/log/spamassassin/spamd.log

or send the email from an external server and check the mail headers.

Saturday, 22 October 2016 22:25

If you wanna obsfucate your HTML code

If you wanna obsfucate your HTML code avoiding people to edit you site and copy the code, obsfucating your HTML code could be a choice. At least it will make harder copying the code. http://www.protegerhtml.info/ offers you the possibility to obsfucate the code

Anyway, honest I don't find it too useful. Just use chrome to reveal the original HTML code

 

Saturday, 15 October 2016 17:05

How to fix - Microdata Schema Test

HTML5 Microdata is an easy way to add semantic markup to your web pages. Search engines rely on this markup to improve the display of search results, making it easier for people to find the right web pages.

Here is a simple example of how to use HTML5 microdata in your contact web page:

<div itemscope itemtype="http://schema.org/Person">

   <span itemprop="name">CNERIS CNERIS</span>

   <span itemprop="company">The Example Company</span>

   <span itemprop="tel">604-555-12134</span>

   <a itemprop="email" href="mailto:This email address is being protected from spambots. You need JavaScript enabled to view it.">This email address is being protected from spambots. You need JavaScript enabled to view it.</a>

</div>

Saturday, 15 October 2016 17:01

How to fix - IP Canonicalization Test

In order to pass this test you must consider using a 301 re-write rule in your .htaccess file so that your site's IP points to your domain name.

If your site is running on apache server, you could put these lines in your .htaccess after RewriteEngine on line:

RewriteCond %{HTTP_HOST} ^XXX\.XXX\.XXX\.XXX

RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]

Note that you must proper format the first line using your IP (replace X characters with proper digits from your IP) and the second line using your domain name.

Saturday, 15 October 2016 16:56

How to fix - URL Canonicalization Test

You must consider using a 301 re-write rule in your .htaccess file so that both addresses (http://example.com and http://www.example.com) resolve to the same URL. 

- If you want to redirect http://www.example.com to http://example.com, you can use this:

RewriteCond %{HTTP_HOST} ^www\.example\.com$

RewriteRule ^/?$ "http\:\/\/example\.com\/" [R=301,L]

- If you want to redirect http://example.com to http://www.example.com, you can use this:

RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]

RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

Note that you must put the above lines somewhere after RewriteEngine On line.

When the mails sent by my domain are rejected by Microsoft accounts...

 

Error Codes:

# 550 SC-001 Mail rejected by Microsoft  for policy reasons. Reasons for rejection may be related to content with spam-like characteristics or IP/domain reputation. If you are not an e-mail/network admin please contact your E-mail/Internet Service Provider for help.

550 SC-002 Mail rejected by Microsoft  for policy reasons. The mail server IP connecting to Hotmail has exhibited namespace mining behavior. If you are not an e-mail/network admin please contact your E-mail/Internet Service Provider for help.

550 SC-003 Mail rejected by Microsoft  for policy reasons. Your IP address appears to be an open proxy/relay. If you are not an e-mail/network admin please contact your E-mail/Internet Service Provider for help.

550 SC-004 Mail rejected by Microsoft for policy reasons. A block has been placed against your IP address because we have received complaints concerning mail coming from that IP address. We recommend enrolling in our Junk E-Mail Reporting Program (JMRP), a free program intended to help senders remove unwanted recipients from their e-mail list. If you are not an e-mail/network admin please contact your E-mail/Internet Service Provider for help.

# 550 DY-001 Mail rejected by Microsoft  for policy reasons. We generally do not accept email from dynamic IP's as they are not typically used to deliver unauthenticated SMTP e-mail to an Internet mail server. If you are not an e-mail/network admin please contact your E-mail/Internet Service Provider for help. http://www.spamhaus.org maintains lists of dynamic and residential IP addresses.

550 DY-002 Mail rejected by Microsoft  for policy reasons. The likely cause is a compromised or virus infected server/personal computer. If you are not an e-mail/network admin please contact your E-mail/Internet Service Provider for help.

550 OU-001 Mail rejected by Microsoft  for policy reasons. If you are not an e-mail/network admin please contact your E-mail/Internet Service Provider for help. For more information about this block and to request removal please go to: http://www.spamhaus.org.

550 OU-002 Mail rejected by Microsoft for policy reasons. Reasons for rejection may be related to content with spam-like characteristics or IP/domain reputation. If you are not an e-mail/network admin please contact your E-mail/Internet Service Provider for help.

421 RP-001 The mail server IP connecting to Microsoft  server has exceeded the rate limit allowed. 
Reason for rate limitation is related to IP/domain reputation problems.  
If you are not an email/network admin please contact your E-mail/Internet Service Provider for help.
Email/network admins, please visit http://postmaster.live.com for email delivery information and support (state 13). 

220 SNT0-MC3-F28.Snt0.hotmail.com Sending unsolicited commercial or bulk e-mail to Microsoft's computer network is prohibited.

Other restrictions are found at http://privacy.msn.com/Anti-spam/.
Violations will result in use of equipment located in California and other states.

 

If you are a customer using the 3rd party email service or a Microsoft Account user who is unable to receive emails from a particular 3rd party domain:

Contact your domain administrator and ask them to get in touch with the Microsoft Sender Support Team. They have to fill out the e-form that can be found on the following link:

https://support.live.com/eform.aspx?productKey=edfsmsbl3&ct=eformts&wa

If you do not know how you can get in touch with your domain admin, you can use WHOIS tools to search for your contact e-mail address of your domain admin.

If you are the 3rd party Domain Administrator:

Please review our policies and guidelines at http://postmaster.live.com.

If you are in compliance, submit a support request to our Email and Delivery Filtering Services team by clicking on the link to the e-form under the troubleshooting section in the postmaster site mentioned above.

Sunday, 29 May 2016 21:22

Most common CRM free and open source

1. SuiteCRM

2. CapsuleCRM

3. Insightly

4. Really Simple Systems

5. FreeCRM

6. Bitrix24

7. Raynet

8. vTiger

9. ZohoCRM

10. Zurmo

11. Hubspot CRM

12. InStream

13. High Rise

14. Sugar CRM

15. Splendid CRM

16. OpenCRX

17. EspoCRM

18. Xtuple.

source link

Page 2 of 2