Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail Debian Lenny

Discussion in 'HOWTO-Related Questions' started by metfan, Jul 27, 2010.

  1. metfan

    metfan New Member

    Hello,

    First thanks for the tutorial, , but I have some trouble with it.
    I test it 3 times on my server and different VM, but I always have same error.

    - 1st:
    On page 2 I don't understand (I'm a beginner) which configuration I must use in file /etc/aliases
    Code:
    postmaster: root
    root: postmaster@ks358431.kimsufi.com
    clamav: root
    
    - 2nd :
    I sent welcome mail but any directory was created.

    - 3rd:
    according to my log I have trouble with clamav:
    Code:
    Jul 27 17:00:48 ks358431 postfix/smtp[27947]: 90F2CC12F: to=<ulrich@live-pics.net>, relay=127.0.0.1[127.0.0.1]:10024, delay=7.1, delays=0.02/0/0/7.1, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451-4.5.0 Error in processing, id=25888-07, virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 86) line 309.; ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan unexpected exit 50, output="LibClamAV Warning: *********************************************************** 451-4.5.0 LibClamAV Warning: ***  This version of the ClamAV engine is outdated.     *** 451-4.5.0 LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq *** 451-4.5.0 LibClamAV Warning: *********************************************************** 451-4.5.0 LibClamAV Error: cli_hex2str(): Malformed hexstring: This ClamAV version has reached End of Life! Please upgrade to version 0.95 or later. For more information see  www.clamav.net/eol-clamav-094 and www.clamav.net/download (length: 169) 451-4.5.0 LibClamAV Error: Problem parsing database at line 738 451-4.5.0 LibClamAV Error: Can't load daily.ndb: Malformed database 451-4.5.0 LibClamAV Error: cli_tgzload: Can't load daily.ndb 451-4.5.0 LibClamAV Error: Can't load /var/lib/clamav//daily.cld: Malformed database 451 4.5.0 ERROR: Malformed database" at (eval 86) line 527. (in reply to end of DATA command))
    
    - 4th
    when I try to log on squirrelmail I have this error: "ERROR: Connection dropped by IMAP server."
    I supposed it's link to my 2nd problem.

    I hope some of you will take time to help me.

    Thanks
     
  2. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Any errors in /var/log/mail.log?

    Regarding the ClamAV error: add
    Code:
    deb [url]http://volatile.debian.org/debian-volatile[/url] lenny/volatile main contrib non-free
    to /etc/apt/sources.list and run
    Code:
    apt-get update
    
    apt-get install clamav clamav-daemon
     
  3. metfan

    metfan New Member

    Hello,

    Thanks for info, clamav is working weel now.

    I didn't reply because I stayed update of DNS.
    Unfortunately, I have again one problem: 'alias database loop for postmaster'

    this is my mail.log:
    Thanks for your help.
     
  4. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    First you should add mail.live-pics.net to the mydestination line in /etc/postfix/main.cf.

    Please post your /etc/aliases file.
     
  5. metfan

    metfan New Member

    Hello,

    Do I need to add mail.domain.tld on postfix destination to all domaine name I will setup a mail?

    I spoted my aliases file on first post.
     
  6. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    No.

    Is postmaster@ks358431.kimsufi.com a local account, or is it on a remote mailserver?
     
  7. metfan

    metfan New Member

    -> If I don't need to put mail.domain.tld for all domain i will setup a mail service, why I need to add mail.live-pics.net ?

    -> oups, as I said in my first post, I didn't understand configuration of /etc/aliases file. postmaster@ks358431.kimsufi.com is neither a local account nor remote mail server. ks358431.kimsufi.com is name of my server. Do I must replace postmaster by root or user postfix?

    Thanks
     
  8. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Then it is a local account, and you have created a mail loop (the mails will go to postmaster, then to root, then to postmaster again, and so on). Please use another email address.
     
  9. metfan

    metfan New Member

    I tried to replace postmaster@ks358431.kimsufi.com by ulrich@live-pics.net but as I thank, it failed.

    I replaced postmaster@ks358431.kimsufi.com but vmail@ks358431.kimsufi.com.
    vmail is a user on server, we created this user on your howto.
    And it seems to be OK:
    But nothing happened in /home/vmail/ and I always have this error "ERROR: Connection dropped by IMAP server" when I logging to squirel.

    damn, it's not easy to understand an howto when we are a beginner :(
     
  10. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Did you run
    Code:
    newaliases
    afterwards and restart Postfix?

    Any errors in your mail log?
     
  11. metfan

    metfan New Member

    Yes I run newaliases & restart postfix each time I change /etc/aliases file.

    this is mail.log:
     
  12. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Did you add mail.live-pics.net to the mydestination line in /etc/postfix/main.cf?
     
  13. metfan

    metfan New Member

    Yes I did it, you asked me to do it few days ago;
     
  14. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Please post your /etc/postfix/main.cf.
     
  15. metfan

    metfan New Member

    # 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 (Debian/GNU)
    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
    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:${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 = ks358431.kimsufi.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = mail.live-pics.net, ks358431.kimsufi.com, localhost.kimsufi.com, localhost
    relayhost =
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    html_directory = /usr/share/doc/postfix/html
    message_size_limit = 30720000
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy: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_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    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 to reach is over quota."
    revirtual_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
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
     
    Last edited: Aug 9, 2010
  16. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Is this the last line of your main.cf?
     
  17. metfan

    metfan New Member

    oups, not it's an error during copy/paste.
    Last line of main.cf is "receive_override_options = no_address_mappings"
     
  18. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Hm... Is your Postfix maybe running chrooted? What's in /etc/postfix/master.cf?
     
  19. metfan

    metfan New Member

    I follow your howto so I would reply no.
    I know theory of chroot but I never apply it.

    This is my master.cf detail
    Code:
    #
    # Postfix master process configuration file.  For details on the format
    # of the file, see the master(5) manual page (command: "man 5 master").
    #
    # Do not forget to execute "postfix reload" after editing this file.
    #
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    # ==========================================================================
    smtp      inet  n       -       -       -       -       smtpd
    #submission inet n       -       -       -       -       smtpd
    #  -o smtpd_tls_security_level=encrypt
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #smtps     inet  n       -       -       -       -       smtpd
    #  -o smtpd_tls_wrappermode=yes
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #628      inet  n       -       -       -       -       qmqpd
    pickup    fifo  n       -       -       60      1       pickup
    cleanup   unix  n       -       -       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    #qmgr     fifo  n       -       -       300     1       oqmgr
    tlsmgr    unix  -       -       -       1000?   1       tlsmgr
    rewrite   unix  -       -       -       -       -       trivial-rewrite
    bounce    unix  -       -       -       -       0       bounce
    defer     unix  -       -       -       -       0       bounce
    trace     unix  -       -       -       -       0       bounce
    verify    unix  -       -       -       -       1       verify
    flush     unix  n       -       -       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       -       -       -       smtp
    # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
    relay     unix  -       -       -       -       -       smtp
            -o smtp_fallback_relay=
    #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq     unix  n       -       -       -       -       showq
    error     unix  -       -       -       -       -       error
    retry     unix  -       -       -       -       -       error
    discard   unix  -       -       -       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       -       -       -       lmtp
    anvil     unix  -       -       -       -       1       anvil
    scache    unix  -       -       -       -       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/bin/maildrop -d ${recipient}
    #
    # 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=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
    scalemail-backend unix  -       n       n       -       2       pipe
      flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
    mailman   unix  -       n       n       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
      ${nexthop} ${user}
    
    ##### CONFIG d'AMAVIS #####
    amavis unix - - - - 2 smtp
            -o smtp_data_done_timeout=1200
            -o smtp_send_xforward_command=yes
    
    127.0.0.1:10025 inet n - - - - smtpd
            -o content_filter=
            -o local_recipient_maps=
            -o relay_recipient_maps=
            -o smtpd_restriction_classes=
            -o smtpd_client_restrictions=
            -o smtpd_helo_restrictions=
            -o smtpd_sender_restrictions=
            -o smtpd_recipient_restrictions=permit_mynetworks,reject
            -o mynetworks=127.0.0.0/8
            -o strict_rfc821_envelopes=yes
            -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
            -o smtpd_bind_address=127.0.0.1
    
     
  20. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    It's not running chrooted. I'm running out of ideas now... :confused:
     

Share This Page