Rumours will have it that Android ICS firmware are available right now, also for the Nordic (Norwegian only?) users.

This, however, is not accurate information. I just read this article which states that your phone might end up just like a paperweight.

 

On the Norwegian page, Amobil.no, they say that it is available for all if you update through the Kies! application from Samsung.

I have just checked, and sadly, it is not true. It says that the currently most up to date firmware available for my GT-N7000 Phone is: Android 2.3.6 (Gingerbread).

 

Rumours from the commentary field on Amobil.no, states that it is not needed to wait that much longer, and that the firmware update will be available near the end of May, start of June. This is an unconfirmed rumour, as no official source of this have been found.

First of all; this guide is based on the fact that you have some knowledge about using Linux to edit configuration files.

The successfull setup I did today involve these versions of software packages:

  • Postfix.i686 2.6.6-2.2-el6_1 (precompiled package with mysql support)
  • Dovecot.i686 2.0.9-2.el6_1.1 with these additional packages: dovecot-devel.i686 2.0.9-2.el6_1.1 / dovecot-mysql.i686 2.0.9-2.el6_1.1 / dovecot-pgsql.i686 2.0.9-2.el6_1.1 / dovecot-pigeonhole.i686 2.0.9-2.el6_1.1
  • mysql.i686  5.1.61-1.el6_2.1 / mysql-server.i686 5.1.61-1.el6_2.1
  • httpd.i686  2.2.15-15.el6.centos.1 with php.i686 5.3.3-3.el6_2.6 and php-mysql.i686 5.3.3-3.el6_2.6
  • Postfix Admin 2.3.5
  • RoundCube Webmail 0.7.2

The above is setup on a VPS running CentOS release 6.2 (Final).

Step 1.

Install yum prioritys

yum install yum-plugin-priorities.noarch

Edit the yum repos list.

nano /etc/yum.repos.d/CentOS-Base.repo

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead.
#
#

