gopal
By:
gopal

Unable to receive email sent to myself on localdomain

February 11, 2015 1.9k views

Hi,

I had configured a test based mail server by using postfix,dovecot,mysql,postfixadmin and roundcube for webmail.
Everything seems configured successfully. I am able to login through virtual user which is created in postfixadmin. And the mailboxes are also creating automatically in the maildir location.
Whenever i am trying to send any email to the same user which is logged in, it is sending without any error but the mail is not receiving in inbox. I dont know where the mail are arriving.
I think this is the right place to ask the question and i m sure anyone will help me out with this issue.
Your help will be very appreciable for me.
Thanks
Gopal

4 comments
  • The first thing you will want to do is to review the log files for your mail services. These should provide some insight on what is happening to your message once it is sent. If you can share those details here it would help in determining where you are encountering a problem.

  • Hi,

    After doing some exercise the mails are coming to base mail directory...
    Please have a look of my all .conf files.
    Dovecot.conf
    protocols = imap
    auth_mechanisms = plain
    passdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf
    }
    userdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf
    }

    service auth {
    unix_listener auth-client {
    group = postfix
    mode = 0660
    user = postfix
    }
    user = root
    }

    mail_location = maildir:/home/vmail/%d/%u/%n

    sslcert = </etc/ssl/certs/mail.test.local.crt
    ssl
    key = </etc/ssl/certs/mail.test.local.key

    /dovecot-sql.conf
    driver = mysql
    connect = host=localhost dbname=postfixadmin user=postfix password=nat*nat11

    The new name for MD5 is MD5-CRYPT so you might need to change this depending on version

    defaultpassscheme = MD5-CRYPT

    Get the mailbox

    user_query = SELECT '/home/vmail/%d/%u' as home, 'maildir:/home/vmail/%d/%u' as mail, 5000 AS uid, 5000 AS gid, concat('dirsize:storage=', quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1'

    Get the password

    passwordquery = SELECT username as user, password, '/home/vmail/%d/%u' as userdbhome, 'maildir:/home/vmail/%d/%u' as userdbmail, 5000 as userdbuid, 5000 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'

    If using client certificates for authentication, comment the above and uncomment the following password_query = SELECT null AS password, ‘%u’ AS user

    userquery = SELECT '/home/vmail/%d/%u' as home, 'maildir:/home/vmail/%d/%u' as mail, 5000 AS uid, 5000 AS gid, concat('*:bytes=', quota) AS quotarule FROM mailbox WHERE username = '%u' AND active = '1'
    iterate_query = SELECT username AS user FROM mailbox

    /postfix/main.cf ( Copied only for mail directory location and restriction )

    manpage_directory: The location of the Postfix on-line manual pages.

    manpagedirectory = /usr/share/man
    smtpd
    senderrestrictions = permitmynetworks, rejectauthenticatedsenderloginmismatch, rejectunknownsenderdomain, rejectunlistedsender, rejectunverifiedsender
    smtpd
    recipientrestrictions = permitmynetworks, permitsaslauthenticated, permitauthdestination, rejectunauthdestination, rejectunlistedrecipient, rejectunknownrecipientdomain, rejectnonfqdnrecipient, reject
    smtpddatarestrictions = rejectunauthpipelining, rejectmultirecipientbounce
    smtpd
    etrnrestrictions = reject
    smtpd
    rejectunlistedsender = yes
    disablevrfycommand = yes
    strictrfc821envelopes = yes
    showuserunknowntablename = no
    addressverifysender = <>
    unverifiedsenderrejectcode = 550
    smtpd
    helorequired = yes
    smtp
    alwayssendehlo = yes
    smtpdharderrorlimit = 8
    smtpd
    timeout = 120s
    smtphelotimeout = 60s
    smtpmailtimeout = 60s
    smtprcpttimeout = 90s

    RESTRICTIONS END SMTP AUTH START

    smtpdsaslauthenable = yes
    broken
    saslauthclients = yes
    smtpdsaslsecurityoptions = noanonymous
    smtpd
    saslapplicationname = smtpd

    SMTP AUTH END

    smtpdsenderloginmaps = mysql:/etc/postfix/sender.conf
    virtual
    aliasmaps = mysql:/etc/postfix/alias.conf
    virtual
    mailboxdomains = mysql:/etc/postfix/domain.conf
    virtual
    mailboxmaps = mysql:/etc/postfix/mailbox.conf
    virtual
    mailboxlimitmaps = mysql:/etc/postfix/quota.conf
    virtualmaildirextended=yes
    virtualmailboxlimitoverride=yes
    virtual
    createmaildirsize = yes
    virtual
    overquotabounce = yes
    virtual
    maildirlimitmessage="Sorry, the user's maildir has overdrawn his diskspace quota, please try again later"
    messagesizelimit = 5242880
    virtualmailboxbase = /home/vmail/
    virtualgidmaps = static:5000
    virtualuidmaps = static:5000
    virtualminimumuid = 500

    file 1 for postfix- sender.conf
    user = postfix
    password = nat*nat11

    hosts = localhost
    dbname = postfixadmin
    table = mailbox
    selectfield = username
    where
    field = username
    additional_conditions = and active = '1'

    File 2- Quota.conf
    user = postfix
    password = nat*nat11
    hosts = localhost
    dbname = postfixadmin
    table = mailbox
    selectfield = quota
    where
    field = username
    additional_conditions = and active = '1'

    File3 -- mailbox.conf
    user = postfix
    password = nat*nat11
    hosts = localhost
    dbname = postfixadmin
    table = mailbox
    selectfield = maildir
    where
    field = username
    additional_conditions = and active = '1'

    File4 domain.conf
    user = postfix
    password = nat*nat11
    hosts = localhost
    dbname = postfixadmin
    table = domain
    selectfield = domain
    where
    field = domain
    additional_conditions = and active = '1' and backupmx = '0'

    file5- alias.conf
    user = postfix
    password = nat*nat11

    hosts = localhost
    dbname = postfixadmin
    table = alias
    selectfield = goto
    where
    field = address

    Now the thing is mail should go in maildir:/home/vmail/%d/%u/%n. But it is arriving on /home/vmail only.And mail box are creating /%d/%u correctly. Whenever i am sending any email, mails are arriving in /home/vmail by creating a new mail box with the name of user name .i.e. test@tes.local.

    I need to see alll the emails should come on /home/vmail/domainname/username/

    But this is not happening.

    Please help..

    Thanks
    Gopal

  • Maillog for mail-

    Feb 13 12:10:16 mail postfix/virtual[3674]: 7D0FF1407A7: to=rahul@test.local, relay=virtual, delay=0.25, delays=0.11/0/0/0.13, dsn=5.1.1, status=bounced (unknown user: "rahul@test.local")

    localdomain- test.local

    Thanks
    Gopal

  • i think it was not the right place to ask for help.....

    Any way thanks ...
    will try to another forum..

Be the first one to answer this question.