Announcement

Collapse
No announcement yet.

IMAP problem

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    IMAP problem

    I'm trying got set up a mailserver on my kubuntu dapper drake 6.06.1 but it doesn't work.
    I can't login to IMAP via telnet or squirrelmail. Can anyone help me?
    I followed the howto on this page: http://www.urbanpuddle.com/articles/...n-about-1-hour

    Here are exerpts of the files I can think of right now that may be useful. (domain name, user and passwords have been edited out)

    syslog:
    Nov 13 12:15:20 hostname imaplogin: Connection, ip=[::ffff:127.0.0.1]
    Nov 13 12:15:25 hostname imaplogin: LOGIN FAILED, ip=[::ffff:127.0.0.1]
    Nov 13 12:15:25 hostname imaplogin: LOGOUT, ip=[::ffff:127.0.0.1]

    mail.log:
    Nov 13 13:40:11 hostname imaplogin: Connection, ip=[::ffff:127.0.0.1]
    Nov 13 13:40:16 hostname imaplogin: LOGIN FAILED, ip=[::ffff:127.0.0.1]
    Nov 13 13:40:16 hostname imaplogin: LOGOUT, ip=[::ffff:127.0.0.1]

    mysql.log
    9 Connect mail_admin@localhost on
    9 Init DB mail
    9 Query SELECT email, password, "", 5000, 5000, /home/vmail, "", "", "", "" FROM users WHERE email = "user@domain.com"
    9 Quit

    Postfix-main.cf:
    #myorigin = /etc/mailname
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    append_dot_mydomain = no
    #delay_warning_time = 4h
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    myhostname = mail.domain.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = mail.domain.com, localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    virtual_alias_domains =
    virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service inet:127.0.0.1:60000
    transport_maps = mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_mailbox_extended = yes
    virtual_mailbox_limit_maps = 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

    Courier-authdaemonrc:
    authmodulelist="authmysql"
    authmodulelistorig="authcustom authcram authuserdb authldap authpgsql authmysql authpam"
    daemons=5
    version=""
    authdaemonvar=/var/run/courier/authdaemon

    Courier-authmysqlrc:
    MYSQL_SERVER localhost
    MYSQL_USERNAME mail_admin
    MYSQL_PASSWORD ********
    # MYSQL_SOCKET /var/run/mysqld/mysqld.sock
    MYSQL_PORT 0
    MYSQL_OPT 0
    MYSQL_DATABASE mail
    MYSQL_USER_TABLE users
    MYSQL_CRYPT_PWFIELD password
    # MYSQL_CLEAR_PWFIELD password
    # DEFAULT_DOMAIN example.com
    MYSQL_UID_FIELD 5000
    MYSQL_GID_FIELD 5000
    # SELECT MYSQL_UID_FIELD, MYSQL_GID_FIELD, ... WHERE id='loginid'
    MYSQL_LOGIN_FIELD email
    MYSQL_HOME_FIELD /home/vmail
    #MYSQL_NAME_FIELD name
    # MYSQL_MAILDIR_FIELD maildir
    MYSQL_MAILDIR_FIELD
    CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
    # MYSQL_DEFAULTDELIVERY defaultdelivery
    # MYSQL_QUOTA_FIELD quota
    # MYSQL_AUXOPTIONS_FIELD auxoptions
    # MYSQL_WHERE_CLAUSE server='mailhost.example.com'

    Courier-imapd.cnf:
    RANDFILE = /usr/lib/courier/imapd.rand

    [ req ]
    default_bits = 1024
    encrypt_key = yes
    distinguished_name = req_dn
    x509_extensions = cert_type
    prompt = no

    [ req_dn ]
    C=US
    ST=NY
    L=New York
    O=Courier Mail Server
    OU=Automatically-generated IMAP SSL key
    CN=localhost
    emailAddress=postmaster@example.com

    [ cert_type ]
    nsCertType = server

    Squirrelmail-config.php
    global $version;
    $config_version = '1.4.0';
    $config_use_color = 2;
    $org_name = "Domain";
    $org_logo = SM_PATH . 'images/sm_logo.png';
    $org_logo_width = '308';
    $org_logo_height = '111';
    $org_title = "SquirrelMail $version";
    $signout_page = '';
    $frame_top = '_top';
    $provider_uri = 'http://www.squirrelmail.org/';
    $provider_name = 'SquirrelMail';
    $motd = "";
    $squirrelmail_default_language = 'en_US';
    $default_charset = 'iso-8859-1';
    $lossy_encoding = false;
    $domain = 'domain.com';
    $imapServerAddress = 'localhost';
    $imapPort = 143;
    $useSendmail = false;
    $smtpServerAddress = 'localhost';
    $smtpPort = 25;
    $sendmail_path = '/usr/sbin/sendmail';
    $pop_before_smtp = false;
    $imap_server_type = 'courier';
    $invert_time = false;
    $optional_delimiter = '.';
    $encode_header_key = '';
    $default_folder_prefix = 'INBOX.';
    $trash_folder = 'Trash';
    $sent_folder = 'Sent';
    $draft_folder = 'Drafts';
    $default_move_to_trash = true;
    $default_move_to_sent = true;
    $default_save_as_draft = true;
    $show_prefix_option = false;
    $list_special_folders_first = true;
    $use_special_folder_color = true;
    $auto_expunge = true;
    $default_sub_of_inbox = false;
    $show_contain_subfolders_option = false;
    $default_unseen_notify = 2;
    $default_unseen_type = 1;
    $auto_create_special = true;
    $delete_folder = true;
    $noselect_fix_enable = false;
    $data_dir = '/var/lib/squirrelmail/data/';
    $attachment_dir = '/var/spool/squirrelmail/attach/';
    $dir_hash_level = 0;
    $default_left_size = '150';
    $force_username_lowercase = false;
    $default_use_priority = true;
    $hide_sm_attributions = false;
    $default_use_mdn = true;
    $edit_identity = true;
    $edit_name = true;
    $hide_auth_header = false;
    $allow_thread_sort = false;
    $allow_server_sort = false;
    $allow_charset_search = true;
    $uid_support = true;
    .
    .
    .
    $default_use_javascript_addr_book = false;
    $abook_global_file = '';
    $abook_global_file_writeable = false;
    $addrbook_dsn = '';
    $addrbook_table = 'address';
    $prefs_dsn = '';
    $prefs_table = 'userprefs';
    $prefs_user_field = 'user';
    $prefs_key_field = 'prefkey';
    $prefs_val_field = 'prefval';
    $addrbook_global_dsn = '';
    $addrbook_global_table = 'global_abook';
    $addrbook_global_writeable = false;
    $addrbook_global_listing = false;
    $no_list_for_subscribe = false;
    $smtp_auth_mech = 'none';
    $imap_auth_mech = 'login';
    $use_imap_tls = false;
    $use_smtp_tls = false;
    $session_name = 'SQMSESSID';
    @include SM_PATH . 'config/config_local.php';

    Shorewall-rules:
    #ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/
    # PORT PORT(S) DEST LIMIT GROUP
    ACCEPT net fw icmp 8
    ACCEPT fw net icmp
    ACCEPT net fw tcp ssh,www,https,smtp,pop3,pop3s,imap2,imaps,submissi on
    ACCEPT net fw tcp 20,21
    ACCEPT net fw tcp 5800:5899,5900:5999
    ACCEPT net fw udp 5800:5899,5900:5999
    ACCEPT net fw tcp 10000
    #SECTION ESTABLISHED
    #SECTION RELATED
    #SECTION NEW
    #LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE

    Let me know if you need any more info. I need help! I actually use these addresses, it's not just an experiment...

    #2
    Re: IMAP problem

    Nevermind...I fixed it myself.
    I threw out courier and installed dovecot
    sudo apt-get install dovecot-common
    sudo apt-get install dovecot-pop3d
    sudo apt-get install dovecot-imapd
    sudo /etc/init.d/dovecot restart
    sudo joe /etc/shorewall/rules
    ACCEPT net fw tcp 89
    REDIRECT net 25 tcp 89
    sudo /etc/init.d/shorewall restart
    //mail sendes ut og kommer inn medn vises ikke i squirrelmail
    Then I set the mailbox path in dovecot to /var/mail under ~mail
    and the mailbox path in postfix to default (var/something)

    Now it works just fine

    Comment

    Working...
    X