Archive for freebsd

FreeBSD Install BASH Shell – Instalar shell como padrão do usuário no freebsd

freebsd_logo_sm

in BASH Shell, FreeBSD, Package Management

I’d like to Bash shell under FreeBSD for bash programming. How do I install bash shell under FreeBSD UNIX operating system?

Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. csh / tcsh (C shell with file name completion and command line editing) is the default shell under FreeBSD. However, you can easily install and use bash as shell.
Install bash under FreeBSD

Login as root and type the following commands to install bash using FreeBSD ports:
# portsnap update extract
# cd /usr/ports/shells/bash
# make install clean

To install FreeBSD binary package, enter:
# pkg_add -r bash
How do I use bash under FreeBSD?

To use bash shell, enter:
# bash
OR
# /usr/local/bin/bash
How do I set bash as a default shell?

To set bash as default, shell enter:
# chsh -s /usr/local/bin/bash {username}
# chsh -s bash

Verify that bash is default shell for a user account called vivek, enter:
grep {username} /etc/passwd

OR

egrep –color ‘{username}|zsh’ /etc/passwd

OR
finger {username}

Script criado para auxiliar na manipulação do qmail no freebsd!

qmail

Script criado para auxiliar na manipulação do qmail no freebsd!

[root@netuno ~]# cat /usr/local/bin/qmail-adm.sh
#!/bin/sh

dominio=”@i-hunter.net”

main()
{
clear
echo “======= Gerenciamento auxiliar do MTA QMAIL =======”
echo “===================================================”
echo “Opcoes:”
echo
echo “1 – Listar todas as mensagens na fila.”
echo “2 – Listar todas as mensagens na fila Remota.”
echo “3 – Listar todas as mensagens na fila Local.”
echo “4 – Mostrar STATUS das filas do Qmail.”
echo “5 – Ver o conteudo de uma mensagem especifica.”
echo “6 – Apagar uma mensagem especifica da fila.”
echo “7 – Apagar mensagens com um Assunto (Subject: ) especifico.”
echo “8 – Apagar mensagens com Remetente (From: ) especifico.”
echo “9 – Apagar mensagens com Destinario (To: ) especifico.”
echo “10 – Apagar TODAS as mensagens das filas do Qmail.”
echo “11 – Sair.”
echo “15 – Avancado.”
echo -n “Qual opcao voce deseja? ”
read opcao
case $opcao in
1) listar_todas ;;
2) listar_r ;;
3) listar_l ;;
4) status ;;
5) ver_msg ;;
6) apaga_msg ;;
7) subject ;;
8) from ;;
9) to ;;
10) apagar_todas ;;
11) exit ;;
15) menu_avancado ;;
*) echo “Opcao desconhecida.” ; echo ; main ;;
esac
}

###### funcoes auxiliares

restart_qmail()
{
svc -k /service/qmail
svc -u /service/qmail
}

status ()
{
echo “”
echo “Status atual do Qmail: ”
echo “”
sleep 2
fila-qmail -s
echo “”
/var/qmail/bin/qmail-qstat
echo “”
svstat /service/qmail
echo “”
}

remotas_locais()
{
echo “”
echo -n ” Mensagens Remotas ou Locais? [R/L]: ”
read ROL

case ${ROL} in
[Rr])
ROLRESP=”R”
;;
[Ll])
ROLRESP=”L”
;;
*)
remotas_locais
;;
esac
}

#### funcoes principais

listar_todas()
{
echo “”
echo “Listando as mensagens nas filas Remota e Local: ”
fila-qmail -l
echo “”
}

listar_r()
{
echo””
echo “Listando as mensagens na fila Remota: ”
fila-qmail -R
echo “”
}

listar_l()
{
echo “”
echo “Listando as mensagens na fila Local: ”
fila-qmail -L
echo “”
}

ver_msg()
{
echo “”
echo ” O numero de Identificacao da mensagem – Msg ID – pode ser”
echo “identificado como o primeiro numero que precede um email,”
echo “quando as mensagens nas filas sao listadas.”
echo “”
echo ” Por exemplo:”
echo ” 762178 [14, R] – O primeiro numero, fora dos parenteses,”
echo ” indica o numero da mensagem. Nesse caso, 762178.”
echo “”
echo -n ” Deseja visualizar o conteudo da mensagem numero: ”
read NROMSG

echo “”
fila-qmail -v${NROMSG} | less

}

apaga_msg()
{
echo “”
echo ” O numero de Identificacao da mensagem – Msg ID – pode ser”
echo “identificado como o primeiro numero que precede um email,”
echo “quando as mensagens nas filas sao listadas.”
echo “”
echo ” Por exemplo:”
echo ” 762178 [14, R] – O primeiro numero, fora dos parenteses,”
echo ” indica o numero da mensagem. Nesse caso, 762178.”
echo “”
echo -n ” Deseja apagar qual mensagem da fila? ”
read NROMSG

fila-qmail -d${NROMSG}

restart_qmail
status

}

subject()
{
echo “”
echo ” Para maior praticidade, a pesquisa sera Case Insensitive,”
echo “nao diferenciando letras maiusculas de letras minusculas.”
echo “”
echo -n ” Deseja apagar todas as mensagens com qual Assunto [Subject: ] ”
read ASSUNTO

remotas_locais

fila-qmail -c -l | \
grep -i -B 4 “${ASSUNTO}” | \
grep “, ${ROLRESP}” | awk ‘{print “echo \”Apagando mensagem “$1″\” ; ” “fila-qmail -d”$1}’ > /tmp/XyZkPPty

sh /tmp/XyZkPPty
COUNT=”`cat /tmp/XyZkPPty | wc -l`”
rm -f /tmp/XyZkPPty

echo “”
echo ” Foram apagadas ${COUNT} mensagens que continham”
echo “a expressao ‘${ASSUNTO}’ como parte do Assunto…”
echo “”
echo “Reiniciando o Qmail…”

restart_qmail
status
}

from()
{
echo “”
echo ” Para maior praticidade, a pesquisa sera Case Insensitive,”
echo “nao diferenciando letras maiusculas de letras minusculas.”
echo “”
echo -n ” Deseja apagar todas as mensagens de qual Remetente [From: ] ”
read FROM

remotas_locais

fila-qmail -c -l | \
grep -i -B 2 “${FROM}” | \
grep “, ${ROLRESP}” | awk ‘{print “echo \”Apagando mensagem “$1″\” ; ” “fila-qmail -d”$1}’ > /tmp/XyZkPPty

sh /tmp/XyZkPPty
COUNT=”`cat /tmp/XyZkPPty | wc -l`”
rm -f /tmp/XyZkPPty

echo “”
echo ” Foram apagadas ${COUNT} mensagens que continham”
echo “a expressao ‘${FROM}’ como parte do endereco do Remetente…”
echo “”
echo “Reiniciando o Qmail…”

restart_qmail
status
}

to()
{
echo “”
echo ” Para maior praticidade, a pesquisa sera Case Insensitive,”
echo “nao diferenciando letras maiusculas de letras minusculas.”
echo “”
echo -n ” Deseja apagar todas as mensagens de qual Destinatario [To: ] ”
read TO

remotas_locais

fila-qmail -c -l | \
grep -i -B 3 “${TO}” | \
grep “, ${ROLRESP}” | awk ‘{print “echo \”Apagando mensagem “$1″\” ; ” “fila-qmail -d”$1}’ > /tmp/XyZkPPty

sh /tmp/XyZkPPty
COUNT=”`cat /tmp/XyZkPPty | wc -l`”
rm -f /tmp/XyZkPPty

echo “”
echo ” Foram apagadas ${COUNT} mensagens que continham”
echo “a expressao ‘${TO}’ como parte do endereco do Remetente…”
echo “”
echo “Reiniciando o Qmail…”

restart_qmail
status
}

apagar_todas()
{
echo “”
echo ” Todas as mensagens de todas as filas do QMail serao apagadas.”
echo “”
echo -n ” Deseja mesmo continuar? [S/N] ”

read SIMNAO

case ${SIMNAO} in
[Ss])

fila-qmail -D && \
restart_qmail && \
status
;;

*)
echo “”
echo “Saindo…”
;;
esac

}

virus_dat_version() {
echo “”
/usr/local/bin/uvscan –version | grep -v “EVALUATION”
echo “”
}

############## Menu Avancado ###############
## Nao tem nada de Avancado mas nao deve ##
## ser usado por quem nao sabe como ele ##
## funciona… enfim, leiam as man pages ##
## do svc, do svscan, svstat e o resto do ##
## Daemontools inteiro… ##
############################################

menu_avancado()
{
clear
echo “===== Controle dos servicos de e-mail =====”
echo “”
echo “Servico qmail-send [modulo nivel 1]:”
echo “”
echo “01 – Matar o qmail-send.”
echo “02 – Iniciar o qmail-send.”
echo “03 – Reprocessar as filas de email.”
echo “04 – STATUS do qmail-send e das filas de e-mail.”
echo “05 – Reiniciar o Qmail [qmail-send].”
echo “06 – Verificar os logs do qmail-send.”
echo “07 – Verificar os logs do qmail-queue.”
echo “”
echo “”
echo “Servico Qmail SMTP:”
echo “10 – Matar o daemon SMTP.”
echo “11 – Iniciar o daemon SMTP.”
echo “12 – STATUS do daemon SMTP.”
echo “13 – Reiniciar o daemon SMTP.”
echo “14 – Verificar os logs do SMTP.”
echo “”
echo “”
echo “Servico Qmail POP3:”
echo “20 – Matar o daemon POP3.”
echo “21 – Iniciar o daemon POP3.”
echo “22 – STATUS do daemon POP3.”
echo “23 – Reiniciar o daemon POP3.”
echo “24 – Verificar os logs do POP3.”
echo “”
echo “”
echo “Anti Virus:”
echo “30 – Logs dos ultimos virus encontrados.”
echo “31 – Logs do qmail-queue junto ao antivirus.”
echo “32 – Apagar todas as mensagens com virus do Quarantine.”
echo “33 – Apagar todas as mensagens com virus verificadas agora.”
echo “34 – Contar virus encontrados.”
echo “35 – Mostrar as definicoes (dat-version) de virus atuais.”
echo “”
echo “”
echo “Servico Courier-IMAP:”
echo “36 – Para o servico IMAP (caso instalado).”
echo “37 – Inicia o servico IMAP (caso instalado).”
echo “38 – Verificar os logs do IMAP (caso instalado).”
echo “”
echo “”
echo “50 – Sair.”
echo -n “Qual opcao voce deseja? ”
read opctao
case $opctao in
01) kill_qsend ;;
02) up_qsend ;;
03) alrm_queue ;;
04) status ;;
05) qmailrestart ;;
06) qsend_logs ;;
07) queue_logs ;;
10) kill_smtp ;;
11) up_smtp ;;
12) status_smtp ;;
13) restart_smtp ;;
14) qsmtp_logs ;;
20) kill_pop3 ;;
21) up_pop3 ;;
22) status_pop3 ;;
23) restart_pop3 ;;
24) qpop3_logs ;;
30) virus_log ;;
31) queue_logs ;;
32) rm_quarantine ;;
33) rm_working ;;
34) virus_count ;;
35) virus_dat_version ;;
36) stop_imapd ;;
37) start_imapd ;;
38) vlogs_imapd ;;
50) exit ;;
*) echo “Opcao desconhecida.” ; echo ; main ;;
esac
}

