LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Dovecot & Postfix SASL Issues (https://www.linuxquestions.org/questions/linux-server-73/dovecot-and-postfix-sasl-issues-796714/)

tomehb 03-20-2010 01:23 PM

Dovecot & Postfix SASL Issues
 
Hi guys,

I've just installed and configured Dovecot and Postfix.
When testing it from a client machine using outlook the connection is successful to IMAP using TLS, however when attempting to connect to the SMTP the connection is refused.
Quote:

Send test e-mail message: Outlook cannot connect to your outgoing (SMTP) e-mail server. If you continue to receive this message, contact your server administrator or Internet service provider (ISP).

Configuration file for Dovecot /etc/dovecot/dovecot.conf
Code:

## Dovecot configuration file
protocols = imaps
listen = *
shutdown_clients = yes
log_timestamp = "%Y-%m-%d %H:%M:%S "
ssl_disable = no
ssl_cert_file = /CA/tomehb.co.uk/certs/tomehb-servercrt.pem
ssl_key_file = /CA/tomehb.co.uk/private/tomehb-serverkey.pem
login_greeting = Dovecot ready.
mail_privileged_group = mail

protocol imap {

}
 
protocol pop3 {
        pop3_uidl_format = %08Xu%08Xv
}

protocol lda {
        postmaster_address = postmaster@webmail.tomehb.co.uk
        log_path = /var/vmail/dovecot-deliver.log
        hostname = webmail.tomehb.co.uk
        auth_socket_path = /var/run/dovecot/auth-master
          mail_plugins = cmusieve
        global_script_path = /var/vmail/globalsieverc
 }



#auth_verbose = no
#auth_debug = no

auth default {
        mechanisms = plain login
       
        passdb sql {
                args = /etc/dovecot/dovecot-sql.conf
        }

        userdb static {
                args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
        }
 
        user = root

        #ssl_require_client_cert = no
        #ssl_username_from_cert = no

        socket listen {
                master {
                        path = /var/run/dovecot/auth-master
                          mode = 0600
                        user = vmail # User running Dovecot LDA
                        group = mail # Or alternatively mode 0660 + LDA user in this group
                }
                client {
                        path = /var/spool/postfix/private/auth
                        #path = /var/run/dovecot/auth-client
                        mode = 0660
                        user = postfix
                        group = postfix
                }
        }
}



dict {

}

plugin {

}

After starting dovecot, I checked to see if the file had been created... which it had been..

Quote:

root@tomehb:/etc/dovecot# ls -l /var/spool/postfix/private/auth
srw-rw---- 1 postfix postfix 0 2010-03-20 17:01 /var/spool/postfix/private/auth


Configuration file for Postfix /etc/postfix/main.cf

Code:

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
queue_directory = /var/spool/postfix
# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
# TLS parameters
smtpd_tls_cert_file=/CA/tomehb.co.uk/certs/tomehb-servercrt.pem
smtpd_tls_key_file=/CA/tomehb.co.uk/private/tomehb-serverkey.pem
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

#vhost with mysql params
#virtual_alias_domains needs to be unset
virtual_alias_domains =

virtual_mailbox_domains = mysql:/etc/postfix/virtual/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/virtual/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/virtual/mysql-virtual-alias-maps.cf, mysql:/etc/postfix/virtual/mysql-virtual-email2email.cf
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1


myhostname = webmail.tomehb.co.uk
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $myhostname
mydestination = webmail.tomehb.co.uk, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
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
smtpd_sasl_security_options = noanonymous



I've checked a few logs and found nothing, what do you guys suggest I should do next? and can you spot any mistakes that I've made...


Cheers

Thomas

smoker 03-20-2010 01:36 PM

Is port 25 open on the server ?

tomehb 03-20-2010 01:57 PM

Quote:

Originally Posted by smoker (Post 3905726)
Is port 25 open on the server ?

Indeed,

lsof -i tcp:25
Quote:

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
master 26172 root 11u IPv4 87707 TCP *:smtp (LISTEN)
netstat -lp
Quote:

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:smtp *:* LISTEN 26172/master
sending an email from the host, as its not restricted..)
Quote:

220 webmail.tomehb.co.uk ESMTP Postfix (Debian/GNU)
HELO localhost
250 webmail.tomehb.co.uk
MAIL FROM:<thomas@webmail.tomehb.co.uk>
250 2.1.0 Ok
RCPT TO:<tomehb@gmail.com>
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Hello, this is a test email
.
250 2.0.0 Ok: queued as 75C60E2913

When I telneted, the warning log said the following....

Code:

Mar 20 19:16:05 tomehb.co.uk postfix/tlsmgr[29803]: warning: request to update table btree:/var/spool/postfix/smtpd_scache in non-postfix directory /var/spool/postfix
Mar 20 19:16:05 tomehb.co.uk postfix/tlsmgr[29803]: warning: redirecting the request to postfix-owned data_directory /var/lib/postfix
Mar 20 19:16:07 tomehb.co.uk postfix/tlsmgr[29803]: warning: request to update table btree:/var/spool/postfix/smtp_scache in non-postfix directory /var/spool/postfix
Mar 20 19:16:07 tomehb.co.uk postfix/tlsmgr[29803]: warning: redirecting the request to postfix-owned data_directory /var/lib/postfix

Would that be related to the issue?**** Now Fixed the above messages, but still can not use the SMTP server from anywhere other than localhost...



-------------- Another Update

When I receive emails I get the following warnings, again I believe this is unrelated (Email is delivered correctly)....

Quote:

Mar 20 20:03:07 tomehb.co.uk postfix/trivial-rewrite[4389]: warning: do not list domain webmail.tomehb.co.uk in BOTH virtual_mailbox_domains and relay_domains
Mar 20 20:03:28 tomehb.co.uk postfix/trivial-rewrite[4389]: warning: do not list domain webmail.tomehb.co.uk in BOTH virtual_mailbox_domains and relay_domains


All times are GMT -5. The time now is 02:17 PM.