Posts tagged ‘mail’

Small shell script to check webserver availability

With the following shell script we will:

1. By every 5 minutes will be checked if the w3m is getting the “200 OK” output.

2. If yes, then the script stops.

3. If no, then the command mail sends an email message warning the administrator about this issue.

4. The “/root/mailmsg.txt” file is where your customized warning message will be. You can certainly place it anywhere else if you wish so.

So, where’s the beef? Here it is, add the following code to your crontab (or write a separate file and point it in your crontab):

 */5 * * * * w3m -dump_head my-hi.com | grep -q '200 OK' || echo 'Your website is down' | mail -s 'Your website is down' admin@domainxyz.com < /root/mailmsg.txt 

 

Dovecot migration error

We migrated IMAP servers at work and for some reason I was the only one that was affected by a small problem. I couldn’t get my email! The error that would show in the maillog was:

dovecot: IMAP(user): FETCH for mailbox INBOX UID 176705 failed to read message input: Is a directory
dovecot: IMAP(user): Disconnected: BUG: Unknown internal error bytes=473/4475

After looking at several things I eventually saw that my cur directory had some subdirecties named like emails. They were empty, so I went ahead and deleted it and that fixed it!

Just thought I’d let other people know since it’s one of those things that Googling didn’t really give any answers. (Imagine that!)

 

Source: http://notjustlinux.blogspot.com/2009/05/dovecot-migration-error.html