kill_qsend()
{
echo “”
echo -n ” Matando o Qmail [qmail-send]…”
svc -k /service/qmail
echo ” OK”
echo “”
exit
}

up_qsend()
{
echo “”
echo “Iniciando o Qmail [qmail-send]…”
svc -u /service/qmail
echo ” O qmail-send foi iniciado e esta supervisionado.”
echo “”
exit
}

alrm_queue()
{
echo “”
echo ” Reprocessando todas as mensagens nas filas Locais e Remotas”
svc -a /service/qmail
echo ” Pronto.”
exit
}

qmailrestart()
{
echo “”
echo -n ” Forcando a reinicializacao do Qmail… ”
restart_qmail
echo “OK”
echo “”
echo ” O Qmail foi reiniciado e deve estar no ar,”.
echo ” verifique o status do MTA:”
status
exit
}

qsend_logs()
{
echo “”
echo -n ” Quantas linhas de log do Qmail voce deseja analisar? ”
read linhaslog
echo “”
echo ” Analisando as ultimas ${linhaslog} linhas dos logs do qmail: ”
echo “”
tail -${linhaslog} /var/log/qmail/current
exit
}

queue_logs()
{
echo “”
echo -n ” Quantas linhas de log do qmail-queue voce deseja analisar? ”
read logqueue
echo “”
echo ” Analisando as ultimas ${logqueue} linhas dos logs do qmail-queue: ”
echo “”
tail -${logqueue} /var/spool/qmailscan/qmail-queue.log
exit
}

kill_smtp()
{
echo “”
echo -n ” Matando o Qmail SMTP [qmail-smtpd]…”
svc -k /service/smtpd
echo ” OK”
echo “”
exit
}

up_smtp()
{
echo “”
echo “Iniciando o Qmail SMTP [qmail-smtpd]…”
svc -u /service/smtpd
echo ” O qmail-smtpd foi iniciado e esta sendo supervisionado.”
echo “”
exit
}

status_smtp()
{
echo “”
echo ” Status do daemon SMTP [qmail-smtpd]: ”
svstat /service/smtpd
exit
}

restart_smtp()
{
echo “”
echo ” Forcando a reinicializacao do daemon SMTP [qmail-smtpd]… ”
kill_smtp
up_smtp
}

qsmtp_logs()
{
echo “”
echo -n ” Quantas linhas de logs do qmail-smtpd voce deseja analisar? ”
read smtplogs
echo ” Analisando as ultimas ${smtplogs} linhas de logs do qmail-smtpd: ”
echo “”
tail -${smtplogs} /service/smtpd/log/main/current
exit
}

kill_pop3()
{
echo “”
echo -n ” Matando o Qmail POP3 [qmail-pop3d]…”
svc -k /service/pop3d
echo ” OK”
echo “”
exit
}

up_pop3()
{
echo “”
echo “Iniciando o Qmail POP3 [qmail-pop3d]…”
svc -u /service/pop3d
echo ” O qmail-pop3d foi iniciado e esta sendo supervisionado.”
echo “”
exit
}

status_pop3()
{
echo “”
echo ” Status do daemon POP3 [qmail-pop3d]: ”
svstat /service/pop3d
exit
}

restart_pop3()
{
echo “”
echo “Forcando a reinicializacao do daemon POP3 [qmail-pop3d]… ”
kill_pop3
up_pop3
}

qpop3_logs()
{
echo “”
echo -n ” Quantas linhas de logs do qmail-pop3d voce deseja analisar? ”
read pop3logs
echo ” Analisando as ultimas ${pop3logs} linhas de logs do qmail-pop3d: ”
echo “”
tail -${pop3logs} /service/pop3d/log/main/current
exit
}

virus_log()
{
echo “”
echo -n ” Quantas linhas de logs de virus encontrados voce deseja analisar? ”
read viruslog
echo ” Analisando as ultimas ${viruslog} linhas de logs sobre virus encontrados:”
echo “”
tail -${viruslog} /var/spool/qmailscan/viruses.log
exit
}

rm_quarantine()
{
echo “”
echo ” Apagando todos os emails armazenados em quarentena… ”
find /var/spool/qmailscan/quarantine/ -name “*${dominio}*” -exec rm -f {} \;
echo ” Apagados!”
exit
}

rm_working()
{
echo “”
echo ” Apagando todas as mensagens verificadas por virus ha pouco…”
find /var/spool/qmailscan/working/ -name “*${dominio}*” -exec rm -f {} \;
echo ” Apagados!”
exit
}

virus_count()
{
echo “”
echo ” Total de virus interceptados segundo os logs recentes: ”
cat /var/spool/qmailscan/viruses.log | grep uvscan | wc -l
echo ” Virus!”
exit
}

stop_imapd()
{
echo “”
if [ -x /usr/local/etc/rc.d/imapd.sh ]; then
echo -n “Parando Courier-IMAP…”
/usr/local/etc/rc.d/imapd.sh stop
echo ” OK”
else
echo “O courier-imap nao parece estar corretamente”
echo “configurado via ports… Saindo.”
fi
echo “”
exit
}

start_imapd()
{
echo “”
if [ -x /usr/local/etc/rc.d/imapd.sh ]; then
echo -n “Iniciando Courier-IMAP…”
/usr/local/etc/rc.d/imapd.sh start
echo ” OK”
else
echo “O courier-imap nao parece estar corretamente”
echo “configurado via ports… Saindo.”
fi
echo “”
exit
}

vlogs_imapd()
{
echo “”
echo -n ” Quantas linhas de logs do courier-imap voce deseja analisar? ”
read imaplog
echo ” Analisando as ultimas ${imaplog} linhas de logs do courier-imap:”
echo “”
grep -i “imapd:” -C1 /var/log/maillog | tail -${imaplog}
echo “”
exit
}

# Inicia esse programa em shell
main

Atualizando RoundCube Freebsd – Instalando PluginManager

roundcube_logo

Verificando a versão do roundcube atual
pkg_info -Ix roundcube
pkg_info -R roundcube”*”

Atualizar o ports
portsnap fetch
portsnap update

Iremos instalar algumas aplicações necessárias ao funcionamento visual de novas versões do roundcube
pkg_add -rv perl (ou instale do ports)

cd /usr/ports/ftp/curl/
make install clean

cd /usr/ports/ftp/php5-curl
make install clean

cd /usr/ports/lang/php5-extensions/
make config

cd /usr/ports/www/pecl-APC/ && make install
(instalar padrão)

cd /usr/ports/lang/php5
make config
options_for_php5_5_3_8_fit_content_width1
make install clean

cd /usr/ports/lang/php5-extensions
make config
options_for_php5_extensions_1_6_fit_content_width
make install clean

cd /usr/ports/graphics/php5-gd
make install clean

Pode-se visualizar as instalações posteriormente:
find /usr/ports -type d -iname “php5-*”

Realize um backup do que possui no momento:
cp -r /usr/local/www/roundcube /usr/local/www/roundcube.01-09-2014
mysqldump -u root -pSENHA rcube > /usr/local/www/roundcube.01-09-2014/backup_banco.sql

cd /usr/ports/mail/roundcube
make install clean

Aumentando o tamanho do upload
No arquivo php.ini
apc.rfc1867 = on
post_max_size = 20M
upload_max_filesize = 15M
max_file_uploads = 300

Verificar se o limite esta .htaccess dentro do diretório roundcube ou se esta dentro do apache (como no meu caso).
/usr/local/etc/apache22/httpd.conf
php_value upload_max_filesize 10M
php_value post_max_size 20M
php_value memory_limit 128M

Instalação do pluginManager

Baixar o plugin Manager no site oficial do roundcube:

https://myroundcube.com/myroundcube-plugins/plugin-manager

Ativa-lo e destivar todos os demais plugins:
vim /usr/local/www/roundcube/config/main.inc.php
$rcmail_config[‘plugins’] = array(‘plugin_manager’);

Envia-lo descompactado junto aos outros plugins disponíveis neste .zip baixado para o diretório roundcube/plugins.

No primeiro acesso vá em configurações e após em GERENCIAR PLUGINS –> CONFIGURAÇÕES.
Irá aparecer uma chave na qual você deverá criar um arquivo com o nome desta na raiz do roundcube a fim de autorizar este usuário.

touch /usr/local/www/roundcube/esloqh4uin7u1il790cpiail87.myrc

Após criada poderá prosseguir.

Em momentos poderá ser solicitado o aceite para criar tabelas do pluginmanager ou demais plugins. Sempre terá que aceitar.
Após ativar o plugin e relogar no roundcube ele sempre irá perguntar sobre a aceitação da inserção da tabela (caso o plugin tenha necessidade como o Calendário, exemplo abaixo):
Imagem 33

Após feito toda a habilitação do plugin_manager, tudo deverá ser configurado por ele, até mesmo os plugins antigos.

Tutorial Completo PLUGIN_MANAGER:

Meu banco rcube

create database rcube;
use rcube;

SET SQL_MODE=”NO_AUTO_VALUE_ON_ZERO”;
SET time_zone = “+00:00″;

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

