Friday, January 10, 2014

Installing Imapfilter

I installed Imapfilter to sort mails on the imap server ( I connect to into folder (The server does not support Sieve (and managesieve or sieverules plugins for Roundcube), which is an alternative that does not require a running program).

Here is how:

* Download imapfilter from github:
unzip -d
cd imapfilter-master/src
sudo apt-get install libssl-dev
sudo apt-get install lua5.1-dev
* Edit imapfilter.h, core.c, lua.c, pcre.c, and system.c and add lua5.1/ before lua.h, lualib.h, and lauxlib.h
sudo apt-get install libpcre3-dev
* Update Makefile to say -llua5.1 instead of -llua
make all
sudo make install

Errors I got:
auth.c:4:11: fatal error: openssl/hmac.h: No such file or directory

lua.c:5:17: fatal error: lua.h: No such file or directory
compilation terminated.
make: *** [lua.o] Error 1

pcre.c:7:18: fatal error: pcre.h: No such file or directory

cc -o imapfilter   auth.o buffer.o cert.o core.o file.o imapfilter.o list.o log.o lua.o memory.o misc.o namespace.o pcre.o regexp.o request.o response.o session.o signal.o socket.o system.o -lm -llua -lpcre -lssl -lcrypto
/usr/bin/ld: cannot find -llua
collect2: ld returned 1 exit status
make: *** [imapfilter] Error 1

All fixed by the above procedure.

Sunday, January 5, 2014

Roundcube Webmail with Domeneshop

I just set up Roundcube to fetch emails from my Domeneshop mail server and had some trouble getting it to work.
Under step 3 of the Roundcube Webmail Installer I was checking that send and receive email worked correctly and got errors. Here is the settings I used and the corresponding error I got:

Port: 587

Error: SMTP send:  NOT OK(Connection failed: HELO was not accepted: )

Server: ssl://
Port: 587

SMTP send:  NOT OK(Connection failed: Failed to connect socket: fsockopen(): unable to connect to ssl:// (Unknown error))

Server: tls://
Port: 587

SMTP send:  NOT OK(Connection failed: HELO was not accepted: )

I discovered, after reading through the options of, that you could set host for HELO. This is usually the mail servers domain (e.g. if you have an email address using your email servers domain (e.g. But, I have my email using my own domain so setting it to:

$rcmail_config['smtp_helo_host'] = '';

Solved my problem. :)