problem with Cron & Email on Centos install

Discussion in 'ISPConfig 3 Priority Support' started by abintipl, Jul 24, 2013.

  1. abintipl

    abintipl Member

    Hi,

    I have set up latest Ispconfig3 with Centos 6.4 with the help as per tutorial http://www.howtoforge.com/perfect-server-centos-6.4-x86_64-apache2-dovecot-ispconfig-3-p3

    I have these 2 issues: Cron & Email

    1. Cron: I have added 2 cron jobs in Ispconfig panel,

    output in root for
    crontab - e is as under;

    * * * * * /usr/local/ispconfig/server/server.sh &> /dev/null
    30 00 * * * /usr/local/ispconfig/server/cron_daily.sh &> /dev/null

    tail -5 /var/log/cron

    [root@ ~]# tail -5 /var/log/cron
    Jul 24 03:32:01 cp CROND[13636]: (root) CMD (/usr/local/ispconfig/server/server.sh &> /dev/null)
    Jul 24 03:32:05 cp crontab[13650]: (root) BEGIN EDIT (root)
    Jul 24 03:33:01 cp CROND[13654]: (root) CMD (/usr/local/ispconfig/server/server.sh &> /dev/null)
    Jul 24 03:33:01 cp CROND[13655]: (web3) CMD (/usr/bin/php -f /var/www/clients/client1/web3/web/admin/cron/cron.php #cp.mydomain.com)
    Jul 24 03:33:09 cp crontab[13650]: (root) END EDIT (root)
    [root@cp ~]#

    My question about Cron are

    1.when I Set up Cron job in Ispconfig are they suppose to get added automatically in crontab -e
    2. Do you have instructions to install Cron for Centos 6.4, whereas the tutorial does not talk about Cron Settings

    Question about Email, while installation when I was on Step # 11

    Error#

    [root@cp ~]# chkconfig --levels 235 sendmail off
    error reading information on service sendmail: No such file or directory

    [root@cp ~]# /etc/init.d/sendmail stop
    -bash: /etc/init.d/sendmail: No such file or directory

    PS: I did not install Mailman, As I do not need it.

    While on Step # 23 Install SquirrelMail
    After SquirrelMail Installation & defined settings

    Now you can type in http://server1.example.com/webmail or http://192.168.0.100/webmail in your browser to access SquirrelMail.

    I get redirected to
    https://198.168.0.100/webmail/src/redirect.php

    with an Error "ERROR: Connection dropped by IMAP server."

    Please advice

    Thanks
     
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Regarding cron:

    The cron jobs are created in separate files in the /etc/cron.d/ directory.
     
  3. abintipl

    abintipl Member

    Hi,

    Thank you, I can see both the crons setup are showing in /etc/cron.d/ directory

    Further to my Email ISSUE, I did these steps as per Instructions
    Finally we need to tell Dovecot to use the dovecot.conf file generated by ISPConfig - /etc/dovecot.conf - and not the default /etc/dovecot/dovecot.conf:

    cd /etc/dovecot
    mv dovecot.conf dovecot.conf_orig
    ln -s ../dovecot.conf dovecot.conf
    /etc/init.d/dovecot restart

    Now when I access email account on https://198.168.0.100/webmail

    Now the Error shows as
    Error connecting to IMAP server: localhost.
    111 : Connection refused
    Go to the login page

    [root@ log]# tail -f /var/log/maillog looks like

    Jul 24 06:03:00 cp postfix/qmgr[26838]: 8E7D3E52C7: from=<[email protected]>, size=676, nrcpt=1 (queue active)
    Jul 24 06:03:00 cp postfix/qmgr[26838]: 1732DE52C3: from=<[email protected]>, size=653, nrcpt=1 (queue active)
    Jul 24 06:03:00 cp postfix/smtp[27823]: connect to mail.mydomain.com[198.168.0.100]:25: Connection refused
    Jul 24 06:03:00 cp postfix/smtp[27824]: connect to mail.mydomain.com[198.168.0.100]:25: Connection refused


    Thanks
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats ok.

    The error for in the log you posted is apostfix error (port 25) and not a dovecot error.

    Please post theoutput of:

    netstat -tap
     
  5. abintipl

    abintipl Member

    Sir,

    Here is output

    [root@~]# netstat -tap
    [root@cp ~]# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address Stat
    e PID/Program name
    tcp 0 0 *:mysql *:* LISTEN 27199/mysqld
    tcp 0 0 localhost.locald:submission *:* LISTEN 26835/master
    tcp 0 0 localhost.localdomain:urd *:* LISTEN 26835/master
    tcp 0 0 *:ftp *:* LISTEN 26626/pure-ftpd (SE
    tcp 0 0 ns2.mydomain.com:domain *:* LISTEN 1244/named
    tcp 0 0 ns1.mydomain.com:domain *:* LISTEN 1244/named
    tcp 0 0 vps1.mydomain.com:domain *:* LISTEN 1244/named
    tcp 0 0 p.mydomain.com:domain *:* LISTEN 1244/named
    tcp 0 0 localhost.localdomai:domain *:* LISTEN 1244/named
    tcp 0 0 *:ssh *:* LISTEN 1314/sshd
    tcp 0 0 localhost.localdomain:smtp *:* LISTEN 26835/master
    tcp 0 0 localhost.localdomain:rndc *:* LISTEN 1244/named
    tcp 0 264 p.mydomain.com:ssh xx.XX.xx:XX077 ESTA
    BLISHED 12313/sshd
    tcp 0 0 *:webcache *:* LISTEN 26866/httpd
    tcp 0 0 *:http *:* LISTEN 26866/httpd
    tcp 0 0 *:tproxy *:* LISTEN 26866/httpd
    tcp 0 0 *:ftp *:* LISTEN 26626/pure-ftpd (SE
    tcp 0 0 *:domain *:* LISTEN 1244/named
    tcp 0 0 *:ssh *:* LISTEN 1314/sshd
    tcp 0 0 ::1:rndc *:* LISTEN 1244/named
    tcp 0 0 *:https *:* LISTEN 26866/httpd
    [root@p]#
     
    Last edited: Jul 24, 2013
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Seems as if postfix is listening only on localhost, edit the /etc/postfix/main.cf file and set:

    inet_interfaces = all

    Regarding dovecot, it seems as if dovecot is not started. Please run:

    /etc/init.d/dovecot start

    an post any error that you get on the screen or in the mail.log when it is not starting successfully.
     
  7. abintipl

    abintipl Member

    Sir,

    Thank you for your reply.

    On my set up;

    inet_interfaces = all was set to localhost which I changed to all

    As per your recommendation

    /etc/init.d/dovecot start

    output is

    [root@~]# /etc/init.d/dovecot start
    You have new mail in /var/spool/mail/root

    After that I tried
    [root@p ~]# /etc/init.d/dovecot restart
    Stopping Dovecot Imap: [FAILED]

    Mail log is as under;

    [root@p ~]# tail -f /var/log/maillog
    Jul 24 13:55:01 p postfix/smtpd[8452]: lost connection after CONNECT from localhost.localdomain[127.0.0.1]
    Jul 24 13:55:01 p postfix/smtpd[8452]: disconnect fromlocalhost.localdomain[127.0.0.1]
    Jul 24 13:58:00 p postfix/qmgr[26838]: 6D882E532A: from=<[email protected]>, size=612, nrcpt=1 (queue active)
    Jul 24 13:58:00 p postfix/smtp[8522]: 6D882E532A: to<[email protected]>, relay=none, delay=46559, delays=46559/0.01/0.13/0, dsn=5.4.6, status=bounced (mail for mydomain.com loops back to myself)
    Jul 24 13:58:00 p postfix/cleanup[8524]: C6C98E52BD: message-id=<[email protected]>
    Jul 24 13:58:00 p postfix/bounce[8523]: 6D882E532A: sender non-delivery notification: C6C98E52BD
    Jul 24 13:58:00 p postfix/qmgr[26838]: C6C98E52BD: from=<>, size=2392, nrcpt=1(queue active)
    Jul 24 13:58:00 cp postfix/qmgr[26838]: 6D882E532A: removed
    Jul 24 13:58:00 cp postfix/local[8525]: C6C98E52BD: to <[email protected]>, relay=local, delay=0.08, delays=0.04/0/0/0.03, dsn=2.0.0, status=sent (delivered tomailbox)
    Jul 24 13:58:00 p postfix/qmgr[26838]: C6C98E52BD: removed


    Thanks & regards,

    Abin
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you have the domain mydomain.com somewhere in /etc/mailname, /etc/postfix/main.cf or do you use it as hostname? The hostname or mailnae of a server has to be a subdomain like server1.mydomain.com as described in the perfect setup guides, if you used mydomain.com instaed, the mail system will fail.
     
  9. abintipl

    abintipl Member

    Dear Sir,

    Thank you for your reply.


    yes, my hostname is p.mydomain.com( like server1.mydomain.com) as explained in perfect guide

    Here are the outputs

    vi /etc/hosts

    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost
    198.168.0.100 p.mydomain.com p
    198.168.0.101 ns1.mydomain.com ns1
    198.168.0.102 ns2.mydomain ns2

    Further, I can not see /etc/mailname

    /etc/postfix/main.cf Output is under;

    #soft_bounce = no

    # LOCAL PATHNAME INFORMATION
    queue_directory = /var/spool/postfix
    command_directory = /usr/sbin
    daemon_directory = /usr/libexec/postfix
    data_directory = /var/lib/postfix

    # QUEUE AND PROCESS OWNERSHIP
    mail_owner = postfix
    #myhostname = host.domain.tld
    #myhostname = virtual.domain.tld

    # The mydomain parameter specifies the local internet domain name.
    # The default is to use $myhostname minus the first component.
    # $mydomain is used as a default value for many other configuration
    # parameters.
    #
    #mydomain = domain.tld

    # SENDING MAIL
    #myorigin = $myhostname
    #myorigin = $mydomain

    # RECEIVING MAIL

    #inet_interfaces = all
    #inet_interfaces = $myhostname
    #inet_interfaces = $myhostname, localhost
    inet_interfaces = all

    # Enable IPv4, and IPv6 if supported
    inet_protocols = all

    #proxy_interfaces =
    #proxy_interfaces = 1.2.3.4

    # See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
    #
    mydestination = $myhostname, localhost.$mydomain, localhost
    #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
    # mail.$mydomain, www.$mydomain, ftp.$mydomain

    # REJECTING MAIL FOR UNKNOWN LOCAL USERS
    #local_recipient_maps = unix:passwd.byname $alias_maps
    #local_recipient_maps = proxy:unix:passwd.byname $alias_maps
    #local_recipient_maps =

    unknown_local_recipient_reject_code = 550

    # TRUST AND RELAY CONTROL

    # Specify "mynetworks_style = host" when Postfix should "trust"
    # only the local machine.

    #mynetworks_style = class
    #mynetworks_style = subnet
    #mynetworks_style = host

    #mynetworks = 168.100.189.0/28, 127.0.0.0/8
    #mynetworks = $config_directory/mynetworks
    #mynetworks = hash:/etc/postfix/network_table

    # The relay_domains parameter restricts what destinations this system will
    # relay mail to. See the smtpd_recipient_restrictions description in
    # postconf(5) for detailed information.

    #relay_domains = $mydestination

    #relayhost = $mydomain
    #relayhost = [gateway.my.domain]
    #relayhost = [mailserver.isp.tld]
    #relayhost = uucphost
    #relayhost = [an.ip.add.ress]

    # REJECTING UNKNOWN RELAY USERS
    #
    #relay_recipient_maps = hash:/etc/postfix/relay_recipients

    # INPUT RATE CONTROL
    #
    # TRANSPORT MAP
    #
    #alias_maps = dbm:/etc/aliases
    alias_maps = hash:/etc/aliases
    #alias_maps = hash:/etc/aliases, nis:mail.aliases
    #alias_maps = netinfo:/aliases

    # The alias_database parameter specifies the alias database(s) that
    # are built with "newaliases" or "sendmail -bi". This is a separate
    # configuration parameter, because alias_maps (see above) may specify
    # tables that are not necessarily all under control by Postfix.
    #
    #alias_database = dbm:/etc/aliases
    #alias_database = dbm:/etc/mail/aliases
    alias_database = hash:/etc/aliases
    #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases

    # ADDRESS EXTENSIONS (e.g., user+foo)
    #recipient_delimiter = +

    # DELIVERY TO MAILBOX
    #
    #home_mailbox = Mailbox
    #home_mailbox = Maildir/

    #mail_spool_directory = /var/mail
    #mail_spool_directory = /var/spool/mail

    # ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
    #
    #mailbox_command = /some/where/procmail
    #mailbox_command = /some/where/procmail -a "$EXTENSION"

    #mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp

    # mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
    # local_destination_recipient_limit = 300
    # local_destination_concurrency_limit = 5
    #
    #luser_relay = [email protected]
    #luser_relay = [email protected]
    #luser_relay = admin+$local

    # JUNK MAIL CONTROLS
    #fast_flush_domains = $relay_domains

    #smtpd_banner = $myhostname ESMTP $mail_name
    #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)

    # Each message delivery transport has its #local_destination_concurrency_limit = 2
    #default_destination_concurrency_limit = 20

    # DEBUGGING CONTROL
    debug_peer_level = 2

    #debug_peer_list = 127.0.0.1
    #debug_peer_list = some.domain

    #
    debugger_command =
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    ddd $daemon_directory/$process_name $process_id & sleep 5

    #
    sendmail_path = /usr/sbin/sendmail.postfix

    newaliases_path = /usr/bin/newaliases.postfix

    mailq_path = /usr/bin/mailq.postfix

    setgid_group = postdrop

    html_directory = no

    manpage_directory = /usr/share/man

    sample_directory = /usr/share/doc/postfix-2.6.6/samples

    readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

    Thanks
     
  10. abintipl

    abintipl Member

    Dear Sir,

    I have reinstalled server setup but my email still not working on Centos6.4

    my server host is 198.100.1.100 mail.mydomian.com mail
    hostname - mail.mydomain.com

    [root@mail ~]# /etc/init.d/dovecot restart
    Stopping Dovecot Imap: [ OK ]
    Starting Dovecot Imap: [ OK ]
    [root@mail ~]#

    Other instructions provided in this post already taken care of

    [root@mail ~]# tail -f /var/log/maillog

    Jul 27 09:32:01 mail dovecot: pop3-login: Error: Timeout waiting for handshake from auth server. my pid=11788, input bytes=0
    Jul 27 09:32:01 mail dovecot: auth: Error: Can't open configuration file /etc/dovecot-sql.conf: No such file or directory
    Jul 27 09:32:01 mail dovecot: log: Error: service(auth): child 11877 returned error 89 (Fatal failure)
    Jul 27 09:32:01 mail dovecot: master: Error: service(auth): command startup failed, throttling
    Jul 27 09:32:16 mail clamd[20973]: SelfCheck: Database status OK.
    Jul 27 09:32:36 mail dovecot: pop3-login: Error: Timeout waiting for handshake from auth server. my pid=11788, input bytes=0
    Jul 27 09:32:59 mail dovecot: master: Warning: Killed with signal 15 (by pid=11942 uid=0 code=kill)
    Jul 27 09:33:00 mail dovecot: pop3-login: Error: auth: connect(login) failed: Connection refused
    Jul 27 09:33:00 mail dovecot: master: Dovecot v2.0.9 starting up (core dumps disabled)
    Jul 27 09:33:01 mail dovecot: pop3-login: Disconnected: Inactivity (no auth attempts): rip=127.0.0.1, lip=127.0.0.1, secured
    Jul 27 09:35:01 mail dovecot: imap-login: Disconnected (no auth attempts): rip=127.0.0.1, lip=127.0.0.1, secured
    Jul 27 09:35:01 mail postfix/smtpd[12162]: connect from localhost.localdomain[127.0.0.1]
    Jul 27 09:35:01 mail dovecot: auth: Error: Can't open configuration file /etc/dovecot-sql.conf: No such file or directory
    Jul 27 09:35:01 mail dovecot: log: Error: service(auth): child 12165 returned error 89 (Fatal failure)
    Jul 27 09:35:01 mail dovecot: master: Error: service(auth): command startup failed, throttling
    Jul 27 09:35:01 mail postfix/smtpd[12162]: fatal: no SASL authentication mechanisms
    Jul 27 09:35:02 mail postfix/smtpd[12187]: connect from localhost.localdomain[127.0.0.1]
    Jul 27 09:35:02 mail postfix/master[8369]: warning: process /usr/libexec/postfix/smtpd pid 12162 exit status 1
    Jul 27 09:35:02 mail postfix/master[8369]: warning: /usr/libexec/postfix/smtpd:bad command startup -- throttling
    Jul 27 09:35:12 mail postfix/smtpd[12187]: fatal: no SASL authentication mechanisms
    Jul 27 09:35:13 mail postfix/master[8369]: warning: process /usr/libexec/postfix/smtpd pid 12187 exit status 1


    What wrong steps I have done, any clue please/

    Thanks & regards,

    Abin
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Seems as if ispconfig is not or not fully installed. please download the ispconfig tar.gz again, unpack it and run the update.php script which is in the sinatll folder if you are sure that you installed ispconfig. If you did not install ispconfig yet, then please use the install.php script instead.
     
  12. abintipl

    abintipl Member

    Sir,

    I solved this problem by making following changes which are posted in comments in the end of the tutorial

    it stats that "/etc/dovecot-sql.conf" is not found thats true the file is in /etc/dovecot/dovecot-sql.conf
    open /etc/dovecot/dovecot.conf and replace.
    passdb {
    ## args = /etc/dovecot-sql.conf
    args = /etc/dovecot/dovecot-sql.conf
    driver = sql
    }
    userdb {
    ## args = /etc/dovecot-sql.conf
    args = /etc/dovecot/dovecot-sql.conf
    driver = sql
    }

    Thanks a lot for your support

    Regards,
    Abin
     

Share This Page