DROP TABLE IF EXISTS `cache`;
CREATE TABLE IF NOT EXISTS `cache` (
`cache_key` varchar(128) character set ascii NOT NULL,
`created` datetime NOT NULL default ‘1000-01-01 00:00:00′,
`data` longtext NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`expires` datetime default NULL,
KEY `user_cache_index` (`user_id`,`cache_key`),
KEY `expires_index` (`expires`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

— ——————————————————–


— Estrutura da tabela `cache_index`

DROP TABLE IF EXISTS `cache_index`;
CREATE TABLE IF NOT EXISTS `cache_index` (
`user_id` int(10) unsigned NOT NULL,
`mailbox` varchar(255) character set utf8 collate utf8_bin NOT NULL,
`valid` tinyint(1) NOT NULL default ‘0’,
`data` longtext NOT NULL,
`expires` datetime default NULL,
PRIMARY KEY (`user_id`,`mailbox`),
KEY `expires_index` (`expires`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

— ——————————————————–


— Estrutura da tabela `cache_messages`

DROP TABLE IF EXISTS `cache_messages`;
CREATE TABLE IF NOT EXISTS `cache_messages` (
`user_id` int(10) unsigned NOT NULL,
`mailbox` varchar(255) character set utf8 collate utf8_bin NOT NULL,
`uid` int(11) unsigned NOT NULL default ‘0’,
`data` longtext NOT NULL,
`flags` int(11) NOT NULL default ‘0’,
`expires` datetime default NULL,
PRIMARY KEY (`user_id`,`mailbox`,`uid`),
KEY `expires_index` (`expires`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

— ——————————————————–


— Estrutura da tabela `cache_shared`

DROP TABLE IF EXISTS `cache_shared`;
CREATE TABLE IF NOT EXISTS `cache_shared` (
`cache_key` varchar(255) character set ascii NOT NULL,
`created` datetime NOT NULL default ‘1000-01-01 00:00:00′,
`data` longtext NOT NULL,
`expires` datetime default NULL,
KEY `cache_key_index` (`cache_key`),
KEY `expires_index` (`expires`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

— ——————————————————–


— Estrutura da tabela `cache_thread`

DROP TABLE IF EXISTS `cache_thread`;
CREATE TABLE IF NOT EXISTS `cache_thread` (
`user_id` int(10) unsigned NOT NULL,
`mailbox` varchar(255) character set utf8 collate utf8_bin NOT NULL,
`data` longtext NOT NULL,
`expires` datetime default NULL,
PRIMARY KEY (`user_id`,`mailbox`),
KEY `expires_index` (`expires`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

— ——————————————————–


— Estrutura da tabela `carddav_contactgroupmembers`

DROP TABLE IF EXISTS `carddav_contactgroupmembers`;
CREATE TABLE IF NOT EXISTS `carddav_contactgroupmembers` (
`contactgroup_id` int(10) unsigned NOT NULL,
`contact_id` int(10) unsigned NOT NULL,
`created` datetime NOT NULL default ‘1000-01-01 00:00:00′,
PRIMARY KEY (`contactgroup_id`,`contact_id`),
KEY `carddav_contactgroupmembers_contact_index` (`contact_id`),
KEY `contact_id` (`contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

— ——————————————————–


— Estrutura da tabela `carddav_contactgroups`

DROP TABLE IF EXISTS `carddav_contactgroups`;
CREATE TABLE IF NOT EXISTS `carddav_contactgroups` (
`contactgroup_id` int(10) unsigned NOT NULL auto_increment,
`user_id` int(10) unsigned NOT NULL,
`changed` datetime NOT NULL default ‘1000-01-01 00:00:00′,
`del` tinyint(1) NOT NULL default ‘0’,
`name` varchar(128) NOT NULL default ”,
`addressbook` int(10) unsigned default NULL,
PRIMARY KEY (`contactgroup_id`),
KEY `carddav_contactgroups_user_index` (`user_id`,`del`),
KEY `addressbook` (`addressbook`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

— ——————————————————–


— Estrutura da tabela `carddav_contacts`

DROP TABLE IF EXISTS `carddav_contacts`;
CREATE TABLE IF NOT EXISTS `carddav_contacts` (
`carddav_contact_id` int(10) unsigned NOT NULL auto_increment,
`carddav_server_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`etag` varchar(255) default NULL,
`last_modified` varchar(128) NOT NULL,
`vcard_id` varchar(255) default NULL,
`vcard` longtext NOT NULL,
`words` text,
`firstname` varchar(128) default NULL,
`surname` varchar(128) default NULL,
`name` varchar(255) default NULL,
`email` varchar(255) default NULL,
PRIMARY KEY (`carddav_contact_id`),
UNIQUE KEY `carddav_server_id` (`carddav_server_id`,`user_id`,`vcard_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

— ——————————————————–


— Estrutura da tabela `carddav_server`

DROP TABLE IF EXISTS `carddav_server`;
CREATE TABLE IF NOT EXISTS `carddav_server` (
`carddav_server_id` int(10) unsigned NOT NULL auto_increment,
`user_id` int(10) unsigned NOT NULL,
`url` varchar(255) collate utf8_unicode_ci NOT NULL,
`username` varchar(128) collate utf8_unicode_ci NOT NULL,
`password` varchar(128) collate utf8_unicode_ci NOT NULL,
`label` varchar(128) collate utf8_unicode_ci NOT NULL,
`read_only` tinyint(1) NOT NULL,
`autocomplete` tinyint(1) NOT NULL default ‘1’,
`idx` int(10) default NULL,
`edt` tinyint(1) default NULL,
`subscribed` tinyint(1) unsigned NOT NULL default ‘1’,
PRIMARY KEY (`carddav_server_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

— ——————————————————–


— Estrutura da tabela `collected_contacts`

DROP TABLE IF EXISTS `collected_contacts`;
CREATE TABLE IF NOT EXISTS `collected_contacts` (
`contact_id` int(10) unsigned NOT NULL auto_increment,
`changed` datetime NOT NULL default ‘1000-01-01 00:00:00′,
`del` tinyint(1) NOT NULL default ‘0’,
`name` varchar(128) character set utf8 collate utf8_unicode_ci NOT NULL default ”,
`email` text character set utf8 collate utf8_unicode_ci NOT NULL,
`firstname` varchar(128) character set utf8 collate utf8_unicode_ci NOT NULL default ”,
`surname` varchar(128) character set utf8 collate utf8_unicode_ci NOT NULL default ”,
`vcard` longtext character set utf8 collate utf8_unicode_ci,
`words` text character set utf8 collate utf8_unicode_ci,
`user_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`contact_id`),
KEY `user_collected_contacts_index` (`user_id`,`del`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=52 ;

— ——————————————————–


— Estrutura da tabela `contactgroupmembers`

DROP TABLE IF EXISTS `contactgroupmembers`;
CREATE TABLE IF NOT EXISTS `contactgroupmembers` (
`contactgroup_id` int(10) unsigned NOT NULL,
`contact_id` int(10) unsigned NOT NULL,
`created` datetime NOT NULL default ‘1000-01-01 00:00:00′,
PRIMARY KEY (`contactgroup_id`,`contact_id`),
KEY `contactgroupmembers_contact_index` (`contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

— ——————————————————–


— Estrutura da tabela `contactgroups`

DROP TABLE IF EXISTS `contactgroups`;
CREATE TABLE IF NOT EXISTS `contactgroups` (
`contactgroup_id` int(10) unsigned NOT NULL auto_increment,
`user_id` int(10) unsigned NOT NULL,
`changed` datetime NOT NULL default ‘1000-01-01 00:00:00′,
`del` tinyint(1) NOT NULL default ‘0’,
`name` varchar(128) NOT NULL default ”,
PRIMARY KEY (`contactgroup_id`),
KEY `contactgroups_user_index` (`user_id`,`del`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

— ——————————————————–


— Estrutura da tabela `contacts`

DROP TABLE IF EXISTS `contacts`;
CREATE TABLE IF NOT EXISTS `contacts` (
`contact_id` int(10) unsigned NOT NULL auto_increment,
`changed` datetime NOT NULL default ‘1000-01-01 00:00:00′,
`del` tinyint(1) NOT NULL default ‘0’,
`name` varchar(128) NOT NULL default ”,
`email` text NOT NULL,
`firstname` varchar(128) NOT NULL default ”,
`surname` varchar(128) NOT NULL default ”,
`vcard` longtext,
`words` text,
`user_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`contact_id`),
KEY `user_contacts_index` (`user_id`,`del`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=517 ;

— ——————————————————–


— Estrutura da tabela `db_config`

DROP TABLE IF EXISTS `db_config`;
CREATE TABLE IF NOT EXISTS `db_config` (
`id` int(11) NOT NULL auto_increment,
`env` varchar(255) character set latin1 NOT NULL,
`conf` longtext character set latin1 NOT NULL,
`admin` varchar(128) character set latin1 NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

— ——————————————————–


— Estrutura da tabela `dictionary`

DROP TABLE IF EXISTS `dictionary`;
CREATE TABLE IF NOT EXISTS `dictionary` (
`user_id` int(10) unsigned default NULL,
`language` varchar(5) NOT NULL,
`data` longtext NOT NULL,
UNIQUE KEY `uniqueness` (`user_id`,`language`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

— ——————————————————–


— Estrutura da tabela `events`

DROP TABLE IF EXISTS `events`;
CREATE TABLE IF NOT EXISTS `events` (
`event_id` int(11) unsigned NOT NULL auto_increment,
`component` varchar(6) NOT NULL default ‘vevent’,
`uid` text,
`priority` int(1) NOT NULL default ‘0’,
`recurrence_id` int(10) default NULL,
`exdates` text,
`user_id` int(10) unsigned NOT NULL default ‘0’,
`start` int(11) NOT NULL default ‘0’,
`end` int(11) NOT NULL default ‘0’,
`due` int(11) NOT NULL default ‘0’,
`complete` int(3) NOT NULL default ‘0’,
`expires` int(11) NOT NULL default ‘0’,
`tzname` varchar(255) default ‘UTC’,
`rr` varchar(1) default NULL,
`recurring` text NOT NULL,
`occurrences` int(11) default ‘0’,
`byday` text,
`bymonth` text,
`bymonthday` text,
`summary` varchar(255) NOT NULL,
`description` text NOT NULL,
`location` varchar(255) NOT NULL default ”,
`categories` varchar(255) NOT NULL default ”,
`labels` varchar(255) NOT NULL default ”,
`created` datetime default NULL,
`modified` datetime default NULL,
`caldav` text,
`url` text,
`status` varchar(25) default NULL,
`organizer` varchar(255) default NULL,
`attendees` varchar(255) default NULL,
`timestamp` timestamp NULL default CURRENT_TIMESTAMP,
`del` int(1) NOT NULL default ‘0’,
`reminder` int(10) default NULL,
`reminderservice` text,
`remindermailto` text,
`remindersent` int(10) default NULL,
`notified` int(1) NOT NULL default ‘0’,
`client` text,
PRIMARY KEY (`event_id`),
KEY `user_id_fk_events` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

— ——————————————————–


— Estrutura da tabela `events_cache`

DROP TABLE IF EXISTS `events_cache`;
CREATE TABLE IF NOT EXISTS `events_cache` (
`event_id` int(11) unsigned NOT NULL auto_increment,
`component` varchar(6) collate utf8_unicode_ci NOT NULL default ‘vevent’,
`uid` text character set utf8,
`priority` int(1) NOT NULL default ‘0’,
`recurrence_id` int(10) default NULL,
`exdates` text character set utf8,
`user_id` int(10) unsigned NOT NULL default ‘0’,
`start` int(11) NOT NULL default ‘0’,
`end` int(11) NOT NULL default ‘0’,
`due` int(11) NOT NULL default ‘0’,
`complete` int(3) NOT NULL default ‘0’,
`expires` int(11) NOT NULL default ‘0’,
`tzname` varchar(255) collate utf8_unicode_ci default ‘UTC’,
`rr` varchar(1) character set utf8 default NULL,
`recurring` text character set utf8 NOT NULL,
`occurrences` int(11) default ‘0’,
`byday` text character set utf8,
`bymonth` text character set utf8,
`bymonthday` text character set utf8,
`summary` varchar(255) character set utf8 NOT NULL,
`description` text character set utf8 NOT NULL,
`location` varchar(255) character set utf8 NOT NULL default ”,
`categories` varchar(255) character set utf8 NOT NULL default ”,
`labels` varchar(255) collate utf8_unicode_ci NOT NULL default ”,
`created` datetime default NULL,
`modified` datetime default NULL,
`caldav` text character set utf8,
`url` text collate utf8_unicode_ci,
`status` varchar(25) collate utf8_unicode_ci default NULL,
`organizer` varchar(255) collate utf8_unicode_ci default NULL,
`attendees` varchar(255) collate utf8_unicode_ci default NULL,
`timestamp` timestamp NULL default CURRENT_TIMESTAMP,
`del` int(1) NOT NULL default ‘0’,
`reminder` int(10) default NULL,
`reminderservice` text character set utf8,
`remindermailto` text character set utf8,
`remindersent` int(10) default NULL,
`notified` int(1) NOT NULL default ‘0’,
`client` text character set utf8,
PRIMARY KEY (`event_id`),
KEY `user_id_fk_events_cache` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

— ——————————————————–


— Estrutura da tabela `events_caldav`

DROP TABLE IF EXISTS `events_caldav`;
CREATE TABLE IF NOT EXISTS `events_caldav` (
`event_id` int(11) unsigned NOT NULL auto_increment,
`component` varchar(6) NOT NULL default ‘vevent’,
`uid` text,
`priority` int(1) NOT NULL default ‘0’,
`recurrence_id` int(10) default NULL,
`exdates` text,
`user_id` int(10) unsigned NOT NULL default ‘0’,
`start` int(11) default ‘0’,
`end` int(11) default ‘0’,
`due` int(11) NOT NULL default ‘0’,
`complete` int(3) NOT NULL default ‘0’,
`expires` int(11) default ‘0’,
`tzname` varchar(255) default ‘UTC’,
`rr` varchar(1) default NULL,
`recurring` text NOT NULL,
`occurrences` int(11) default ‘0’,
`byday` text,
`bymonth` text,
`bymonthday` text,
`summary` varchar(255) NOT NULL,
`description` text NOT NULL,
`location` varchar(255) NOT NULL default ”,
`categories` varchar(255) NOT NULL default ”,
`labels` varchar(255) NOT NULL default ”,
`created` datetime default NULL,
`modified` datetime default NULL,
`caldav` text,
`url` text,
`status` varchar(25) default NULL,
`organizer` varchar(255) default NULL,
`attendees` varchar(255) default NULL,
`timestamp` timestamp NULL default CURRENT_TIMESTAMP,
`del` int(1) NOT NULL default ‘0’,
`reminder` int(10) default NULL,
`reminderservice` text,
`remindermailto` text,
`remindersent` int(10) default NULL,
`notified` int(1) NOT NULL default ‘0’,
`client` text,
PRIMARY KEY (`event_id`),
KEY `user_id_fk_events_caldav` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

— ——————————————————–


— Estrutura da tabela `identities`

DROP TABLE IF EXISTS `identities`;
CREATE TABLE IF NOT EXISTS `identities` (
`identity_id` int(10) unsigned NOT NULL auto_increment,
`user_id` int(10) unsigned NOT NULL,
`changed` datetime NOT NULL default ‘1000-01-01 00:00:00′,
`del` tinyint(1) NOT NULL default ‘0’,
`standard` tinyint(1) NOT NULL default ‘0’,
`name` varchar(128) NOT NULL,
`organization` varchar(128) NOT NULL default ”,
`email` varchar(128) NOT NULL,
`reply-to` varchar(128) NOT NULL default ”,
`bcc` varchar(128) NOT NULL default ”,
`signature` text,
`html_signature` tinyint(1) NOT NULL default ‘0’,
PRIMARY KEY (`identity_id`),
KEY `user_identities_index` (`user_id`,`del`),
KEY `email_identities_index` (`email`,`del`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=141 ;

— ——————————————————–


— Estrutura da tabela `plugin_manager`

DROP TABLE IF EXISTS `plugin_manager`;
CREATE TABLE IF NOT EXISTS `plugin_manager` (
`id` int(10) NOT NULL auto_increment,
`conf` text NOT NULL,
`value` text,
`type` text,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1064 ;

— ——————————————————–


— Estrutura da tabela `reminders`

DROP TABLE IF EXISTS `reminders`;
CREATE TABLE IF NOT EXISTS `reminders` (
`reminder_id` int(10) unsigned NOT NULL auto_increment,
`user_id` int(10) unsigned NOT NULL,
`events` int(10) unsigned default NULL,
`cache` int(10) unsigned default NULL,
`caldav` int(10) unsigned default NULL,
`type` text,
`props` text,
`runtime` int(11) NOT NULL,
PRIMARY KEY (`reminder_id`),
KEY `reminders_ibfk_1` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

— ——————————————————–


— Estrutura da tabela `searches`

DROP TABLE IF EXISTS `searches`;
CREATE TABLE IF NOT EXISTS `searches` (
`search_id` int(10) unsigned NOT NULL auto_increment,
`user_id` int(10) unsigned NOT NULL,
`type` int(3) NOT NULL default ‘0’,
`name` varchar(128) NOT NULL,
`data` text,
PRIMARY KEY (`search_id`),
UNIQUE KEY `uniqueness` (`user_id`,`type`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

— ——————————————————–


— Estrutura da tabela `session`

DROP TABLE IF EXISTS `session`;
CREATE TABLE IF NOT EXISTS `session` (
`sess_id` varchar(128) NOT NULL,
`created` datetime NOT NULL default ‘1000-01-01 00:00:00′,
`changed` datetime NOT NULL default ‘1000-01-01 00:00:00′,
`ip` varchar(40) NOT NULL,
`vars` mediumtext NOT NULL,
PRIMARY KEY (`sess_id`),
KEY `changed_index` (`changed`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

— ——————————————————–


— Estrutura da tabela `system`

DROP TABLE IF EXISTS `system`;
CREATE TABLE IF NOT EXISTS `system` (
`name` varchar(64) NOT NULL,
`value` mediumtext,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

— ——————————————————–


— Estrutura da tabela `users`

DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`user_id` int(10) unsigned NOT NULL auto_increment,
`username` varchar(128) character set utf8 collate utf8_bin NOT NULL,
`mail_host` varchar(128) NOT NULL,
`created` datetime NOT NULL default ‘1000-01-01 00:00:00′,
`last_login` datetime default NULL,
`language` varchar(5) default NULL,
`preferences` longtext,
PRIMARY KEY (`user_id`),
UNIQUE KEY `username` (`username`,`mail_host`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=139 ;


— Constraints for dumped tables


— Limitadores para a tabela `cache`

ALTER TABLE `cache`
ADD CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `cache_index`

ALTER TABLE `cache_index`
ADD CONSTRAINT `user_id_fk_cache_index` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `cache_messages`

ALTER TABLE `cache_messages`
ADD CONSTRAINT `user_id_fk_cache_messages` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `cache_thread`

ALTER TABLE `cache_thread`
ADD CONSTRAINT `user_id_fk_cache_thread` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `carddav_contactgroupmembers`

ALTER TABLE `carddav_contactgroupmembers`
ADD CONSTRAINT `carddav_contactgroupmembers_ibfk_1` FOREIGN KEY (`contactgroup_id`) REFERENCES `carddav_contactgroups` (`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `carddav_contactgroupmembers_ibfk_2` FOREIGN KEY (`contact_id`) REFERENCES `carddav_contacts` (`carddav_contact_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `carddav_contactgroups`

ALTER TABLE `carddav_contactgroups`
ADD CONSTRAINT `carddav_contactgroups_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `carddav_contactgroups_ibfk_2` FOREIGN KEY (`addressbook`) REFERENCES `carddav_server` (`carddav_server_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `carddav_contacts`

ALTER TABLE `carddav_contacts`
ADD CONSTRAINT `carddav_contacts_ibfk_1` FOREIGN KEY (`carddav_server_id`) REFERENCES `carddav_server` (`carddav_server_id`) ON DELETE CASCADE;


— Limitadores para a tabela `carddav_server`

ALTER TABLE `carddav_server`
ADD CONSTRAINT `carddav_server_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE;


— Limitadores para a tabela `collected_contacts`

ALTER TABLE `collected_contacts`
ADD CONSTRAINT `user_id_fk_collected_contacts` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `contactgroupmembers`

ALTER TABLE `contactgroupmembers`
ADD CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`) REFERENCES `contactgroups` (`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `contactgroups`

ALTER TABLE `contactgroups`
ADD CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `contacts`

ALTER TABLE `contacts`
ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `dictionary`

ALTER TABLE `dictionary`
ADD CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `events`

ALTER TABLE `events`
ADD CONSTRAINT `events_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `events_cache`

ALTER TABLE `events_cache`
ADD CONSTRAINT `events_cache_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `events_caldav`

ALTER TABLE `events_caldav`
ADD CONSTRAINT `events_caldav_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `identities`

ALTER TABLE `identities`
ADD CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `reminders`

ALTER TABLE `reminders`
ADD CONSTRAINT `reminders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;


— Limitadores para a tabela `searches`

ALTER TABLE `searches`
ADD CONSTRAINT `user_id_fk_searches` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Posto abaixo meus arquivos:
vim /usr/local/www/roundcube/config/main.inc.php

/sendmail or to syslog
$rcmail_config[‘smtp_log’] = true;

// Log successful logins to /userlogins or to syslog
$rcmail_config[‘log_logins’] = true;

// Log session authentication errors to /session or to syslog
$rcmail_config[‘log_session’] = true;

// Log SQL queries to /sql or to syslog
$rcmail_config[‘sql_debug’] = true;

// Log IMAP conversation to /imap or to syslog
$rcmail_config[‘imap_debug’] = true;

// Log LDAP conversation to /ldap or to syslog
$rcmail_config[‘ldap_debug’] = true;

// Log SMTP conversation to /smtp or to syslog
$rcmail_config[‘smtp_debug’] = true;

// ———————————-
// IMAP
// ———————————-

// The mail host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n – hostname ($_SERVER[‘SERVER_NAME’])
// %t – hostname without the first part
// %d – domain (http hostname $_SERVER[‘HTTP_HOST’] without the first part)
// %s – domain name after the ‘@’ from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
// WARNING: After hostname change update of mail_host column in users table is
// required to match old user data records with the new host.
$rcmail_config[‘default_host’] = ‘127.0.0.1’;

// TCP port used for IMAP connections
$rcmail_config[‘default_port’] = 143;

// IMAP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or null to use
// best server supported one)
$rcmail_config[‘imap_auth_type’] = NULL;

// If you know your imap’s folder delimiter, you can specify it here.
// Otherwise it will be determined automatically
$rcmail_config[‘imap_delimiter’] = NULL;

// If IMAP server doesn’t support NAMESPACE extension, but you’re
// using shared folders or personal root folder is non-empty, you’ll need to
// set these options. All can be strings or arrays of strings.
// Folders need to be ended with directory separator, e.g. “INBOX.”
// (special directory “~” is an exception to this rule)
// These can be used also to overwrite server’s namespaces
$rcmail_config[‘imap_ns_personal’] = NULL;
$rcmail_config[‘imap_ns_other’] = NULL;
$rcmail_config[‘imap_ns_shared’] = NULL;

$rcmail_config[‘imap_root’] = ‘mail';
// By default IMAP capabilities are readed after connection to IMAP server
// In some cases, e.g. when using IMAP proxy, there’s a need to refresh the list
// after login. Set to True if you’ve got this case.
$rcmail_config[‘imap_force_caps’] = false;

// By default list of subscribed folders is determined using LIST-EXTENDED
// extension if available. Some servers (dovecot 1.x) returns wrong results
// for shared namespaces in this case. http://trac.roundcube.net/ticket/1486225
// Enable this option to force LSUB command usage instead.
$rcmail_config[‘imap_force_lsub’] = false;

// Some server configurations (e.g. Courier) doesn’t list folders in all namespaces
// Enable this option to force listing of folders in all namespaces
$rcmail_config[‘imap_force_ns’] = false;

// IMAP connection timeout, in seconds. Default: 0 (no limit)
$rcmail_config[‘imap_timeout’] = 0;

// Optional IMAP authentication identifier to be used as authorization proxy
$rcmail_config[‘imap_auth_cid’] = NULL;

// Optional IMAP authentication password to be used for imap_auth_cid
$rcmail_config[‘imap_auth_pw’] = NULL;

// Type of IMAP indexes cache. Supported values: ‘db’, ‘apc’ and ‘memcache’.
$rcmail_config[‘imap_cache’] = NULL;

// Enables messages cache. Only ‘db’ cache is supported.
$rcmail_config[‘messages_cache’] = false;

// ———————————-
// SMTP
// ———————————-

// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h – user’s IMAP hostname
// %n – hostname ($_SERVER[‘SERVER_NAME’])
// %t – hostname without the first part
// %d – domain (http hostname $_SERVER[‘HTTP_HOST’] without the first part)
// %z – IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$rcmail_config[‘smtp_server’] = ‘127.0.0.1’;

// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$rcmail_config[‘smtp_port’] = 587;

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$rcmail_config[‘smtp_user’] = ‘%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user’s password for login
$rcmail_config[‘smtp_pass’] = ‘%p';

// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$rcmail_config[‘smtp_auth_type’] = ‘LOGIN';

// Optional SMTP authentication identifier to be used as authorization proxy
$rcmail_config[‘smtp_auth_cid’] = NULL;

// Optional SMTP authentication password to be used for smtp_auth_cid
$rcmail_config[‘smtp_auth_pw’] = NULL;

// SMTP HELO host
// Hostname to give to the remote server for SMTP ‘HELO’ or ‘EHLO’ messages
// Leave this blank and you will get the server variable ‘server_name’ or
// localhost if that isn’t defined.
$rcmail_config[‘smtp_helo_host’] = ”;

// SMTP connection timeout, in seconds. Default: 0 (no limit)
// Note: There’s a known issue where using ssl connection with
// timeout > 0 causes connection errors (https://bugs.php.net/bug.php?id=54511)
$rcmail_config[‘smtp_timeout’] = 0;

// ———————————-
// SYSTEM
// ———————————-

// THIS OPTION WILL ALLOW THE INSTALLER TO RUN AND CAN EXPOSE SENSITIVE CONFIG DATA.
// ONLY ENABLE IT IF YOU’RE REALLY SURE WHAT YOU’RE DOING!
$rcmail_config[‘enable_installer’] = true;

// don’t allow these settings to be overriden by the user
$rcmail_config[‘dont_override’] = array();

// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$rcmail_config[‘support_url’] = ”;

// replace Roundcube logo with this image
// specify an URL relative to the document root of this Roundcube installation
$rcmail_config[‘skin_logo’] = NULL;

// automatically create a new Roundcube user when log-in the first time.
// a new user will be created once the IMAP login succeeds.
// set to false if only registered users can use this service
$rcmail_config[‘auto_create_user’] = true;

// Enables possibility to log in using email address from user identities
$rcmail_config[‘user_aliases’] = false;

// use this folder to store log files (must be writeable for apache user)
// This is used by the ‘file’ log driver.
$rcmail_config[‘log_dir’] = ‘logs/';

// use this folder to store temp files (must be writeable for apache user)
$rcmail_config[‘temp_dir’] = ‘temp/';

// lifetime of message cache
// possible units: s, m, h, d, w
$rcmail_config[‘message_cache_lifetime’] = ’10d';

// enforce connections over https
// with this option enabled, all non-secure connections will be redirected.
// set the port for the ssl connection as value of this option if it differs from the default 443
$rcmail_config[‘force_https’] = false;

// tell PHP that it should work as under secure connection
// even if it doesn’t recognize it as secure ($_SERVER[‘HTTPS’] is not set)
// e.g. when you’re running Roundcube behind a https proxy
// this option is mutually exclusive to ‘force_https’ and only either one of them should be set to true.
$rcmail_config[‘use_https’] = false;

// Allow browser-autocompletion on login form.
// 0 – disabled, 1 – username and host only, 2 – username, host, password
$rcmail_config[‘login_autocomplete’] = 2;

// Forces conversion of logins to lower case.
// 0 – disabled, 1 – only domain part, 2 – domain and local part.
// If users authentication is case-insensitive this must be enabled.
// Note: After enabling it all user records need to be updated, e.g. with query:
// UPDATE users SET username = LOWER(username);
$rcmail_config[‘login_lc’] = 0;

// Includes should be interpreted as PHP files
$rcmail_config[‘skin_include_php’] = true;

// display software version on login screen
$rcmail_config[‘display_version’] = false;

// Session lifetime in minutes
$rcmail_config[‘session_lifetime’] = 30;

// Session domain: .example.org
$rcmail_config[‘session_domain’] = ”;

// Session name. Default: ’roundcube_sessid’
$rcmail_config[‘session_name’] = NULL;

// Session authentication cookie name. Default: ’roundcube_sessauth’
$rcmail_config[‘session_auth_name’] = NULL;

// Session path. Defaults to PHP session.cookie_path setting.
$rcmail_config[‘session_path’] = NULL;

// Backend to use for session storage. Can either be ‘db’ (default) or ‘memcache’
// If set to memcache, a list of servers need to be specified in ‘memcache_hosts’
// Make sure the Memcache extension (http://pecl.php.net/package/memcache) version >= 2.0.0 is installed
$rcmail_config[‘session_storage’] = ‘db';

// Use these hosts for accessing memcached
// Define any number of hosts in the form of hostname:port or unix:///path/to/socket.file
$rcmail_config[‘memcache_hosts’] = NULL; // e.g. array( ‘localhost:11211′, ‘192.168.1.12:11211′, ‘unix:///var/tmp/memcached.sock’ );

// check client IP in session athorization
$rcmail_config[‘ip_check’] = false;

// check referer of incoming requests
$rcmail_config[‘referer_check’] = false;

// X-Frame-Options HTTP header value sent to prevent from Clickjacking.
// Possible values: sameorigin|deny. Set to false in order to disable sending them
$rcmail_config[‘x_frame_options’] = ‘sameorigin';

// this key is used to encrypt the users imap password which is stored
// in the session record (and the client cookie if remember password is enabled).
// please provide a string of exactly 24 chars.
$rcmail_config[‘des_key’] = ‘K9ke+2j47tRzyOkiBEo8+TpJ';

// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with ‘host’ => ‘domain’ values to support multiple hosts
// Supported replacement variables:
// %h – user’s IMAP hostname
// %n – hostname ($_SERVER[‘SERVER_NAME’])
// %t – hostname without the first part
// %d – domain (http hostname $_SERVER[‘HTTP_HOST’] without the first part)
// %z – IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$rcmail_config[‘username_domain’] = ‘chances.com.br';

// This domain will be used to form e-mail addresses of new users
// Specify an array with ‘host’ => ‘domain’ values to support multiple hosts
// Supported replacement variables:
// %h – user’s IMAP hostname
// %n – http hostname ($_SERVER[‘SERVER_NAME’])
// %d – domain (http hostname without the first part)
// %z – IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$rcmail_config[‘mail_domain’] = ”;

// Password charset.
// Use it if your authentication backend doesn’t support UTF-8.
// Defaults to ISO-8859-1 for backward compatibility
$rcmail_config[‘password_charset’] = ‘ISO-8859-1′;

// How many seconds must pass between emails sent by a user
$rcmail_config[‘sendmail_delay’] = 0;

// Maximum number of recipients per message. Default: 0 (no limit)
$rcmail_config[‘max_recipients’] = 0;

// Maximum allowednumber of members of an address group. Default: 0 (no limit)
// If ‘max_recipients’ is set this value should be less or equal
$rcmail_config[‘max_group_members’] = 0;

// add this user-agent to message headers when sending
$rcmail_config[‘useragent’] = ‘Roundcube Webmail';

// use this name to compose page titles
$rcmail_config[‘product_name’] = ‘Chances Webmail';

// try to load host-specific configuration
// see http://trac.roundcube.net/wiki/Howto_Config for more details
$rcmail_config[‘include_host_config’] = false;

// path to a text file which will be added to each sent message
// paths are relative to the Roundcube root folder
$rcmail_config[‘generic_message_footer’] = ‘webmail';

// path to a text file which will be added to each sent HTML message
// paths are relative to the Roundcube root folder
$rcmail_config[‘generic_message_footer_html’] = ”;

// add a received header to outgoing mails containing the creators IP and hostname
$rcmail_config[‘http_received_header’] = false;

// Whether or not to encrypt the IP address and the host name
// these could, in some circles, be considered as sensitive information;
// however, for the administrator, these could be invaluable help
// when tracking down issues.
$rcmail_config[‘http_received_header_encrypt’] = false;

// This string is used as a delimiter for message headers when sending
// a message via mail() function. Leave empty for auto-detection
$rcmail_config[‘mail_header_delimiter’] = NULL;

// number of chars allowed for line when wrapping text.
// text wrapping is done when composing/sending messages
$rcmail_config[‘line_length’] = 72;

// send plaintext messages as format=flowed
$rcmail_config[‘send_format_flowed’] = true;

// According to RFC2298, return receipt envelope sender address must be empty.
// If this option is true, Roundcube will use user’s identity as envelope sender for MDN responses.
$rcmail_config[‘mdn_use_from’] = false;

// Set identities access level:
// 0 – many identities with possibility to edit all params
// 1 – many identities with possibility to edit all params but not email address
// 2 – one identity with possibility to edit all params
// 3 – one identity with possibility to edit all params but not email address
// 4 – one identity with possibility to edit only signature
$rcmail_config[‘identities_level’] = 0;

// Mimetypes supported by the browser.
// attachments of these types will open in a preview window
// either a comma-separated list or an array: ‘text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,application/pdf’
$rcmail_config[‘client_mimetypes’] = NULL; # null == default

// Path to a local mime magic database file for PHPs finfo extension.
// Set to null if the default path should be used.
$rcmail_config[‘mime_magic’] = ‘/usr/share/misc/magic';

// Absolute path to a local mime.types mapping table file.
// This is used to derive mime-types from the filename extension or vice versa.
// Such a file is usually part of the apache webserver. If you don’t find a file named mime.types on your system,
// download it from http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
$rcmail_config[‘mime_types’] = NULL;

// path to imagemagick identify binary
$rcmail_config[‘im_identify_path’] = NULL;

// path to imagemagick convert binary
$rcmail_config[‘im_convert_path’] = NULL;

// Size of thumbnails from image attachments displayed below the message content.
// Note: whether images are displayed at all depends on the ‘inline_images’ option.
// Set to 0 to display images in full size.
$rcmail_config[‘image_thumbnail_size’] = 240;

// maximum size of uploaded contact photos in pixel
$rcmail_config[‘contact_photo_size’] = 160;

// Enable DNS checking for e-mail address validation
$rcmail_config[‘email_dns_check’] = false;

// Disables saving sent messages in Sent folder (like gmail) (Default: false)
// Note: useful when SMTP server stores sent mail in user mailbox
$rcmail_config[‘no_save_sent_messages’] = false;

// ———————————-
// PLUGINS
// ———————————-

// List of active plugins (in plugins/ directory)

//$rcmail_config[‘plugins’] = array(qmailadmin);
$rcmail_config[‘plugins’] = array(‘plugin_manager’);
//

// ———————————-
// USER INTERFACE
// ———————————-

// default messages sort column. Use empty value for default server’s sorting,
// or ‘arrival’, ‘date’, ‘subject’, ‘from’, ‘to’, ‘fromto’, ‘size’, ‘cc’
$rcmail_config[‘message_sort_col’] = ”;

// default messages sort order
$rcmail_config[‘message_sort_order’] = ‘DESC';

// These cols are shown in the message list. Available cols are:
// subject, from, to, fromto, cc, replyto, date, size, status, flag, attachment, ‘priority’
$rcmail_config[‘list_cols’] = array(‘subject’, ‘status’, ‘fromto’, ‘date’, ‘size’, ‘flag’, ‘attachment’);

// the default locale setting (leave empty for auto-detection)
// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
$rcmail_config[‘language’] = ‘pt_BR';

// use this format for date display (date or strftime format)
$rcmail_config[‘date_format’] = ‘d-m-Y';

// give this choice of date formats to the user to select from
// Note: do not use ambiguous formats like m/d/Y
$rcmail_config[‘date_formats’] = array(‘Y-m-d’, ‘d-m-Y’, ‘Y/m/d’, ‘m/d/Y’, ‘d/m/Y’, ‘d.m.Y’, ‘j.n.Y’);

// use this format for time display (date or strftime format)
$rcmail_config[‘time_format’] = ‘H:i';

// give this choice of time formats to the user to select from
$rcmail_config[‘time_formats’] = array(‘G:i’, ‘H:i’, ‘g:i a’, ‘h:i A’);

// use this format for short date display (derived from date_format and time_format)
$rcmail_config[‘date_short’] = ‘D H:i';

// use this format for detailed date/time formatting (derived from date_format and time_format)
$rcmail_config[‘date_long’] = ‘d-mY H:i';

// store draft message is this mailbox
// leave blank if draft messages should not be stored
// NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
$rcmail_config[‘drafts_mbox’] = ‘Drafts';

// store spam messages in this mailbox
// NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
$rcmail_config[‘junk_mbox’] = ‘Junk';

// store sent message is this mailbox
// leave blank if sent messages should not be stored
// NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
$rcmail_config[‘sent_mbox’] = ‘Sent';

// move messages to this folder when deleting them
// leave blank if they should be deleted directly
// NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
$rcmail_config[‘trash_mbox’] = ‘Trash';

// display these folders separately in the mailbox list.
// these folders will also be displayed with localized names
// NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
$rcmail_config[‘default_folders’] = array(‘INBOX’, ‘Drafts’, ‘Sent’, ‘Junk’, ‘Trash’);

// automatically create the above listed default folders on first login
$rcmail_config[‘create_default_folders’] = true;

// protect the default folders from renames, deletes, and subscription changes
$rcmail_config[‘protect_default_folders’] = true;

// if in your system 0 quota means no limit set this option to true
$rcmail_config[‘quota_zero_as_unlimited’] = false;

// Make use of the built-in spell checker. It is based on GoogieSpell.
// Since Google only accepts connections over https your PHP installatation
// requires to be compiled with Open SSL support
$rcmail_config[‘enable_spellcheck’] = true;

// Enables spellchecker exceptions dictionary.
// Setting it to ‘shared’ will make the dictionary shared by all users.
$rcmail_config[‘spellcheck_dictionary’] = false;

// Set the spell checking engine. ‘googie’ is the default. ‘pspell’ is also available,
// but requires the Pspell extensions. When using Nox Spell Server, also set ‘googie’ here.
$rcmail_config[‘spellcheck_engine’] = ‘googie';

// For a locally installed spellcheker, specify the URI to call it, for example:
// ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/spellchecker.php?lang=’
// Leave empty to use the Google spell checking service, what means
// that the message content will be sent to Google in order to check spelling
$rcmail_config[‘spellcheck_uri’] = ”;

// These languages can be selected for spell checking.
// Configure as a PHP style hash array: array(‘en’=>’English’, ‘de’=>’Deutsch’);
// Leave empty for default set of available language.
$rcmail_config[‘spellcheck_languages’] = NULL;

// Makes that words with all letters capitalized will be ignored (e.g. GOOGLE)
$rcmail_config[‘spellcheck_ignore_caps’] = false;

// Makes that words with numbers will be ignored (e.g. g00gle)
$rcmail_config[‘spellcheck_ignore_nums’] = false;

// Makes that words with symbols will be ignored (e.g. g@@gle)
$rcmail_config[‘spellcheck_ignore_syms’] = false;

// Use this char/string to separate recipients when composing a new message
$rcmail_config[‘recipients_separator’] = ‘,';

// don’t let users set pagesize to more than this value if set
$rcmail_config[‘max_pagesize’] = 1000;

// Minimal value of user’s ‘refresh_interval’ setting (in seconds)
$rcmail_config[‘min_refresh_interval’] = 60;

// Enables files upload indicator. Requires APC installed and enabled apc.rfc1867 option.
// By default refresh time is set to 1 second. You can set this value to true
// or any integer value indicating number of seconds.
$rcmail_config[‘upload_progress’] = true;

// Specifies for how many seconds the Undo button will be available
// after object delete action. Currently used with supporting address book sources.
// Setting it to 0, disables the feature.
$rcmail_config[‘undo_timeout’] = 0;

// ———————————-
// ADDRESSBOOK SETTINGS
// ———————————-

// This indicates which type of address book to use. Possible choises:
// ‘sql’ (default), ‘ldap’ and ”.
// If set to ‘ldap’ then it will look at using the first writable LDAP
// address book as the primary address book and it will not display the
// SQL address book in the ‘Address Book’ view.
// If set to ” then no address book will be displayed or only the
// addressbook which is created by a plugin (like CardDAV).
$rcmail_config[‘address_book_type’] = ‘sql';

// In order to enable public ldap search, configure an array like the Verisign
// example further below. if you would like to test, simply uncomment the example.
// Array key must contain only safe characters, ie. a-zA-Z0-9_
$rcmail_config[‘ldap_public’] = array();

// If you are going to use LDAP for individual address books, you will need to
// set ‘user_specific’ to true and use the variables to generate the appropriate DNs to access it.
//
// The recommended directory structure for LDAP is to store all the address book entries
// under the users main entry, e.g.:
//
// o=root
// ou=people
// uid=user@domain
// mail=contact@contactdomain
//
// So the base_dn would be uid=%fu,ou=people,o=root
// The bind_dn would be the same as based_dn or some super user login.
/*
* example config for Verisign directory
*
$rcmail_config[‘ldap_public’][‘Verisign’] = array(
‘name’ => ‘Verisign.com’,
// Replacement variables supported in host names:
// %h – user’s IMAP hostname
// %n – hostname ($_SERVER[‘SERVER_NAME’])
// %t – hostname without the first part
// %d – domain (http hostname $_SERVER[‘HTTP_HOST’] without the first part)
// %z – IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
‘hosts’ => array(‘directory.verisign.com’),
‘port’ => 389,
‘use_tls’ => false,
‘ldap_version’ => 3, // using LDAPv3
‘network_timeout’ => 10, // The timeout (in seconds) for connect + bind arrempts. This is only supported in PHP >= 5.3.0 with OpenLDAP 2.x
‘user_specific’ => false, // If true the base_dn, bind_dn and bind_pass default to the user’s IMAP login.
// %fu – The full username provided, assumes the username is an email
// address, uses the username_domain value if not an email address.
// %u – The username prior to the ‘@’.
// %d – The domain name after the ‘@’.
// %dc – The domain name hierarchal string e.g. “dc=test,dc=domain,dc=com”
// %dn – DN found by ldap search when search_filter/search_base_dn are used
‘base_dn’ => ”,
‘bind_dn’ => ”,
‘bind_pass’ => ”,
// It’s possible to bind for an individual address book
// The login name is used to search for the DN to bind with
‘search_base_dn’ => ”,
‘search_filter’ => ”, // e.g. ‘(&(objectClass=posixAccount)(uid=%u))’
// DN and password to bind as before searching for bind DN, if anonymous search is not allowed
‘search_bind_dn’ => ”,
‘search_bind_pw’ => ”,
// Default for %dn variable if search doesn’t return DN value
‘search_dn_default’ => ”,
// Optional authentication identifier to be used as SASL authorization proxy
// bind_dn need to be empty
‘auth_cid’ => ”,
// SASL authentication method (for proxy auth), e.g. DIGEST-MD5
‘auth_method’ => ”,
// Indicates if the addressbook shall be hidden from the list.
// With this option enabled you can still search/view contacts.
‘hidden’ => false,
// Indicates if the addressbook shall not list contacts but only allows searching.
‘searchonly’ => false,
// Indicates if we can write to the LDAP directory or not.
// If writable is true then these fields need to be populated:
// LDAP_Object_Classes, required_fields, LDAP_rdn
‘writable’ => false,
// To create a new contact these are the object classes to specify
// (or any other classes you wish to use).
‘LDAP_Object_Classes’ => array(‘top’, ‘inetOrgPerson’),
// The RDN field that is used for new entries, this field needs
// to be one of the search_fields, the base of base_dn is appended
// to the RDN to insert into the LDAP directory.
‘LDAP_rdn’ => ‘cn’,
// The required fields needed to build a new contact as required by
// the object classes (can include additional fields not required by the object classes).
‘required_fields’ => array(‘cn’, ‘sn’, ‘mail’),
‘search_fields’ => array(‘mail’, ‘cn’), // fields to search in
// mapping of contact fields to directory attributes
// for every attribute one can specify the number of values (limit) allowed.
// default is 1, a wildcard * means unlimited
‘fieldmap’ => array(
// Roundcube => LDAP:limit
‘name’ => ‘cn’,
‘surname’ => ‘sn’,
‘firstname’ => ‘givenName’,
‘jobtitle’ => ‘title’,
‘email’ => ‘mail:*’,
‘phone:home’ => ‘homePhone’,
‘phone:work’ => ‘telephoneNumber’,
‘phone:mobile’ => ‘mobile’,
‘phone:pager’ => ‘pager’,
‘street’ => ‘street’,
‘zipcode’ => ‘postalCode’,
‘region’ => ‘st’,
‘locality’ => ‘l’,
// if you country is a complex object, you need to configure ‘sub_fields’ below
‘country’ => ‘c’,
‘organization’ => ‘o’,
‘department’ => ‘ou’,
‘jobtitle’ => ‘title’,
‘notes’ => ‘description’,
// these currently don’t work:
// ‘phone:workfax’ => ‘facsimileTelephoneNumber’,
// ‘photo’ => ‘jpegPhoto’,
// ‘manager’ => ‘manager’,
// ‘assistant’ => ‘secretary’,
),
// Map of contact sub-objects (attribute name => objectClass(es)), e.g. ‘c’ => ‘country’
‘sub_fields’ => array(),
// Generate values for the following LDAP attributes automatically when creating a new record
‘autovalues’ => array(
// ‘uid’ => ‘md5(microtime())’, // You may specify PHP code snippets which are then eval’ed
// ‘mail’ => ‘{givenname}.{sn}@mydomain.com’, // or composite strings with placeholders for existing attributes
),
‘sort’ => ‘cn’, // The field to sort the listing by.
‘scope’ => ‘sub’, // search mode: sub|base|list
‘filter’ => ‘(objectClass=inetOrgPerson)’, // used for basic listing (if not empty) and will be &’d with search queries. example: status=act
‘fuzzy_search’ => true, // server allows wildcard search
‘vlv’ => false, // Enable Virtual List View to more efficiently fetch paginated data (if server supports it)
‘numsub_filter’ => ‘(objectClass=organizationalUnit)’, // with VLV, we also use numSubOrdinates to query the total number of records. Set this filter to get all numSubOrdinates attributes for counting
‘sizelimit’ => ‘0’, // Enables you to limit the count of entries fetched. Setting this to 0 means no limit.
‘timelimit’ => ‘0’, // Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit.
‘referrals’ => true|false, // Sets the LDAP_OPT_REFERRALS option. Mostly used in multi-domain Active Directory setups

// definition for contact groups (uncomment if no groups are supported)
// for the groups base_dn, the user replacements %fu, %u, $d and %dc work as for base_dn (see above)
// if the groups base_dn is empty, the contact base_dn is used for the groups as well
// -> in this case, assure that groups and contacts are separated due to the concernig filters!
‘groups’ => array(
‘base_dn’ => ”,
‘scope’ => ‘sub’, // search mode: sub|base|list
‘filter’ => ‘(objectClass=groupOfNames)’,
‘object_classes’ => array(“top”, “groupOfNames”),
‘member_attr’ => ‘member’, // name of the member attribute, e.g. uniqueMember
‘name_attr’ => ‘cn’, // attribute to be used as group name
),
);
*/

// An ordered array of the ids of the addressbooks that should be searched
// when populating address autocomplete fields server-side. ex: array(‘sql’,’Verisign’);
$rcmail_config[‘autocomplete_addressbooks’] = array(‘sql’);

// The minimum number of characters required to be typed in an autocomplete field
// before address books will be searched. Most useful for LDAP directories that
// may need to do lengthy results building given overly-broad searches
$rcmail_config[‘autocomplete_min_length’] = 1;

// Number of parallel autocomplete requests.
// If there’s more than one address book, n parallel (async) requests will be created,
// where each request will search in one address book. By default (0), all address
// books are searched in one request.
$rcmail_config[‘autocomplete_threads’] = 0;

// Max. numer of entries in autocomplete popup. Default: 15.
$rcmail_config[‘autocomplete_max’] = 15;

// show address fields in this order
// available placeholders: {street}, {locality}, {zipcode}, {country}, {region}
$rcmail_config[‘address_template’] = ‘{street}
{locality} {zipcode}
{country} {region}';

// Matching mode for addressbook search (including autocompletion)
// 0 – partial (*abc*), default
// 1 – strict (abc)
// 2 – prefix (abc*)
// Note: For LDAP sources fuzzy_search must be enabled to use ‘partial’ or ‘prefix’ mode
$rcmail_config[‘addressbook_search_mode’] = 0;

// ———————————-
// USER PREFERENCES
// ———————————-

// Use this charset as fallback for message decoding
$rcmail_config[‘default_charset’] = ‘ISO-8859-1′;

// skin name: folder from skins/
$rcmail_config[‘skin’] = ‘googie_larry';

// show up to X items in messages list view
$rcmail_config[‘mail_pagesize’] = 50;

// show up to X items in contacts list view
$rcmail_config[‘addressbook_pagesize’] = 50;

// sort contacts by this col (preferably either one of name, firstname, surname)
$rcmail_config[‘addressbook_sort_col’] = ‘surname';

// the way how contact names are displayed in the list
// 0: display name
// 1: (prefix) firstname middlename surname (suffix)
// 2: (prefix) surname firstname middlename (suffix)
// 3: (prefix) surname, firstname middlename (suffix)
$rcmail_config[‘addressbook_name_listing’] = 0;

// use this timezone to display date/time
// valid timezone identifers are listed here: php.net/manual/en/timezones.php
// ‘auto’ will use the browser’s timezone settings
$rcmail_config[‘timezone’] = ‘America/Sao_Paulo';

// prefer displaying HTML messages
$rcmail_config[‘prefer_html’] = true;

// display remote inline images
// 0 – Never, always ask
// 1 – Ask if sender is not in address book
// 2 – Always show inline images
$rcmail_config[‘show_images’] = 2;

// open messages in new window
$rcmail_config[‘message_extwin’] = false;

// open message compose form in new window
$rcmail_config[‘compose_extwin’] = false;

// compose html formatted messages by default
// 0 – never, 1 – always, 2 – on reply to HTML message, 3 – on forward or reply to HTML message
$rcmail_config[‘htmleditor’] = 1;

// show pretty dates as standard
$rcmail_config[‘prettydate’] = true;

// save compose message every 300 seconds (5min)
$rcmail_config[‘draft_autosave’] = 60;

// default setting if preview pane is enabled
$rcmail_config[‘preview_pane’] = false;

// Mark as read when viewed in preview pane (delay in seconds)
// Set to -1 if messages in preview pane should not be marked as read
$rcmail_config[‘preview_pane_mark_read’] = 0;

// Clear Trash on logout
$rcmail_config[‘logout_purge’] = false;

// Compact INBOX on logout
$rcmail_config[‘logout_expunge’] = false;

// Display attached images below the message body
$rcmail_config[‘inline_images’] = true;

// Encoding of long/non-ascii attachment names:
// 0 – Full RFC 2231 compatible
// 1 – RFC 2047 for ‘name’ and RFC 2231 for ‘filename’ parameter (Thunderbird’s default)
// 2 – Full 2047 compatible
$rcmail_config[‘mime_param_folding’] = 0;

// Set true if deleted messages should not be displayed
// This will make the application run slower
$rcmail_config[‘skip_deleted’] = false;

// Set true to Mark deleted messages as read as well as deleted
// False means that a message’s read status is not affected by marking it as deleted
$rcmail_config[‘read_when_deleted’] = true;

// Set to true to never delete messages immediately
// Use ‘Purge’ to remove messages marked as deleted
$rcmail_config[‘flag_for_deletion’] = false;

// Default interval for auto-refresh requests (in seconds)
// These are requests for system state updates e.g. checking for new messages, etc.
// Setting it to 0 disables the feature.
$rcmail_config[‘refresh_interval’] = 60;

// If true all folders will be checked for recent messages
$rcmail_config[‘check_all_folders’] = false;

// If true, after message delete/move, the next message will be displayed
$rcmail_config[‘display_next’] = false;

// 0 – Do not expand threads
// 1 – Expand all threads automatically
// 2 – Expand only threads with unread messages
$rcmail_config[‘autoexpand_threads’] = 2;

// When replying:
// -1 – don’t cite the original message
// 0 – place cursor below the original message
// 1 – place cursor above original message (top posting)
$rcmail_config[‘reply_mode’] = false;

// When replying strip original signature from message
$rcmail_config[‘strip_existing_sig’] = true;

// Show signature:
// 0 – Never
// 1 – Always
// 2 – New messages only
// 3 – Forwards and Replies only
$rcmail_config[‘show_sig’] = 1;

// Use MIME encoding (quoted-printable) for 8bit characters in message body
$rcmail_config[‘force_7bit’] = false;

// Defaults of the search field configuration.
// The array can contain a per-folder list of header fields which should be considered when searching
// The entry with key ‘*’ stands for all folders which do not have a specific list set.
// Please note that folder names should to be in sync with $rcmail_config[‘default_folders’]
$rcmail_config[‘search_mods’] = NULL; // Example: array(‘*’ => array(‘subject’=>1, ‘from’=>1), ‘Sent’ => array(‘subject’=>1, ‘to’=>1));

// Defaults of the addressbook search field configuration.
$rcmail_config[‘addressbook_search_mods’] = NULL; // Example: array(‘name’=>1, ‘firstname’=>1, ‘surname’=>1, ‘email’=>1, ‘*’=>1);

// ‘Delete always’
// This setting reflects if mail should be always deleted
// when moving to Trash fails. This is necessary in some setups
// when user is over quota and Trash is included in the quota.
$rcmail_config[‘delete_always’] = false;

// Directly delete messages in Junk instead of moving to Trash
$rcmail_config[‘delete_junk’] = false;

// Behavior if a received message requests a message delivery notification (read receipt)
// 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask)
// 3 = send automatically if sender is in addressbook, otherwise ask the user
// 4 = send automatically if sender is in addressbook, otherwise ignore
$rcmail_config[‘mdn_requests’] = 0;

// Return receipt checkbox default state
$rcmail_config[‘mdn_default’] = 0;

// Delivery Status Notification checkbox default state
// Note: This can be used only if smtp_server is non-empty
$rcmail_config[‘dsn_default’] = 0;

// Place replies in the folder of the message being replied to
$rcmail_config[‘reply_same_folder’] = false;

// Sets default mode of Forward feature to “forward as attachment”
$rcmail_config[‘forward_attachment’] = false;

// Defines address book (internal index) to which new contacts will be added
// By default it is the first writeable addressbook.
// Note: Use ‘0’ for built-in address book.
$rcmail_config[‘default_addressbook’] = true;

// Enables spell checking before sending a message.
$rcmail_config[‘spellcheck_before_send’] = false;

// Skip alternative email addresses in autocompletion (show one address per contact)
$rcmail_config[‘autocomplete_single’] = false;

// Default font for composed HTML message.
// Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New,
// Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana
$rcmail_config[‘default_font’] = ”;

// end of config file

vim/usr/local/www/roundcube/config/db.inc.php

Criar relação de confiança entre dois servidores ssh

1º Servidor B acessando o servidor A sem necessária senha
2º Criar uma chave no servidor B com o comando ssh-keygen –t rsa (caso ainda não possua). Verificar se já não existe as chaves dentro do home do usuário /user/home/.ssh/ id_rsa ou id_rsa.pub, know_hosts

Veja exemplo:
server:~/.ssh # pwd
/root/.ssh
server:~/.ssh # ls
authorized_keys id_rsa id_rsa.pub known_hosts

3º Pegar a chave gerada no servidor B (id_rsa.pub e adiciona-la em AUTHORIZED_KEYS do servidor r
Verificar as permissões do arquivo authorized_keys2 e caso diferente aplicar:

• Put the public key in .ssh/authorized_keys
• Change the permissions of .ssh to 700
• Change the permissions of .ssh/authorized_keys2 to 640
IMPORTANTE chmod 640 /home/USER/.ssh/authorized_keys

Autenticando o Proxy Squid + DansGuardian no AD (samba4)

Autenticando o Proxy Squid + DansGuardian no AD (samba4)
A autenticação do usuário e senha e feita sempre pelo squid, mesmo que trabalhe em conjundo com o DansGuardiam e sua porta do browser esteja `virada` para o dans, toda a autenticação eh feita no squid.
Há três maneiras de serem feitas as autenticações do squid no samba4 sendo que duas há necessidade de ingressar anteriormente esse servidor squid no domínio existente do samba4.
Descrição
• Permitir que o squid autentique usuários do windows active directory ou samba.
• Isso proporcina uma maior integração e utilização de uma única base de senhas.
• Também facilita o controle da navegação e relatórios por usuários.
• Existem 2 autenticadores no squid para isso:
o NTLM: Pega automaticamente ou não o login do usuário logado no dominio. Caso o usuário não esteja logado, solicita a senha.
o MSNT: Solicita que o usuário digite o usuário e senha. O NTLM é bem melhor, sugiro usar ele.
o SMB_AUTH: Faz autenticação através do samba. Bem simples e fácil de configurar.
• Se estiver utilizando o squid do SuSE, ele vem com todos os autenticadores. Caso contrário terá que compilar no squid.

Uma forma fácil e rápida eh pelo executável distribuído no squid chamada smb_auth (no freebsd localizado em /usr/local/libexec/squid/smb_auth). Usando deste executável não há necessidade de ingressar o servidor ao domínio.
1 – No servidor samba4 sera necessário criar um compartilhamento chamado netlogon contendo um arquivo dentro do diretório de nome proxyauth escrito em seu conteúdo o nome allow.
[root@dominio ~]# vim /etc/samba/smb.conf

[netlogon]
comment = The domain logon service
path = /share/netlogon
# valid users = @”Domain Users”
valid users = %U
browseable = no
guest ok = yes
writeable = no
read only = yes
[root@dominio ~]# cat /share/netlogon/proxyauth
allow

[root@dominio ~]# chmod 777 /share/netlogon/proxyauth

[root@dominio ~]# ls -lah /share/netlogon/
total 12K
drwxr-xr-x. 2 root root 4.0K Mar 20 19:35 .
drwxr-xr-x. 6 root root 4.0K Mar 20 19:35 ..
-rwxrwxrwx. 1 root root 6 Mar 20 19:35 proxyauth

Abaixo iremos realizer um teste do usuario e senha. Onde escrevo USUARIO SENHA substitui por dados reais. Após dar um enter no comando escreva com um espaço o Usuario e senha e posterior de enter e espere.

Quando eu escrevo um usuário e senha corretos tenho a mensagem de OK ao final.
Observação para o domínio no qual omite o .net, .com, etc..

(root@proxy)~# /usr/local/libexec/squid/smb_auth -W DOMINIOTESTE -d
USUARIO SENHA
Domain name: DOMINIOTESTE
Pass-through authentication: no
Query address options:
Domain controller IP address: 192.168.218.190
Domain controller NETBIOS name: DOMINIO
Contents of //DOMINIO/NETLOGON/proxyauth: allow
OK

Quando introduzo um usuario e senha incorretos tenho a mensagem de ERR ao final.

(root@proxy)~# /usr/local/libexec/squid/smb_auth -W DOMINIOTESTE -d
uferes 123
Domain name: DOMINIOTESTE
Pass-through authentication: no
Query address options:
Domain controller IP address: 192.168.218.190
Domain controller NETBIOS name: DOMINIO
Contents of //DOMINIO/NETLOGON/proxyauth:
ERR

Para finalizar iremos aplicar no arquivo squid.conf a autenticação (não irei abortar o arquivo todo e muito menos a configuração do squid):

auth_param basic program /usr/local/libexec/squid/smb_auth -W DOMINIOTESTE -U 192.168.218.190

Mas abaixo temos a clausula de requerimento.
acl auth proxy_auth REQUIRED

Reinicie o squid e teste a autenticação.

Alguns artigos mandam alterar o conteúdo com um patch ou manualmente do arquivo abaixo:
/usr/local/libexec/squid/smb_auth.sh
Trocando
USER=”$SMBUSER%$SMBPASS”
por
USER=”$SMBUSER”
PASSWD=”$SMBPASS”

Porem isso não foi necessário. Quando realizei essa modificação parou de funcionar.

Outras formas de integrar o squid com o samba4
Descrição
• Permitir que o squid autentique usuários do windows active directory ou samba.
• Isso proporcina uma maior integração e utilização de uma única base de senhas.
• Também facilita o controle da navegação e relatórios por usuários.
• Existem 2 autenticadores no squid para isso:
o NTLM: Pega automaticamente ou não o login do usuário logado no dominio. Caso o usuário não esteja logado, solicita a senha.
o MSNT: Solicita que o usuário digite o usuário e senha. O NTLM é bem melhor, sugiro usar ele.
o SMB_AUTH: Faz autenticação através do samba. Bem simples e fácil de configurar.
• Se estiver utilizando o squid do SuSE, ele vem com todos os autenticadores. Caso contrário terá que compilar no squid.

Softwares e Versões
• Squid 2.5.X
• Samba client 3.x
Configuração para MSNT e NTLM
Configurar samba e winbind para entrar no domínio
• Editar o smb.conf
workgroup = mydomain
password server = myPDC
security = ads
winbind uid = 10000-20000
winbind gid = 10000-20000
winbind use default domain = yes
# tirar outras opcoes de dominio master
• Editar o /etc/hosts e adicionar uma entrada para o nome do servidor AD.
• Entrar no dominio.
$ net join -S NOMESERVIDORDOMINIOWINDOWS -Uuserdowindows%senhadowindows
• OBS: È necessário um usuário no windows com permissão no grupo Administradores.
• Verificar se o nscd está rodando e parar
$ ps auxwww | grep [n]scd
root 3036 0.0 0.2 141416 1080 ? Ssl 10:04 0:00 /usr/sbin/nscd
$ /etc/init.d/nscd stop
$ chkconfig nscd off
• OBS: Esse procedimento acima é muito importante, pois dependendo da versão do samba, se o nscd estiver rodando o winbind não funciona!
• Startar nmb e winbind
$ /etc/init.d/nmb start; /etc/init.d/winbind start;
• Setar diretorio do winbind para mesmo grupo do squid:
chown root.GRUPOSQUID /var/lib/samba/winbindd_privileged
• Rodar diariamente no crontab
$ net rpc changetrustpw
• Testar se logou com sucesso no domínio:
$ wbinfo -t
Secret is good
• Testar autenticação do winbind:
$ wbinfo -a mydomain\\myuser%mypasswd
plaintext password authentication succeeded
error code was NT_STATUS_OK (0x0)
challenge/response password authentication succeeded
error code was NT_STATUS_OK (0x0)

________________________________________
MSNT
• Editar o /etc/squid/msntauth.conf
server PDCNAME PDCNAME WORKGROUP
• Editar o squid.conf:
auth_param basic program /usr/local/squid/libexec/msnt_auth
auth_param basic children 5
auth_param basic realm Usuário e Senha
auth_param basic credentialsttl 5 minutes

acl password proxy_auth REQUIRED
http_access allow LAN password

________________________________________
NTLM
• Particularidade do squid RPM do SuSE:
o No SUSE tem 2 ntlm_auth, um em /usr/bin outro em /usr/sbin. TEM QUE USAR O DO /usr/bin:
$ /usr/bin/ntlm_auth –helper-protocol=squid-2.5-basic
myuser mypasswd
OK
• Testar o autenticador na linha de comando:
$ /usr/local/bin/ntlm_auth –helper-protocol=squid-2.5-basic
mydomain+myuser mypasswd
OK
• Para debugar a autenticação, rodar o winbind com o parametro -d 6
• Inserir no squid.conf:
#Auth AD
auth_param ntlm program /usr/bin/ntlm_auth –helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 30
auth_param basic program /usr/bin/ntlm_auth –helper-protocol=squid-2.5-basic
auth_param basic children 5
auth_param basic realm Linux Proxy Server
auth_param basic credentialsttl 2 hours

• OBS IMPORTANTE: Perceba que no arquivo squid.conf existem 2 chamadas ao ntlm_auth. A primeira é referente a autenticação automática, pegando o usuário do windows já logado e a segunda é para pedir senha, para usuários não logados. Caso deseje que ele sempre solicite senha, mesmo para usuários logados, comente a primeira opção (ntlmssp) e deixe somente a segunda opção (basic).