Making a Blackberry out of my Nokia N95

I finally found a working solution to the problem of getting all my email accounts in one single place and also getting it “pushed” to my cellphone. I will give you all the steps but YMMV. Basically,what we need is to setup a mail server.

  1. I have a yahoo ,a gmail and my ISP email(comcast). I have to somehow fetch all the mail from these services to my server. Yahoo however sucks coz you have to pay to get access to your email via the POP protocol so what I did is just forward all my mails to my other accounts ,I chose gmail. Fetching Gmail and Comcast using fetchmail is pretty straightforward , so I’ll leave that to another post.
  2. Install a mail server. I already have MTA ,which is Postfix which I already got working for local delivery so All I need left is a POP/IMAP server. For these,I tried Cyrus,courier and Dovecot,stay away from Cyrus ,SASL is a PITA to setup..I am using Dovecot,much much simpler to setup and well documented configs.
  3. Make sure if you have a firewall that you open up the right ports for imap,imaps,pop,smtp .Also don’t forget the server itself coz sometimes there are firewalls installed like fail2ban and moblock.
  4. I use Imap on my N95 coz it’s much simpler to manage and you also get the “push email” functionality like that of the Blackberry. Just go to messaging and enter your server details . And one very important thing I noticed, Most of the time when accessing your mail It would like it gets stuck in “Updating Mailbox ” but actually it is synchronizing the folders . So have “PATIENCE”. If it really takes a while try to trim down the folders that one is subscribing to and try again.

Here are my configs.

My dovecot.conf:

protocols = imap imaps managesieve
disable_plaintext_auth = yes
shutdown_clients = yes
log_timestamp = "%Y-%m-%d %H:%M:%S "
ssl = yes
ssl_cert_file = /etc/ssl/ca/certs/dovecot.pem
ssl_key_file = /etc/ssl/ca/private/dovecot.pem
mail_location = maildir:~/Maildir
namespace private {
separator = .
prefix = INBOX.
inbox = yes
}
mail_privileged_group = mail
protocol imap {
mail_executable = /usr/lib/dovecot/rawlog /usr/lib/dovecot/imap
imap_idle_notify_interval = 120
imap_client_workarounds = delay-newmail netscape-eoh outlook-idle
}
protocol managesieve {
}
protocol lda {
auth_socket_path = /var/run/dovecot/auth-master
postmaster_address = root@localhost
mail_plugins = sieve
global_script_path = /home/vmail/globalsieverc
}
auth default {
mechanisms = plain login
passdb pam {
args = blocking=yes
}
userdb passwd {
args = blocking=yes
}
user = root
socket listen {
master {
path = /var/run/dovecot/auth-master
mode = 0600
}
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
}
dict {
}
plugin {
sieve=~/.dovecot.sieve
}

My postfix main.cf:

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_security_level = may
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
smtpd_tls_received_header = yes
smtpd_tls_cert_file = /etc/ssl/ca/certs/postfix.pem
smtpd_tls_key_file = /etc/ssl/ca/private/postfix.pem
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_loglevel = 1
myhostname = devsphoto.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname , localhost, localhost.localdomain
relayhost = [smtp.comcast.net]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.1.0/24
mailbox_command = /usr/lib/dovecot/deliver
mailbox_size_limit = 0
home_mailbox = Maildir/
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
transport_maps = hash:/etc/postfix/transport
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
local_recipient_maps =
smtpd_tls_auth_only = no
receive_override_options = no_address_mappings
content_filter = smtp-amavis:[127.0.0.1]:10024

Leave a Reply