Beginners problem with Postfix.

Discussion in 'Server Operation' started by mejborn, Feb 14, 2007.

  1. mejborn

    mejborn New Member

    Hey, my first postin theese forums, so please correct me if iam doing anything wrong.

    And by the way, great site!

    I've have followed this Howto:
    http://howtoforge.com/virtual_postfix_mysql_quota_courier

    But I ran into a wall somewhere in the configuration. I've completed the how to, and there was no errors in the setup (i guess).

    But when i try to login, the users don't exists (i am trying with telnet host 110/25/143).

    My log files contains the following:

    compark:/var/log# cat mail.err

    Feb 14 16:47:03 compark imaplogin: LOGIN FAILED, ip=[::ffff:127.0.0.1]
    Feb 14 16:48:27 compark postfix/smtp[16935]: fatal: unexpected command-line argument: 127.0.0.1:10025
    Feb 14 17:10:50 compark postfix/smtp[16950]: fatal: unexpected command-line argument: 127.0.0.1:10025
    Feb 14 17:44:10 compark postfix/smtp[17087]: fatal: unexpected command-line argument: 127.0.0.1:10025
    Feb 14 18:50:50 compark postfix/smtp[17107]: fatal: unexpected command-line argument: 127.0.0.1:10025
    compark:/var/log#

    compark:/var/log# cat mail.info
    Feb 14 18:50:50 compark postfix/qmgr[16506]: 031B6B89E: from=<root@compark.dk>, size=279, nrcpt=1 (queue active)
    Feb 14 18:50:50 compark postfix/smtp[17107]: fatal: unexpected command-line argument: 127.0.0.1:10025
    Feb 14 18:50:51 compark postfix/qmgr[16506]: warning: premature end-of-input on private/amavis socket while reading input attribute name
    Feb 14 18:50:51 compark postfix/qmgr[16506]: warning: private/amavis socket: malformed response
    Feb 14 18:50:51 compark postfix/master[16503]: warning: process /usr/lib/postfix/smtp pid 17107 exit status 1
    Feb 14 18:50:51 compark postfix/master[16503]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling
    Feb 14 18:50:51 compark postfix/qmgr[16506]: 031B6B89E: to=<mathias@compark.dk>, relay=none, delay=7345, status=deferred (delivery temporarily suspended: mail transport unavailable)

    mail.log contains the same errors as mail.info, the same goes for mail.warn.

    The only place where i doesn't follow the how to is in:

    2 Apply Quota Patch To Postfix

    Can these errors have anything to do with this?

    I hope some of you can guide me through the setup:)

    Regards
    Mejborn
     
  2. mejborn

    mejborn New Member

    This is what i am getting from the ehlo localhost:

    Connected to localhost.
    Escape character is '^]'.
    220 compark.dk ESMTP Postfix (Debian/GNU)
    ehlo localhost
    250-compark.dk
    250-PIPELINING
    250-SIZE 10240000
    250-VRFY
    250-ETRN
    250-STARTTLS
    250-AUTH LOGIN PLAIN
    250-AUTH=LOGIN PLAIN
    250 8BITMIME
     
  3. mejborn

    mejborn New Member

    Now i got a little bit longer.

    I've chanced the mysql-virtual_domains.cf
    So the select_field = 'domain' instead of 'virtual' as it was in the howto.

    Then i manually added the directories in /home/vmail and did a chown, i followed a users comment to the howto it now looks like this:

    compark:/home/vmail/compark.dk/mathias/Maildir# ls -l
    totalt 12
    drwx------ 2 vmail vmail 4096 2007-02-14 21:50 cur
    drwx------ 2 vmail vmail 4096 2007-02-14 21:50 new
    drwx------ 2 vmail vmail 4096 2007-02-14 21:50 tmp

    now when is do a telnet localhost pop3 i get the following:

    compark:/home/vmail/compark.dk/mathias/Maildir# telnet localhost pop3
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    +OK Hello there.
    user mathias@compark.dk
    +OK Password required.
    pass XXXXX
    -ERR Maildir invalid (no 'cur' directory)
    Connection closed by foreign host.
    compark:/home/vmail/compark.dk/mathias/Maildir#

    Anyone that can help me?
     
  4. falko

    falko Super Moderator

    Have you compared all your configuration files with those from the tutorial? Maybe you made a typo somewhere?
     
  5. mejborn

    mejborn New Member

    Hey falko.

    Yes I have compared my configurations files with thosefrom the howto, but maybe I'll should do it again.
    The "funny" thing is that now i am able to login with imap, but still not with pop3 (i stille get the same error as described earlier). But with imap it looks like this:

    compark@compark:~$ telnet localhost 143
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2004 Double Precision, Inc. See COPYING for distribution information.
    a login mathias@compark.dk XXXX
    a OK LOGIN Ok.
    a logout
    * BYE Courier-IMAP server shutting down
    a OK LOGOUT completed
    Connection closed by foreign host.
    compark@compark:~$

    I think it's strange that imap does not complain about the "cur" directory when pop3 does. But I will check my configurations files again.
     
  6. falko

    falko Super Moderator

    What's the output of
    Code:
    netstat -tap
    ?
    Please make sure your /etc/courier/authmysqlrc (especially the formatting) looks like the one from the tutorial.
     
  7. mejborn

    mejborn New Member

    The output from netstat -tap:

    compark:/home/compark# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 localhost:10024 *:* LISTEN 3133/amavisd (maste
    tcp 0 0 *:714 *:* LISTEN 3500/rpc.statd
    tcp 0 0 localhost:mysql *:* LISTEN 3311/mysqld
    tcp 0 0 *:sunrpc *:* LISTEN 2999/portmap
    tcp 0 0 compark.dk:www *:* LISTEN 3463/rinetd
    tcp 0 0 *:smtp *:* LISTEN 3457/master
    tcp6 0 0 *:imaps *:* LISTEN 3224/couriertcpd
    tcp6 0 0 *:pop3s *:* LISTEN 3244/couriertcpd
    tcp6 0 0 localhost:8005 *:* LISTEN 3682/java
    tcp6 0 0 *:8009 *:* LISTEN 3682/java
    tcp6 0 0 *:15051 *:* LISTEN 3484/sshd
    tcp6 0 0 *:pop3 *:* LISTEN 3232/couriertcpd
    tcp6 0 0 *:imap2 *:* LISTEN 3200/couriertcpd
    tcp6 0 0 *:8180 *:* LISTEN 3682/java
    tcp6 0 0 *:smtp *:* LISTEN 3457/master
    tcp6 0 48 compark.dk:15051 50A2F0EC.flatrate:52835 ESTABLISHED4740/sshd: compark
    tcp6 0 0 compark.dk:49848 efnet.pte.hu:ircd ESTABLISHED3551/java
    compark:/home/compark#

    My /etc/courier/authmysqlrc:

    YSQL_SERVER localhost
    MYSQL_USERNAME mail_admin
    MYSQL_PASSWORD XXXX
    MYSQL_PORT 0
    MYSQL_DATABASE mail
    MYSQL_USER_TABLE users
    MYSQL_CRYPT_PWFIELD password
    #MYSQL_CLEAR_PWFIELD password
    MYSQL_UID_FIELD 5000
    MYSQL_GID_FIELD 5000
    MYSQL_LOGIN_FIELD email
    MYSQL_HOME_FIELD "/home/vmail"
    MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
    #MYSQL_NAME_FIELD
    MYSQL_QUOTA_FIELD quota

    I am using nano is there anyway that I can check for newlines in this configuration file (newlines is not allowed right?).

    Or can mc (midnight commander) or any other editor show me this?
     
  8. falko

    falko Super Moderator

    Newlines (aka linebreaks) are allowed, otherwise you'd have everything in one line. What is not allowed are Windows linebreaks. When you open a file with Windows linebreaks in vi or nano, each line has something like ^M at the end. If you use Unix linebreaks, the line should look ok.
     
  9. mejborn

    mejborn New Member

    Ok but i copy/pasted the hole howto, into nano and saved it. So it should be ok. Was my authmysqlrc fine?
     
  10. falko

    falko Super Moderator

    Yes, looks ok.
    Please double-chack all configuration files, maybe there's a typo somewhere.

    Do you still get this -ERR Maildir invalid (no 'cur' directory) error? What's the output of
    Code:
    ls -la /home/vmail/compark.dk/mathias/Maildir
    now?
     
  11. mejborn

    mejborn New Member

    Yes I'll still get the error, when I try to login via pop3.

    I have checked the configuration files, and it all looks fine to me, I also copy/pasted all from the howto, so there was less chances for errors.

    The output from ls -la /home/vmail/compark.dk/mathias/Maildir is:

    compark:/home/compark# ls -la /home/vmail/compark.dk/mathias/Maildir
    totalt 20
    drwx------ 5 vmail vmail 4096 2007-02-14 21:50 .
    drwxr-xr-x 3 vmail vmail 4096 2007-02-14 21:50 ..
    drwx------ 2 vmail vmail 4096 2007-02-14 21:50 cur
    drwx------ 2 vmail vmail 4096 2007-02-14 21:50 new
    drwx------ 2 vmail vmail 4096 2007-02-14 21:50 tmp
    compark:/home/compark#
     
  12. astewart

    astewart ISPConfig Developer

    I have a few questions here and a couple of issues.

    Question 1.
    Do I have to maunally create the "maildir" for every new Site I add? And is the Location of the Maildir in "var/www/web1" or in the Users home directory, "/var/www/web1/user/web1_user1/"?

    I have no problems setting up the POP, which everything is working fine, no problems receiving...

    I can create IMAP accounts, no problems authenticating, but they do not receive E-mails, in Webmail and in OE....
    The E-mails sent to the to the pop account do NOT show up either in webmail.

    I get this message when Telnetting into the IMAP Server:
    telnet> open 192.168.2.9 143
    Trying 192.168.2.9...
    Connected to 192.168.2.9.
    Escape character is '^]'.
    * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2005 Double Precision, Inc. See COPYING for distribution information.


    I've made sure that I have opened Port 143 on the IPCONFIG firewall and My Router but still no difference.

    My output from netstat -tap:

    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 localhost:2208 *:* LISTEN 3 879/hpiod
    tcp 0 0 localhost:51524 *:* LISTEN 3 888/python
    tcp 0 0 *:mysql *:* LISTEN 4 014/mysqld
    tcp 0 0 *:10000 *:* LISTEN 5 100/perl
    tcp 0 0 *:81 *:* LISTEN 4 689/ispconfig_http
    tcp 0 0 localhost:ipp *:* LISTEN 1 5414/cupsd
    tcp 0 0 *:smtp *:* LISTEN 4 93/master
    tcp6 0 0 *:imaps *:* LISTEN 4 147/couriertcpd
    tcp6 0 0 *:pop3s *:* LISTEN 4 186/couriertcpd
    tcp6 0 0 *:pop3 *:* LISTEN 4 162/couriertcpd
    tcp6 0 0 *:imap2 *:* LISTEN 4 125/couriertcpd
    tcp6 0 0 *:www *:* LISTEN 1 5381/apache2
    tcp6 0 0 *:ftp *:* LISTEN 3 72/proftpd: (accep
    tcp6 0 0 *:ssh *:* LISTEN 4 434/sshd
    tcp6 0 0 *:smtp *:* LISTEN 4 93/master
    tcp6 0 0 *:https *:* LISTEN 1 5381/apache2
    ESTABLISHED2 0097/0


    Here are my postconf -n stats:

    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    append_dot_mydomain = no
    biff = no
    broken_sasl_auth_clients = yes
    config_directory = /etc/postfix
    home_mailbox = Maildir/
    inet_interfaces = all
    inet_protocols = all
    mailbox_command =
    mailbox_size_limit = 0
    mydestination = /etc/postfix/local-host-names
    mynetworks = 127.0.0.0/8,192.168.2.0/24,24.215.88.2/32
    myorigin = /etc/mailname
    recipient_delimiter = +
    relayhost = smtp.eastlink.ca
    smtp_tls_note_starttls_offer = yes
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    smtp_use_tls = yes
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_local_domain =
    smtpd_sasl_security_options = noanonymous
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_auth_only = no
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtpd_tls_session_cache_timeout = 3600s
    smtpd_use_tls = yes
    tls_random_source = dev:/dev/urandom


    Can anyone help me out here?
    Thanks!
     
  13. falko

    falko Super Moderator

    Please open a new thread for this!
     
  14. falko

    falko Super Moderator

    I'm sorry, but I don't know what wrong with your system. :(
     
  15. mejborn

    mejborn New Member

    Ohh noo I was afraid of getting that answer :(

    Anyway thanks for the help Falko!
     

Share This Page