Hi,
I have been getting problem in receiving emails from both internal (local) and external accounts i.e. Yahoo. I have set up a Mail Server comprising Postfix, Dovecot, OpenLDAP and Squirrelmail on Ubuntu Server 10.04 machine.
I have no problem sending emails out to my yahoo account, but the issue comes up when trying to receive emails back from Yahoo to my local accounts.
Here is the syslog when doing telnet localhost 25
Sep 20 13:59:16 mailserver1 postfix/smtpd[2849]: connect from localhost[127.0.0.1]
Sep 20 14:00:05 mailserver1 postfix/smtpd[2849]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <sam.oneill>: Recipient address rejected: User unknown in local recipient table; from=<sam.oneill> to=<sam.oneill> proto=ESMTP helo=<localhost>
Sep 20 14:05:05 mailserver1 postfix/smtpd[2849]: timeout after RCPT from localhost[127.0.0.1]
I wonder if anyone might be kind to point out where I made mistakes. I really want to make this system to work as I am still learning my way around Linux system.
This is my slapd.conf
Code:
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/nis.schema
include /etc/ldap/schema/inetorgperson.schema
# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile /var/run/slapd/slapd.pid
# List of arguments that were passed to the server
argsfile /var/run/slapd/slapd.args
# Read slapd.conf(5) for possible values
loglevel none
# Where the dynamically loaded modules are stored
modulepath /usr/lib/ldap
moduleload back_hdb
# The maximum number of entries that is returned for a search operation
sizelimit 500
# The tool-threads parameter sets the actual amount of cpu's that is used
# for indexing.
tool-threads 1
#######################################################################
# Specific Backend Directives for hdb:
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
backend hdb
#######################################################################
# Specific Backend Directives for 'other':
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
#backend <other>
#######################################################################
# Specific Directives for database #1, of type hdb:
# Database specific directives apply to this databasse until another
# 'database' directive occurs
database hdb
# The base of your directory in database #1
suffix "dc=mailserver1,dc=example,dc=com"
# rootdn directive for specifying a superuser on the database. This is needed
# for syncrepl.
rootdn "cn=admin,dc=mailserver1,dc=example,dc=com"
rootpw secrets
# Where the database file are physically stored for database #1
directory "/var/lib/ldap"
# For the Debian package we use 2MB as default but be sure to update this
# value if you have plenty of RAM
dbconfig set_cachesize 0 2097152 0
# Number of objects that can be locked at the same time.
dbconfig set_lk_max_objects 1500
# Number of locks (both requested and granted)
dbconfig set_lk_max_locks 1500
# Number of lockers
dbconfig set_lk_max_lockers 1500
# Indexing options for database #1
index objectClass eq
lastmod on
checkpoint 512 30
access to attrs=userPassword,shadowLastChange
by dn="cn=admin,dc=mailserver1,dc=example,dc=com" read
by anonymous auth
by self write
by * none
access to dn.base="" by * read
access to *
by dn="cn=admin,dc=mailserver1,dc=example,dc=com" write
by * read
Here is my base.ldif
Code:
# Tree root
dn: dc=mailserver1,dc=example,dc=com
# objectClass: top
objectClass: dcObject
objectclass: organization
o: mailserver
dc: mailserver1
description: Tree root
# LDAP admin
dn: cn=admin,dc=mailserver1,dc=example,dc=com
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword: {CRYPT}0.GPaHFgOOKVH.
dn: ou=people,dc=mailserver1,dc=example,dc=com
objectClass: organizationalUnit
ou: people
dn: ou=groups,dc=mailserver1,dc=example,dc=com
objectClass: organizationalUnit
ou: groups
dn: ou=accounts,dc=mailserver1,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: accounts
# only necessary if you are NOT using 'bind' authentication
dn: cn=dovecot,ou=accounts,dc=mailserver1,dc=example,dc=com
objectClass: top
objectClass: person
cn: dovecot
sn: dovecot
dn: uid=sam.oneill,ou=accounts,dc=mailserver1,dc=example,dc=com
objectClass: top
objectClass: person
objectClass: posixAccount
cn: Samatha ONeill
sn: oneill
uid: sam.oneill
uidNumber: 1005
gidNumber: 1003
userPassword: {CRYPT}dlUtxwTlowPQgVo
homeDirectory: /home/soneill
Here is ldap-user.cf
Code:
server_host = ldap://localhost
search_base = ou=accounts,dc=mailserver1,dc=example,dc=com
version = 3
query_filter = (&(objectclass=person) (samaccountname=%u))
result_attribute = uid
result_format = %s/Maildir/
bind = yes
bind_dn = cn=admin,dc=mailserver1,dc=example,dc=com
bind_pw = {CRYPT}0.GPaHFgOOKVH.
Here is Postfix main.cf
Code:
myhostname = mailserver1.example.com
mydomain = localdomain
mydestination = $myhostname, localhost
virtual_mailbox_domains = $mydomain
virtual_mailbox_base = /home/vmail/
virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf
virtual_uid_maps = static:1004
virtual_gid_maps = static:1004
relayhost =
mynetworks = 127.0.0.0/8, 192.168.1.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
home_mailbox = Maildir/
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanomymous
smtpd_tls_auth_only = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination,reject_sender_login_mismatch
smtpd_sasl_local_domain = mailserver1.example.com
Here is my dovecot.conf
Code:
protocols = imap
protocol imap {
listen = *:143
}
disable_plaintext_auth = no
log_timestamp = "%Y-%m-%d %H:%M:%S "
ssl = no
login_dir = /var/run/dovecot/login
login_chroot = yes
login_user = dovecot
mail_location = maildir:/home/%u/Maildir
mail_privileged_group = mail
verbose_proctitle = yes
maildir_copy_with_hardlinks = yes
protocol imap {
imap_client_workarounds = outlook-idle delay-newmail netscape-eoh tb-extra-mailbox-sep
}
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
}
protocol managesieve {
}
auth_verbose = yes
auth_debug = yes
auth_debug_passwords = yes
auth default {
mechanisms = plain login
}
passdb ldap {
args = /etc/dovecot/dovecot-ldap.conf
}
userdb prefetch {
}
userdb passwd {
}
userdb ldap {
# Path for LDAP configuration file
args = /etc/dovecot/dovecot-ldap.conf
}
user = root
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
!include_try /etc/dovecot/auth.d/*.auth
}
dict {
}
# Optional configurations, don't give an error if it's not found:
!include_try /etc/dovecot/conf.d/*.conf
#!include_try /etc/dovecot/extra.conf
Here is my dovecot-ldap.conf
Code:
hosts = localhost:389
dn = cn=admin,dc=mailserver1,dc=example,dc=com
dnpass = {CRYPT}0.GPaHFgOOKVH.
auth_bind = no
ldap_version = 3
base = ou=accounts,dc=mailserver1,dc=example,dc=com
deref = never
scope = subtree
user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid
user_filter = (&(objectClass=posixAccount)(uid=%u))
pass_attrs = uid=user,userPassword=password,\
homeDirectory=userdb_home,uidNumber=userdb_uid,gidNumber=userdb_gid
pass_filter = (&(objectClass=posixAccount)(uid=%u))
default_pass_scheme = CRYPT
I hope the above information would be helpful for you to help me out.
Thank you in advance