Nick Karnik

Twitter


Nick Karnik


Dovecot IMAP Authorization Slow

My dovecot is setup to authenticate users from MySQL. However, the process was taking about 4 seconds and I kept wondering what the issue was for a while. Finally, I took some time to dig into it and here is what I discovered: PAM was enabled, which is something I…

Nick KarnikNick Karnik

ERRNO::EPIPE -> Broken Pipe

Have you ever encountered a ‘Broken Pipe’ error? It happens when MySQL closes the open connection after 8 hours (By default) or upon restarting MySQL. I tried various solutions (None of these worked): ActiveRecord::Base.verification_timeout = 14400 Stale database connections should be handled gracefully Irc.freenode.net – #RubyOnRails (Totally…

Nick KarnikNick Karnik

Installing MySQL Extensions for Ruby

When I tried ‘gem install mysql’, I got the following error:ruby extconf.rb install mysql checking for mysql_query() in -lmysqlclient… no checking for main() in -lm… yes checking for mysql_query() in -lmysqlclient… no checking for main() in -lz… yes checking for mysql_query() in -lmysqlclient… no checking…

Nick KarnikNick Karnik

Deleting a mail using IMAP

imap = Net::IMAP.new(‘IP’) imap.login(‘username’, ‘password’) imap.select(‘INBOX’) if not imap.list(”, ‘TRASH’) #Create a TRASH Folder if it doesn’t exist imap.create(‘TRASH’) end imap.copy(message_id, “TRASH”) #copy the message to the TRASH imap.store(message_id, “+FLAGS”, [:Deleted]) #Mark Deleted in…

Nick KarnikNick Karnik