smtp problem

Discussion in 'Installation/Configuration' started by z.y, Mar 30, 2006.

  1. z.y

    z.y New Member

    I installed FC4 as a mail server. Then I used Outlook to test it. The POP3 (incoming email) was passed, however, the outgoing (SMTP, port 25) failed. I got the error message:
    The TCP/IP connection was unexpectedly terminated by the server.(server: '192.168.2.214', Error Number 0x800ccc0f).

    I checked the server using nmap localhost, I got the following output:
    Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2006-03-30 16:36 EST
    Interesting ports on mail1.avensys.ca (127.0.0.1):
    (The 1652 ports scanned but not shown below are in state: closed)
    PORT STATE SERVICE
    21/tcp open ftp
    22/tcp open ssh
    25/tcp open smtp
    80/tcp open http
    110/tcp open pop3
    111/tcp open rpcbind
    143/tcp open imap
    443/tcp open https
    993/tcp open imaps
    995/tcp open pop3s
    3306/tcp open mysql

    It seems that smtp port 25 is open.

    I also use netstat -tap to get the following result:
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 *:imaps *:* LISTEN 1767/xinetd
    tcp 0 0 *:pop3s *:* LISTEN 1767/xinetd
    tcp 0 0 *:mysql *:* LISTEN 1870/mysqld
    tcp 0 0 *:pop3 *:* LISTEN 1767/xinetd
    tcp 0 0 *:imap *:* LISTEN 1767/xinetd
    tcp 0 0 *:sunrpc *:* LISTEN 1554/portmap
    tcp 0 0 *:ftp *:* LISTEN 1946/proftpd: (acce
    tcp 0 0 192.168.2.214:5335 *:* LISTEN 1720/mDNSResponder
    tcp 0 0 192.168.2.214:smtp *:* LISTEN 1937/master
    tcp 0 0 *:http *:* LISTEN 1962/httpd
    tcp 0 0 *:ssh *:* LISTEN 1759/sshd
    tcp 0 0 *:https *:* LISTEN 1962/httpd
    tcp 0 144 ::ffff:192.168.2.214:ssh ::ffff:192.168.2.40:4817 ESTABLISHED 2647/0

    I saw smtp was listening.
    What's wrong with me? Any suggestion?
    Thanks a lot.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you get any errors in your mail log?
     
  3. z.y

    z.y New Member

    The mail log in /var/log/maillog likes this:

    Mar 30 11:17:09 mail1 postfix/smtpd[10183]: connect from mail1.avensys.ca[127.0.0.1]
    Mar 30 11:17:09 mail1 ipop3d[10185]: pop3 service init from 192.168.2.40
    Mar 30 11:17:09 mail1 ipop3d[10185]: Mailbox vulnerable - directory /var/spool/mail must have 1777 protection
    Mar 30 11:17:09 mail1 ipop3d[10185]: Login user=zyan host=[192.168.2.40] nmsgs=0/0
    Mar 30 11:17:09 mail1 ipop3d[10185]: Mailbox vulnerable - directory /var/spool/mail must have 1777 protection
    Mar 30 11:17:09 mail1 ipop3d[10185]: Logout user=zyan host=[192.168.2.40] nmsgs=0 ndele=0
    Mar 30 11:17:27 mail1 postfix/smtpd[10183]: disconnect from mail1.avensys.ca[127.0.0.1]
    Mar 30 11:20:22 mail1 ipop3d[10199]: pop3 service init from 192.168.2.76
    Mar 30 11:20:22 mail1 ipop3d[10199]: Mailbox vulnerable - directory /var/spool/mail must have 1777 protection
    Mar 30 11:20:22 mail1 ipop3d[10199]: Login user=zyan host=[192.168.2.76] nmsgs=0/0

    What does the 'Mailbox vulnerable - directory /var/spool/mail must have 1777 protection' mean?

    Thanks.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Please run
    Code:
    chmod 1777 /var/spool/mail
    However, this does not affect your sending problem. Can you post a log excerpt from when you try to send a mail?
     
  5. z.y

    z.y New Member

    I can deliver mail within local machine. For example, use command line:
    [root@mail1 ~]# mail paul
    the account paul can receive the test mail. I can see this in maillog file:

    Mar 23 09:37:15 mail1 postfix/pickup[13761]: 19004290F9B: uid=500 from=<zyan>
    Mar 23 09:37:15 mail1 postfix/cleanup[13841]: 19004290F9B: message-id=<[email protected]>
    Mar 23 09:37:15 mail1 postfix/qmgr[1945]: 19004290F9B: from=<[email protected]>, size=307, nrcpt=1 (queue active)
    Mar 23 09:37:15 mail1 postfix/local[13843]: 19004290F9B: to=<[email protected]>, orig_to=<paul>, relay=local, delay=0, status=sent (delivered to mailbox)
    Mar 23 09:37:15 mail1 postfix/qmgr[1945]: 19004290F9B: removed

    I just found some errors in the /var/log/maillog file, but only occurred from yesterday:
    Mar 31 01:38:43 mail1 postfix/qmgr[3015]: 38838290F9B: from=<[email protected]>, size=295, nrcpt=1 (queue active)
    Mar 31 01:38:43 mail1 postfix/smtp[5895]: fatal: unknown service: smtp/tcp
    Mar 31 01:38:44 mail1 postfix/qmgr[3015]: warning: premature end-of-input on private/smtp socket while reading input attribute name
    Mar 31 01:38:44 mail1 postfix/qmgr[3015]: warning: private/smtp socket: malformed response
    Mar 31 01:38:44 mail1 postfix/qmgr[3015]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
    Mar 31 01:38:44 mail1 postfix/master[1937]: warning: process /usr/libexec/postfix/smtp pid 5895 exit status 1
    Mar 31 01:38:44 mail1 postfix/master[1937]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling

    How to solve it?
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Please post your /etc/postfix/master.cf and the output of
    Code:
    grep -i smtp /etc/services
     
  7. z.y

    z.y New Member

    This is the output:
    Bellow is /etc/postfix/master.cf
    Code:
    [root@mail1 postfix]# cat master.cf
    #
    # Postfix master process configuration file.  For details on the format
    # of the file, see the Postfix master(5) manual page.
    #
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    # ==========================================================================
    smtp      inet  n       -       y       -       -       smtpd
    #submission inet n      -       n       -       -       smtpd
    #       -o smtpd_etrn_restrictions=reject
    #       -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #smtps    inet  n       -       n       -       -       smtpd
    #  -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
    #submission   inet    n       -       n       -       -       smtpd
    #  -o smtpd_etrn_restrictions=reject
    #  -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
    #628      inet  n       -       n       -       -       qmqpd
    pickup    fifo  n       -       n       60      1       pickup
    cleanup   unix  n       -       n       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    #qmgr     fifo  n       -       n       300     1       oqmgr
    tlsmgr    unix  -       -       n       1000?   1       tlsmgr
    rewrite   unix  -       -       n       -       -       trivial-rewrite
    bounce    unix  -       -       n       -       0       bounce
    defer     unix  -       -       n       -       0       bounce
    trace     unix  -       -       n       -       0       bounce
    verify    unix  -       -       n       -       1       verify
    flush     unix  n       -       n       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    smtp      unix  -       -       y       -       -       smtp
    # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
    relay     unix  -       -       n       -       -       smtp
            -o fallback_relay=
    #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq     unix  n       -       n       -       -       showq
    error     unix  -       -       n       -       -       error
    discard   unix  -       -       n       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       n       -       -       lmtp
    anvil     unix  -       -       n       -       1       anvil
    scache    unix  -       -       n       -       1       scache
    #
    # ====================================================================
    # Interfaces to non-Postfix software. Be sure to examine the manual
    # pages of the non-Postfix software to find out what options it wants.
    #
    # Many of the following services use the Postfix pipe(8) delivery
    # agent.  See the pipe(8) man page for information about ${recipient}
    # and other message envelope options.
    # ====================================================================
    #
    # maildrop. See the Postfix MAILDROP_README file for details.
    # Also specify in main.cf: maildrop_destination_recipient_limit=1
    #
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
    #
    # The Cyrus deliver program has changed incompatibly, multiple times.
    #
    old-cyrus unix  -       n       n       -       -       pipe
      flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
    # Cyrus 2.1.5 (Amos Gouaux)
    # Also specify in main.cf: cyrus_destination_recipient_limit=1
    cyrus     unix  -       n       n       -       -       pipe
      user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
    #
    # See the Postfix UUCP_README file for configuration details.
    #
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    #
    # Other external delivery methods.
    #
    ifmail    unix  -       n       n       -       -       pipe
      flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    bsmtp     unix  -       n       n       -       -       pipe
      flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
    [root@mail1 postfix]# 
    
    Thanks again.
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Looks ok...
    What's the output of
    Code:
    ls -la /usr/lib/postfix
    ?
     
  9. z.y

    z.y New Member

    No such file on my machine.
    I issued command: find / -name postfix -print
    the ouptput:
    Something wrong with my system files?
     
  10. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -la /usr/libexec/postfix
    ?
     
  11. z.y

    z.y New Member

    The output:
     
  12. falko

    falko Super Moderator Howtoforge Staff

    Looks ok, too... :confused:
     
  13. falko

    falko Super Moderator Howtoforge Staff

    Does /var/spool/postfix/etc/services exist? Your smtpd daemon is running chrooted.
     

Share This Page