Super fast and easy email synchronization with imapsync and docker

If you need to migrate or transfer an email server to other provider, then you also need to export / import all your emails and folders. In that case you can struggle with many problems. For example:

  • Different Email Clients with different export format
  • No export or import function
  • Costly import / export tools

With imapsync you can easily do it without big effort. You will need only Docker installed. On the Docker documentation page you can find installation guide for linux / mac and windows.

So, if you have already docker, then just run this command and all emails will be exported from host1 to host2. Keep in mind that host1 and host2 are IMAP server addresses

docker run gilleslamiral/imapsync imapsync \ --host1 imap.server.com --user1 import_emails@FROM.com --password1 'pass' \ --host2 imap.server.com --user2 import_emails@TO.com --password2 'pass' \ --automap "$@"

Useful imapsync commands before synchronization:

--dry : Makes imapsync doing nothing for real, just print what would be done without --dry.
--justconnect : Just connect to both servers and print useful information. Need only --host1 and --host2 options.
--justlogin : Just login to both host1 and host2 with users credentials, then exit.
--justfolders : Do only things about folders (ignore messages).

For more advanced usage please visit official syncmap github page at https://github.com/imapsync/imapsync

Auto webserver and database backup with GPG encryption to Amazon S3

In this tutorial I will show you step-by-step  instructions how to make cheap and secure encrypted backups of you webserver (or any other dir)  files on you linux  server using Amazon Storage Service

Continue reading Auto webserver and database backup with GPG encryption to Amazon S3

How to send notifications from Linux fail2ban, ssh auth and other actions to Slack

For this approach i will use my slackpost.sh script to send messages to Slack. More info about it you can find – https://mindau.de/blog/en/en-post-messages-slack-linux/

Continue reading How to send notifications from Linux fail2ban, ssh auth and other actions to Slack

[EN] Simple way to monitor websites in Linux with Slack

Mostly is very usefull to know if one or another website is down. Here is simple example to monitor your websites:


#!/bin/sh
# script to check website status (online/ofline)
while read site
do
if ping -w 60 -c1 -q "$site" &>/dev/null; then
echo "$site is up" # for debug
else
# action to do if website offline
echo "[$(date +%d-%m-%Y:%H:%M:%S)] $site is not reachable." | slackpost.sh
fi
done < /path/to/file/sites.txt # list of sites to check

sites.txt example

website1.com
website2.com

Now you can add it to crontab. Type crontab -e and insert:

# ping websites every minute
* * * * * /path/to/monitor-websites.sh > /dev/null

The script use my notification function to slack. This tutorial you can find at [Tutorial] send message with linux to slack

Example of message in slack if website is offline:

slack post message example
slack post message example