[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing includepkgs=php*
priority=1

[base]
name=CentOS-$releasever – Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
exclude=postfix
priority=2

#released updates
[updates]
name=CentOS-$releasever – Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
exclude=postfix
priority=2

#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus] name=CentOS-$releasever – Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=2

#contrib – packages by Centos Users

[contrib]
name=CentOS-$releasever – Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Step 2.

Install the other necessary packages:

yum install spamassassin postfix mysql-server mysql-devel httpd dovecot dovecot-mysql mod_ssl mod_php php-mysql php-mbstring php-devel php-xml php-imap make gcc php-pear php-mcrypt

 

Step 3.

Adding mysql databases and users:

  1. Start mysqld: service mysqld start
  2. Set the mysql root password using the command ‘mysql -u root password NEWPASSWORD’
  3. Logon to the mysql server using the command ‘mysql -p’ and enter the password when prompted.
  4. Type ‘create database mails;’ and hit enter.
  5. Type ‘grant all on mails.* to ‘postfix’@'localhost’ identified by ‘Password’;’ and hit enter.
  6. Type ‘use mails;’ and hit enter.
  7. Type ‘CREATE TABLE popbsmtp (  address varchar(39) not null,  last_seen datetime default ’0000-00-00 00:00:00′ not null,  primary key (address)  );’ and hit enter.
  8. Type ‘CREATE DATABASE roundcubemail;’ and hit enter.
  9. Type ‘grant all on roundcubemail.* to ’roundcube’@'localhost’ identified by ‘Password’;’ and hit enter.

Step 4.

Type ‘nano /etc/postfix/main.cf’ and hit enter.

Edit the following lines:

alias_database = hash:/etc/aliases

alias_maps = hash:/etc/aliases

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/libexec/postfix

data_directory = /var/lib/postfix

debug_peer_level = 2

html_directory = no

inet_interfaces = all

inet_protocols = all

local_recipient_maps = $virtual_mailbox_maps

mail_owner = postfix

mailq_path = /usr/bin/mailq.postfix

manpage_directory = /usr/share/man

mydestination = $myhostname, localhost.$mydomain, localhost

myhostname = hostname.domain.tld # Type your hostname here.

newaliases_path = /usr/bin/newaliases.postfix

queue_directory = /var/spool/postfix

readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

sample_directory = /usr/share/doc/postfix-2.6.6/samples

sendmail_path = /usr/sbin/sendmail.postfix

setgid_group = postdrop

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,check_client_access mysql:/etc/postfix/mysql_popbsmtp_access_maps.cf,check_client_access hash:/etc/postfix/relay,reject_unauth_destination #This should be on one line

smtpd_sasl_auth_enable = yes

smtpd_sasl_path = private/auth

smtpd_sasl_security_options = noanonymous

smtpd_sasl_type = dovecot

unknown_local_recipient_reject_code = 550

virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf, mysql:/etc/postfix/mysql_virtual_alias_domain_maps.cf

virtual_gid_maps = static:89

virtual_mailbox_base = /home/virtual_mail

virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf

virtual_mailbox_limit = 102400000

virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf

virtual_minimum_uid = 89

virtual_transport = virtual

virtual_uid_maps = static:89

Create the ’virtual_mailbox_domains’ folder using the command ‘mkdir /home/virtual_mail’ and then use ’chown postfix:mail /home/virtual_mail/ -R’ to allow postfix and dovecot access to it. Also make sure that you issue the command ‘chmod 750 /home/virtual_mail/’.

Next, we need to create the mysql query’s that postfix will use to check for aliases and mail accounts.

File: /etc/postfix/mysql_virtual_alias_maps.cf

#Syntax with postfix 2.2.x:

user = postfix

password = *********

hosts = localhost

dbname = mails

query = SELECT goto FROM alias WHERE address=’%s’ AND active = 1

File:  /etc/postfix/mysql_virtual_domains_maps.cf

#Syntax with postfix 2.2.x:

user = postfix

password = ********

hosts = localhost

dbname = mails

query = SELECT domain FROM domain WHERE domain=’%s’

#optional query to use when relaying for backup MX

#query = SELECT domain FROM domain WHERE domain=’%s’ and backupmx = ’0′ and active = ’1′

File: /etc/postfix/mysql_virtual_mailbox_maps.cf

#Syntax with postfix 2.2.x:

user = postfix

password = *********

hosts = localhost

dbname = mails

query = SELECT maildir FROM mailbox WHERE username=’%s’ AND active = 1

File: /etc/postfix/mysql_virtual_alias_domain_maps.cf

#Syntax with postfix 2.2.x:

user = postfix

password = xxxxxxxx

hosts = localhost

dbname = mails

query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = ‘%d’ AND alias.address=concat(‘%u’, ‘@’, alias.active = 1)

File: /etc/postfix/mysql_popbsmtp_access_maps.cf

#Syntax with postfix 2.2.x:

user = postfix

password = xxxxxxxx

hosts = localhost

dbname = mails

query = SELECT ‘OK’ FROM popbsmtp WHERE last_seen >= DATE_SUB(NOW(),INTERVAL 120 MINUTE) AND address = ‘%s’

 Step 5.

Edit /etc/dovecot/dovecot.conf:

# 2.0.9: /etc/dovecot/dovecot.conf

# OS: Linux 3.0.18-linode43 i686 CentOS release 6.2 (Final) ext3

auth_debug = yes

auth_mechanisms = plain login

auth_verbose = yes

auth default {

mechanisms = plain login

passdb pam {

}

userdb passwd {

}

socket listen {

client {

path = /var/spool/postfix/private/auth

mode = 0660

user = postfix

group = postfix

}

}

}

first_valid_gid = 89

first_valid_uid = 89

listen = *

mail_access_groups = postfix

mail_location = maildir:/home/virtual_mail/%u/

mail_privileged_group = postfix

managesieve_notify_capability = mailto

managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox d$

mbox_write_locks = fcntl

namespace {

inbox = yes

location =

prefix = INBOX.

separator = .

type = private

}

passdb {

args = /etc/dovecot-mysql.conf

driver = sql

}

protocols = imap pop3

ssl_cert = </etc/pki/dovecot/certs/dovecot.pem

ssl_key = </etc/pki/dovecot/private/dovecot.pem

userdb {

args = /etc/dovecot-mysql.conf

driver = sql

}

verbose_proctitle = yes

protocol imap {

imap_client_workarounds = delay-newmail tb-extra-mailbox-sep

}

protocol pop3 {

pop3_client_workarounds = outlook-no-nuls oe-ns-eoh

pop3_uidl_format = %08Xu%08Xv

}

protocol lda {

postmaster_address = postmaster@martinbn.info

sendmail_path = /usr/sbin/sendmail

}

File: /etc/dovecot-mysql.conf

# Database driver: mysql, pgsql driver = mysql

# Currently supported schemes include PLAIN, PLAIN-MD5, DIGEST-MD5, and CRYPT. default_pass_scheme = CRYPT

# Database options connect = host=localhost dbname=mails user=postfix password=YOUR_PASSWORD_HERE

password_query = SELECT password FROM mailbox WHERE username = ‘%u’ AND active = ’1′ user_query = SELECT maildir, 89 AS uid, 89 AS gid FROM mailbox WHERE username = ‘%u’ AND active = ’1′

Note: When we start/restart the Dovecot service later on, you will receive some notices about some configuration settings being obsolete, but the setup will work anyway.

 

Step 6.

First edit /etc/httpd/conf/httpd.conf and this line to the bottom:

NameVirtualHost *:80

Then create /etc/httpd/conf.d/pfadmin.vhost.conf: (DocumentRoot dir will be created later)

<VirtualHost *:80>

ServerName pfadmin.domain.tld

serveralias www.pfadmin.domain.tld

DocumentRoot /var/www/pfadmin

<Directory /var/www/pfadmin>

Options none

Allowoverride AuthConfig

</Directory>

customlog    /var/www/access_log combinined

errorlog     /var/www/error_log

</VirtualHost>

File: /etc/httpd/conf.d/webmail.vhost.conf (DocumentRoot dir will be created later):

<VirtualHost *:80>

ServerName webmail.domain.tld

ServerAlias www.webmail.domain.tld

DocumentRoot /var/www/webmail

<Directory /var/www/webmail >

Options Indexes FollowSymLinks

AllowOverride All

RewriteEngine on

</Directory>

</VirtualHost>

Note: You need to create a new conf file for your main site in /etc/httpd/conf.d/!

 Step 7.

Download pfadmin and roundcube:

  1. In the root dir (/root) create two folders named pfadmin and roundcube.
  2. Cd to the pfadmin folder.
  3. Type ‘wget http://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.3.5/postfixadmin-2.3.5.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpostfixadmin%2F&ts=1336926450&use_mirror=heanet’ (or the link you get from the latest release) and hit Enter.
  4. When the download is done, type ‘tar -zxvf postfixadmin-2.3.5.tar.gz’ and hit enter.
  5. Type ‘mkdir /var/www/pfadmin’, and hit enter.
  6. Type ‘cp -R postfixadmin-2.3.5/* /var/www/pfadmin/’ and hit enter.
  7. Repeat 2-6 with RoundCubeWebmail, and change from pfadmin to webmail as target and source directories.

Step 8.

Edit /var/www/config.inc.php and change the following:

$CONF['configured'] = true; #Default is false

$CONF['postfix_admin_url'] = ‘http://pfadmin.domain.tld’;

$CONF['database_type'] = ‘mysqli’; #Default is mysql, but mysqli is recommended as it deals better with attempts of sql-injection

$CONF['database_host'] = ‘localhost’;

$CONF['database_user'] = ‘postfix’;

$CONF['database_password'] = ‘postfixadmin’;

$CONF['database_name'] = ‘postfix’;

Rename /var/www/webmail/config/db.inc.dist.php to /var/www/webmail/config/db.inc.php and also rename main.inc.dist.php to main.inc.php.

In file db.inc.php edit the line: $rcmail_config['db_dsnw'] = ‘mysql://roundcube:pass@localhost/roundcubemail’; to match your created database and user.

Edit the main.inc.dist.php and change $rcmail_config['enable_installer'] = false; to true.

You also need to chmod logs/ and temp/ to 777

Step 9.

After all config files are correctly setup, we need to start/restart the services.

  • service httpd restart
  • service postfix restart
  • service dovecot restart

Next, point your web-browser of choice to http://pfadmin.domain.tld/setup.php and run through the steps there. If you followed this howto so far, everything should be working fine.

When you create a setup password, you need to take the ‘hash’ value and edit /var/www/pfadmin/config.inc.php. Change the line: $CONF['setup_password'] = ‘changeme’;

When you are done with the setup process, login with the user account you just created and add first a virtual domain, then a mailbox.

Next, go to http://webmail.domain.tld/installer/ and run through the setup process, change the values so they correspond to your setup, and when you are done with the setup, change the $rcmail_config['enable_installer'] = true; line in main.inc.php to false.

You should now be able to logon with the created mailbox from pfadmin. Remember to use mail@domain.tld to logon with.

If you want to use an email program like Outlook, Windows Mail, Thunderbird etc, remember to check that outgoing mailserver needs authentication, and use the same username and password as used to logon to the mailserver with.

 

This should be it; and if everything is set up correctly, you now have a functioning mail server with IMAP/POP3 support.

This how-to does not include spam-assassin, but will probably be updated to also include it shortly.

 

Comments, suggestions, missing steps? Please enter them below.

Well, as you have entered my corner of the internet, I hope you find what you are looking for.

I’m currently working on a howto for Postfix, Dovecot, PFAdmin and RoundCube Webmail, and I hope to have it finished sometime tonight.

 

My hope is that it will be the first of several howtos, but the howtos will be added at my discretion, or if someone have a nice howto they want posted here, they can send it to me for review. All howto’s that are submitted will be credited to the submitter.