Courier, Postfix, Squirrelmail Mysql How-To

Discussion in 'HOWTO-Related Questions' started by kresser, Jan 1, 2010.

  1. kresser

    kresser New Member

    Ok, i followed this tutorial to the "T", http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-debian-lenny. I am not able to login to the mailboxes with squirrelmail, it says "connection dropped by imap server" I used the whole address as a login just like it said to do. I can sucessfully authenticate with outlook express but it throws an error that say's arealreason.com/support, no such file or directory. i can telnet into it remotely but when i type ehlo messiah.arealreason.com it just keeps showing all the 250 lines and wont let me generate a message. from what i saw on the comments on the tutorial and googling there are many other people with this problem, however i found no solutions. This is fresh work and i have not touched any config files since finishing the tutorial, so if anyone has this solution it would be greatly appreciated. This server needs to go into production in a few days so let me know. Thx -Rick
     
  2. kresser

    kresser New Member

    Also...

    This is also coming up in mail logs.

    Jan 1 07:33:17 messiah postfix/smtp[46100]: 9331B6E68D87: to=<jim@arealreason.com>, relay=none, delay=0.16, delays=0.15/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

    Jan 1 07:33:47 messiah imapd: Connection, ip=[::ffff:99.196.176.7]
    Jan 1 07:33:51 messiah imapd: chdir arealreason.com/support/: No such file or directory

    Jan 1 07:39:04 messiah postfix/smtp[55258]: 879876E68D82: to=<root@arealreason.com>, orig_to=<root>, relay=none, delay=4739, delays=4739/0.28/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

    Jan 1 08:02:24 messiah postfix/scache[28585]: statistics: start interval Jan 1 07:59:04
    Jan 1 08:02:24 messiah postfix/scache[28585]: statistics: domain lookup hits=0 miss=1 success=0%
    Jan 1 08:02:24 messiah postfix/scache[28585]: statistics: address lookup hits=0 miss=1 success=0%
    :mad:
     
  3. kresser

    kresser New Member

    Some updates...

    I saw where several other people were having this issue and one person went in and manually created his domain folder like /home/vmail/domain/username. I did this the same and it got both of us one step farther. I finally figured out this is a mail folder and permission issue. I can successfuly connect and authenticate with the server with squirrelmail and outlook, squirrelmail gives the imap connection dropped after authenticating and oe says mydomain/account is not there. well i manually created the domain and account folder chowned with vmail properties and i get one step farther but still more folder errors. squirrelmail now shows the 2 frames after login but this error shows in each frame:

    ERROR:
    ERROR: Could not complete request.
    Query: SELECT "INBOX"
    Reason Given: Unable to open this mailbox.

    I know alot of people had this problem and i would be so grateful if someone could help me fix the folder problems and direct me in the right direction as to fix them being automatically created. the sending an email to the box didnt work.
     
  4. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    It seems as if amavisd isn't running. Please restart it and send the welcome mail again.
     
  5. kresser

    kresser New Member

    you were right about amavis, still wont start...

    Ran this:

    messiah:~# /etc/init.d/amavis start
    Starting amavisd: amavisd-new.
    messiah:~#

    Didn't know if there was supposed to be more information on loading than what it gave.

    Also even after i give it the start sig, if i send restart it says this:

    messiah:~# /etc/init.d/amavis restart
    Stopping amavisd: (not running).
    Starting amavisd: amavisd-new.

    Still says "connection refused" in logs.

    I need some guidance on where to start looking for the problem...

    Thx in advance.
     
  6. kresser

    kresser New Member

    ok need help.

    I googled amavis wont start, and found out it does that right out of the box now. I guess a package problem.

    So... i decided to just try without it. I commented out the lines that was added to main.cf and master.cf. Restarted the server, now when i send an email i get this error msg:

    Jan 3 04:56:20 messiah postfix/virtual[14245]: ECDA26E68DE0: to=<support@arealreason.com>, relay=virtual, delay=0.18, delays=0.1/0/0/0.08, dsn=5.1.1, status=bounced (unknown user: "support@arealreason.com")

    and for the first time i am getting messages back from from my mail server saying message undeliverable....

    hmm.
     
  7. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Does support@arealreason.com exist in your database?
     
  8. kresser

    kresser New Member

    yup its in the sql database and oe will authenticate with it when i manually add the folder's /home/vmail/arealreason.com and /home/vmail/arealreason.com/support and chown then with vmail:vmail it keeps throwing folder errors.
    Without the folders it says /arealreason.com/support No such file or directory.
    But if i comment out the lines for postfix to use amavis and apt-get remove amavsd-new and reboot the vps. when i send an email from an outside account it says support is an unknown user. So...I'm going to use a debian lenny installation to recreate the problem at home on one of my esxi servers at home to continue figuring out how to fix this. but so far the ONLY TUTORIAL i have got working on lenny is at debianadmin.com but it uses standard system users and i need a sql server up that will easily support thousands of email accounts. I've tried the ispconfig 3 tutorial and many others on lenny that have all failed, a few i know now because of amavis. So i think my only option is to try etch on the vps because i need a working mail server right now. The weird thing is that with the whole setup done on lenny as you described in your tutorial it will store all the incoming messages on the mail server its just amavis wont run to let it make the folders after an email is recieved. So i want to leave this thread open to try to resolve the problem on one of my vm's so other people will know after the problem is resolved. As google returned ALOT of people with my same problem. Thx for your support falko.
     
    Last edited: Jan 3, 2010
  9. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    I know that the tutorial is working, so there must be something wrong on your server. What kind of virtualization technique do you use (OpenVZ/Virtuozzo, KVM, Xen, VMware, etc.)?
     
  10. kresser

    kresser New Member

    Problems...

    Well, i have been using a vps that uses a veportal management page, i don't know what underlying software they use for virtualization. I use VMware esxi one my 1u's in my lab, i always have vmware tools installed on the vm's. I have discovered a few problems that add to the issue's. For the record if anyone that reads this doesn't know, mysql has problems using some special characters in the mysql passwords. I had a $ in my passwords which caused root@localhost acces denied, but im having tons of problems on every tutorial i've done with amavis. It seems it never wants to start up. I have used quite a few of your tutorials which are very well put together might i add. I just switched over from using microsoft 1 year ago, so i guess you could say i'm a little new but i've been into ubuntu debian suse and openbsd head deep since then. Is amavis a REQUIREMENT to use the ispconfig 3 tutorial? also the vps is amd64 hardware, and my lab servers are intel 64bit running esxi 64 bit with mostly 32bit vm's. I trust your tutorials work, it's just working out my own bugs thats a headache. Once again, Falko thank you for your support.
     
  11. kresser

    kresser New Member

    A note on VPS's to help others...

    I didn't know this until now, but while doing "the perfect server" i always kept getting stuck on the quota part so usually i skipped it but as i need it so greedy clients dont end up using all my disk space. My vps is on a open vz platform and in order to use the quota feature i had to open a support ticket with my vps provider and have them enable it. and the remount command will not work as open vz does not allow those permissions for the client so you must reboot the machine. Hope this helps someone!
     
  12. kresser

    kresser New Member

    Finally getting somewhere.

    I used this tutorial and everything is working except amavis, i almost want to say its official that amavis installs broken, once this issue is resolved i will post the solution for other users then close the thread. Thanks Falko! oh and by the way, its not always your fault, other users dont have the heart to deal with the amount of freedom linux offers! keep up the great work!
     
  13. kresser

    kresser New Member

    <sigh/>

    Well no help from google on amavis all i know is i wont start, falko any ideas?

    The server connects with imap fine, checks mail fine just nothing there, tries to send mail i just never get it, that may be a seperate issue, squirrelmail logs in and does just the same just fine, amavis is killing me though...
     
  14. kresser

    kresser New Member

    amavis ?

    Is amavis a real high load daemon, i would think it is being a scanner and all, well my vps only has 512 ram as i got it for testing purposes, but if this could be the issue im upgrading the vps package anyways. I found after running /etc/init.d/amavis debug its showing segmentation fault, is that memory related. well should have new vps package tomorrow, well see.
     
  15. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    What's the output of
    Code:
    cat /proc/user_beancounters
    ?
     
  16. kresser

    kresser New Member

    Thank You!

    Well after getting the vps upgraded all of the mail in queue hit my box as amavis started just fine, really greatful for all your help <FALKO> i can send and recieve with ease now. I hope this thread helps somebody. And i take back what i said about amavis not working out of the box, was just a lack of resources!
     
  17. rakeshakurathi

    rakeshakurathi New Member

    ERROR: Connection dropped by IMAP server

    i was breaking my head to solve this probs from 2 days i cant take it any more
    please any one help me urgent

    this is my mail log,
    i can send mails from mailx, but when i send mail to one of the user from gmail account it bounces back with delivery notification,
    in this log i have tried to connect through thunderbird which resulted in error ,even squirrelmail doesnt work,
    i don know what is the problem


    i followed http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu9.04-p5
    please guys help me any information is helpful

    i have done all the steps 4 times and i dint get any error all the telnet sessions gave me the exact output as in the tutorial. please any one help me....


    log file:-
    Jan 11 00:30:41 exampleserver authdaemond: authmysql: MYSQL_SERVER nor MYSQL_SOCKET set in/etc/courier/authmysqlrc.
    Jan 11 00:30:41 exampleserver authdaemond: authmysql: TEMPFAIL - no more modules will be tried
    Jan 11 00:30:41 exampleserver imapd: LOGIN FAILED, method=PLAIN, ip=[::ffff:90.152.67.122]
    Jan 11 00:30:41 exampleserver imapd: authentication error: Input/output error
    Jan 11 00:31:53 exampleserver postfix/smtpd[4360]: connect from eba.b.xyar.se[xxx.xxx.xx.xx]
    Jan 11 00:31:53 exampleserver postfix/smtpd[4360]: lost connection after CONNECT from eba.b.xyar.se[xxx.xxx.xx.xx]
    Jan 11 00:31:53 exampleserver postfix/smtpd[4360]: disconnect from eba.b.xyar.se[xxx.xxx.xx.xx]
    Jan 11 00:32:34 exampleserver postfix/anvil[4363]: statistics: max connection rate 2/60s for (smtp:90.152.67.122) at Jan 11 00:26:56
    Jan 11 00:32:34 exampleserver postfix/anvil[4363]: statistics: max connection count 1 for (smtp:xxx.xxx.xx.xx) at Jan 11 00:22:34
    Jan 11 00:32:34 exampleserver postfix/anvil[4363]: statistics: max cache size 2 at Jan 11 00:26:44
    Jan 11 00:32:34 exampleserver postfix/smtpd[4360]: connect from eba.b.xyar.se[xxx.xxx.xx.xx]
    Jan 11 00:32:34 exampleserver postfix/smtpd[4360]: lost connection after CONNECT from eba.b.xyar.se[xxx.xxx.xx.xx]
    Jan 11 00:32:34 exampleserver postfix/smtpd[4360]: disconnect from eba.b.xyar.se[xxx.xxx.xx.xx]
    Jan 11 00:33:34 exampleserver postfix/smtpd[4360]: connect from eba.b.xyar.se[xxx.xxx.xx.xx]
    Jan 11 00:33:34 exampleserver postfix/smtpd[4360]: lost connection after CONNECT from eba.b.xyar.se[xxx.xxx.xx.xx]
    Jan 11 00:33:34 exampleserver postfix/smtpd[4360]: disconnect from eba.b.xyar.se[xxx.xxx.xx.xx]
    Jan 11 00:34:01 exampleserver imapd: Connection, ip=[::1]
    Jan 11 00:34:01 exampleserver authdaemond: received auth request, service=imap, authtype=login
    Jan 11 00:34:01 exampleserver authdaemond: authmysql: trying this module
    Jan 11 00:34:01 exampleserver authdaemond: authmysql: MYSQL_SERVER nor MYSQL_SOCKET set in/etc/courier/authmysqlrc.
    Jan 11 00:34:01 exampleserver authdaemond: authmysql: TEMPFAIL - no more modules will be tried
    Jan 11 00:34:01 exampleserver imapd: LOGIN FAILED, user=amin@exampleserver.se, ip=[::1]
    Jan 11 00:34:01 exampleserver imapd: authentication error: Input/output error
     
  18. kresser

    kresser New Member

    I had to go through 4 or 5 tutorials myself before i got one right, i just finished "the perfect server" tutorial by falko, by the way mad props to him he's knows his stuff. I ran into many many problems and i'll do my best to offer any assistance i can. Let me clarify a few things, you cant login to outlook or thunderbird, or squirrelmail? but the "basic" method from the console on the server lets you send? show your postfix config so we can look it over for errors, might help diagnose the problem. its located at /etc/postfix/main.cf , also when you try to login via outlook or thunderbird what error does it give, the whole message not just the error code, and do you get past the password authentication? Also try going into account options and checking my server requires authentication, also i noticed this in your logs Jan 11 00:34:01 exampleserver authdaemond: authmysql: MYSQL_SERVER nor MYSQL_SOCKET set in/etc/courier/authmysqlrc.

    Did you follow that part in the tutorial right, go and double check all the parts where you do mysql commands. I found out while doing mine that mysql does not accept passwords that have special characters in them, so make sure you dont, hope this helps some.
     
  19. rakeshakurathi1

    rakeshakurathi1 New Member

    hey this is rakeshakurathi thanks for ur help

    i would be very thank ful to u if u help me ...

    yup i have done all the steps 4 times. nothing seems to be wrong everything is same as all the telnet debugging sessions are the exact copy of the tutorials

    when i try to login from squirrel mail it says
    ERROR: Connection dropped by IMAP server.

    when i try to login from thunderbird it says username and password are invalid.

    and earlier i have posted the mail.log file for these cases



    Code:
     See /usr/share/postfix/main.cf.dist for a commented, more complete version
    
    
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP $mail_name
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    delay_warning_time = 4h
    
    readme_directory = /usr/share/doc/postfix
    
    # TLS parameters
    #smtp_use_tls = no
    smtp_tls_security_level = may
    smtpd_use_tls = yes
    smtpd_tls_security_level = may
    #smtpd_tls_auth_only = no
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    #smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    #smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    
    #myhostname = eba.b.xyar.se
    myhostname = exampleserver.se
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    #myorigin = /etc/mailname
    myorigin =exampleserver.se
    #mydestination = exampleserver.se, eba.b.xyar.se, localhost.d.ipeer.se, localhost
    local_recipient_maps =
    mydestination = exampleserver.se, localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8
    mynetworks_style = host
    mailbox_command =
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    masquerade_domains = mail.exampleserver.se
    
    
    # how long if undelivered before sending warning update to sender
    delay_warning_time = 4h
    # will it be a permanent error or temporary
    unknown_local_recipient_reject_code = 450
    # how long to keep message on queue before return as failed.
    # some have 3 days, I have 16 days as I am backup server for some people
    # whom go on holiday with their server switched off.
    maximal_queue_lifetime = 7d
    # max and min time in seconds between retries if connection failed
    minimal_backoff_time = 1000s
    maximal_backoff_time = 8000s
    # how long to wait when servers connect before receiving rest of data
    smtp_helo_timeout = 60s
    # how many address can be used in one message.
    # effective stopper to mass spammers, accidental copy in whole address list
    # but may restrict intentional mail shots.
    smtpd_recipient_limit = 16
    # how many error before back off.
    smtpd_soft_error_limit = 3
    # how many max errors before blocking it.
    smtpd_hard_error_limit = 12
    
    
    # Requirements for the HELO statement
    smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname,
                    reject_invalid_hostname, permit
    # Requirements for the sender details
    smtpd_sender_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_sender,
                    reject_unknown_sender_domain, reject_unauth_pipelining, permit
    # then add these
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    # Requirements for the connecting server
    smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org,
                    reject_rbl_client blackholes.easynet.nl,
                    reject_rbl_client dnsbl.njabl.org
    # Requirement for the recipient address
    #smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks,
    #               reject_non_fqdn_recipient, reject_unknown_recipient_domain,
    #               reject_unauth_destination, permit
    #               smtpd_data_restrictions = reject_unauth_pipelining
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    
    # require proper helo at connections
    smtpd_helo_required = yes
    # waste spammers time before rejecting them
    smtpd_delay_reject = yes
    disable_vrfy_command = yes
    
    # not sure of the difference of the next two
    # but they are needed for local aliasing
    alias_maps = hash:/etc/postfix/aliases
    alias_database = hash:/etc/postfix/aliases
    # this specifies where the virtual mailbox folders will be located
    virtual_mailbox_base = /home/vmail
    # this is for the mailbox location for each user
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    # and their user id
    virtual_uid_maps = static:5000
    # and group id
    virtual_gid_maps = static:5000
    # and this is for aliases
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    # and this is for domain lookups
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    # this is how to connect to the domains (all virtual, but the option is there)
    # not used yet
    # transport_maps = mysql:/etc/postfix/mysql_transport.cf
    content_filter = amavis:[127.0.0.1]:10024
    home_mailbox = Maildir/
    html_directory = /usr/share/doc/postfix/html
    virtual_alias_domains =
    smtpd_sasl_authenticated_header = yes
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_maildir_extended = yes
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    receive_override_options = no_address_mappings
    
     
  20. rakeshakurathi1

    rakeshakurathi1 New Member

     

Share This Page