Yet another post about Courier + MySQL + Postfix etc... Auth problems :)

Discussion in 'HOWTO-Related Questions' started by geekman, Sep 23, 2006.

  1. geekman

    geekman New Member

    Hi last week i found your guide
    Code:
    http://howtoforge.com/virtual_postfix_mysql_quota_courier
    I followed it as best i could but i was forced to make a few changes to how it is all setup for me, also im running ubuntu 5.10 on all servers. I usually prefer to RTFM and solve my own problems but i have a feeling i'll need better help with this one, i have read almost all posts in the howto related section but i cant find anything that fixes my problem, but maybe im just stupid. This is my last option, i hope to get the mailserver working before the end of next week, any help is very much appreciated.

    Heres the changes i can remember: firstly, for me email and mysql are on two different boxes and the webmail client is on yet another one. The email server is called 'architect' with an IP of 192.168.1.203 this has smtp/imap/pop/spam/av. Then there is 'neo' (i use matrix characters to name my boxes :D) with an IP of 192.168.1.201, theres also the shared apache box but no need to worry about that yet i feel. I am also using a newer version of postfix (2.2.4) and the quota patch (postfix-2.2.4-vda.patch) to the ones described. Oh and i also changed the mail base to /var/spool/vmail this is because i had already partitioned the box thinking i would put all mail in /var and lastly i had already added a vmail user before using this guide so i changed the UID in the config files to use 1002 in /etc/postfix/main.cf
    Code:
    virtual_uid_maps = static:1002
    virtual_gid_maps = static:1002
    
    I assume i got the UID right by doing:
    Code:
    root@architect:~# grep vmail /etc/passwd
    vmail:x:1002:1002::/var/spool/vmail:
    root@architect:~# grep vmail /etc/group
    vmail:x:1002:
    
    ?

    Apart from that i dont think i did much else different, i hope i have explained my situation well enough for it not to be confusing. Im going to post all the info i can think of to get this fixed quick :)

    output of `netstat -tap` on architect
    Code:
    tcp        0      0 *:smux                  *:*                     LISTEN     10430/snmpd
    tcp        0      0 localhost.localdo:10024 *:*                     LISTEN     20192/amavisd (mast
    tcp        0      0 192.168.1.203:10025     *:*                     LISTEN     16051/master
    tcp        0      0 192.168.1.203:imap2     *:*                     LISTEN     22373/couriertcpd
    tcp        0      0 *:smtp                  *:*                     LISTEN     16051/master
    tcp        0      0 192.168.1.203:42901     ldap:mysql              ESTABLISHED2979/authdaemond.my
    tcp        0      0 192.168.1.203:47017     ldap:mysql              ESTABLISHED2976/authdaemond.my
    tcp6       0      0 *:imaps                 *:*                     LISTEN     22767/couriertcpd
    tcp6       0      0 *:pop3s                 *:*                     LISTEN     22696/couriertcpd
    tcp6       0      0 *:pop3                  *:*                     LISTEN     3041/couriertcpd
    tcp6       0      0 *:ssh                   *:*                     LISTEN     5399/sshd
    
    output of `netstat -tap` on neo
    Code:
    tcp        0      0 localhost.localdo:32769 *:*                     LISTEN     6                                                                             758/hpiod
    tcp        0      0 localhost.localdo:32770 *:*                     LISTEN     6                                                                             771/python
    tcp        0      0 *:smux                  *:*                     LISTEN     7                                                                             045/snmpd
    tcp        0      0 *:mysql                 *:*                     LISTEN     6                                                                             880/mysqld
    tcp        0      0 *:netbios-ssn           *:*                     LISTEN     7                                                                             038/smbd
    tcp        0      0 *:ftp                   *:*                     LISTEN     7                                                                             135/proftpd: (acce
    tcp        0      0 neo:ipp                 *:*                     LISTEN     9                                                                             526/cupsd
    tcp        0      0 localhost.localdoma:ipp *:*                     LISTEN     9                                                                             526/cupsd
    tcp        0      0 *:3128                  *:*                     LISTEN     7                                                                             120/(squid)
    tcp        0      0 *:microsoft-ds          *:*                     LISTEN     7                                                                             038/smbd
    tcp        0      0 neo:mysql               trinity:2793            ESTABLISHED6                                                                             880/mysqld
    tcp        0      0 localhost.localdo:32806 localhost.localdo:32805 ESTABLISHED7                                                                             120/(squid)
    tcp        0      0 localhost.localdo:50332 localhost.localdo:32769 ESTABLISHED6                                                                             771/python
    tcp        0      0 localhost.localdo:32805 localhost.localdo:32806 ESTABLISHED9                                                                             627/(pam_auth)
    tcp        0      0 neo:mysql               trinity:2794            ESTABLISHED6                                                                             880/mysqld
    tcp        0      0 localhost.localdo:32808 localhost.localdo:32807 ESTABLISHED7                                                                             120/(squid)
    tcp        0      0 neo:mysql               architect:47017         ESTABLISHED6                                                                             880/mysqld
    tcp        0      0 localhost.localdo:32807 localhost.localdo:32808 ESTABLISHED9                                                                             628/(pam_auth)
    tcp        0      0 localhost.localdo:32810 localhost.localdo:32809 ESTABLISHED7                                                                             120/(squid)
    tcp        0      0 localhost.localdo:32809 localhost.localdo:32810 ESTABLISHED9                                                                             629/(pam_auth)
    tcp        0      0 localhost.localdo:32812 localhost.localdo:32811 ESTABLISHED7                                                                             120/(squid)
    tcp        0      0 localhost.localdo:32811 localhost.localdo:32812 ESTABLISHED9                                                                             630/(pam_auth)
    tcp        0      0 localhost.localdo:32814 localhost.localdo:32813 ESTABLISHED7                                                                             120/(squid)
    tcp        0      0 localhost.localdo:32813 localhost.localdo:32814 ESTABLISHED9                                                                             631/(pam_auth)
    tcp        0      0 neo:mysql               architect:42901         ESTABLISHED6                                                                             880/mysqld
    tcp        0      0 localhost.localdo:32769 localhost.localdo:50332 ESTABLISHED6                                                                             
    my /etc/postfix/main.cf
    Code:
    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    smtpd_banner = $myhostname ESMTP Server
    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
    myhostname = uberhosting.ath.cx
    alias_maps = hash:/etc/aliases, ldap:/etc/postfix/ldap-aliases.cf
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8,192.168.1.0/28
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_base = /var/spool/vmail
    virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_uid_maps = static:1002
    virtual_gid_maps = static:1002
    virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_fowardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    
    mailbox_command = /usr/bin/procmail
    virtual_alias_domains =
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_use_tls = yes
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    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
    content_filter = amavis:[127.0.0.1]:10025
    receive_override_options = no_address_mappings
    
     
    Last edited: Sep 23, 2006
  2. geekman

    geekman New Member

    following on...

    my /etc/postfix/master.cf
    Code:
    #
    # Postfix master process configuration file.  For details on the format
    # of the file, see the Postfix master(5) manual page.
    #
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    # ==========================================================================
    smtp      inet  n       -       -       -       -       smtpd
    #submission inet n      -       -       -       -       smtpd
    # -o smtpd_etrn_restrictions=reject
    # -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #smtps    inet  n       -       -       -       -       smtpd
    #  -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
    #submission inet n      -       -       -       -       smtpd
    #  -o smtpd_etrn_restrictions=reject
    #  -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
    #628      inet  n       -       -       -       -       qmqpd
    pickup    fifo  n       -       -       60      1       pickup
    cleanup   unix  n       -       -       -       0       cleanup
    qmgr      fifo  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
    smtp      unix  -       -       -       -       -       smtp
    # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
    relay     unix  -       -       -       -       -       smtp
     -o fallback_relay=
    #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq     unix  n       -       -       -       -       showq
    error     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/local/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       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
      ${nexthop} ${user}
    
    192.168.1.203: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,192.168.1.0/28
            -o strict_rfc821_envelopes=yes
            -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
            -o smtpd_bind_address=192.168.1.203
    
    my /etc/courier/authdaemonrc
    Code:
    authmodulelist="authmysql"
    authmodulelistorig="authcustom authcram authuserdb authldap authpgsql authmysql authpam"
    daemons=5
    version=""
    authdaemonvar=/var/run/courier/authdaemon
    
    my /etc/courier/authmysqlrc
    Code:
    MYSQL_SERVER 192.168.1.201
    MYSQL_USERNAME mail_admin
    MYSQL_PASSWORD mypass
    MYSQL_PORT 0
    MYSQL_DATABASE mail
    MYSQL_USER_TABLE users
    MYSQL_CRYPT_PWFIELD password
    #MYSQL_CLEAR_PWFIELD password
    MYSQL_UID_FIELD 1002
    MYSQL_GID_FIELD 1002
    MYSQL_LOGIN_FIELD email
    MYSQL_HOME_FIELD "/var/spool/vmail"
    MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
    #MYSQL_NAME_FIELD
    MYSQL_QUOTA_FIELD quota
    
    my /etc/courier/imapd
    Code:
    ADDRESS=192.168.1.203
    PORT=143
    MAXDAEMONS=40
    MAXPERIP=20
    PIDFILE=/var/run/courier/imapd.pid
    TCPDOPTS="-nodnslookup -noidentlookup"
    AUTHMODULES="authdaemon"
    AUTHMODULES_ORIG="authdaemon"
    DEBUG_LOGIN=0
    IMAP_CAPABILITY="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE"
    IMAP_KEYWORDS=1
    IMAP_CAPABILITY_ORIG="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 IDLE"
    IMAP_IDLE_TIMEOUT=60
    IMAP_CAPABILITY_TLS="$IMAP_CAPABILITY AUTH=PLAIN"
    IMAP_CAPABILITY_TLS_ORIG="$IMAP_CAPABILITY_ORIG AUTH=PLAIN"
    IMAP_DISABLETHREADSORT=0
    IMAP_CHECK_ALL_FOLDERS=0
    IMAP_OBSOLETE_CLIENT=0
    IMAP_ULIMITD=65536
    IMAP_USELOCKS=1
    IMAP_SHAREDINDEXFILE=/etc/courier/shared/index
    IMAP_ENHANCEDIDLE=0
    IMAP_TRASHFOLDERNAME=Trash
    IMAP_EMPTYTRASH=Trash:7
    IMAP_MOVE_EXPUNGE_TO_TRASH=0
    SENDMAIL=/usr/sbin/sendmail
    HEADERFROM=X-IMAP-Sender
    IMAPDSTART=YES
    MAILDIRPATH=Maildir
    
    my /etc/courier/maildrop
    Code:
    /usr/bin/maildrop
    my /etc/courier/pop3d
    Code:
    PIDFILE=/var/run/courier/pop3d.pid
    MAXDAEMONS=40
    MAXPERIP=4
    AUTHMODULES="authdaemon"
    AUTHMODULES_ORIG="authdaemon"
    DEBUG_LOGIN=0
    POP3AUTH="LOGIN CRAM-MD5 CRAM-SHA1"
    POP3AUTH_ORIG="LOGIN CRAM-MD5 CRAM-SHA1"
    POP3AUTH_TLS=""
    POP3AUTH_TLS_ORIG="LOGIN PLAIN"
    PORT=110
    ADDRESS=0
    TCPDOPTS="-nodnslookup -noidentlookup"
    POP3DSTART=YES
    MAILDIRPATH=Maildir
    There are two more config files for imap/pop with ssl but man i hate sifting through those files so i wont include them yet. :p

    Now onto the logs...I had at first thought that it was imap/pop that would not auth as when i first setup postfix (without any modifications -- auth) i was able to email my gmail account, and it seemed that because the messages were coming from webmail while i was trying to recieve mail it must be those two. Although it could be those two aswell still, i ran a telnet session to pop today and was able to login but then was logged out because there was no MailDir. Then when i attempted the same thing with smtp i didnt know howto login :), but when i tried to email one of the accounts on the server, it said `Temporary lookup failure` so now i have no idea whats wrong really.

    Code:
    root@architect:~# telnet localhost 25
    Trying 127.0.0.1...
    Connected to localhost.localdomain.
    Escape character is '^]'.
    220 uberhosting.ath.cx ESMTP Server
    MAIL FROM:<[email protected]>
    250 Ok
    RCPT TO:<[email protected]>
    451 <[email protected]>: Temporary lookup failure
    
    my /var/log/mail.log

    Code:
    Way too big, added as attachment. But heres the tail:
    root@architect:~# tail /var/log/mail.log
    Sep 24 22:10:40 localhost postfix/qmgr[26289]: warning: connect to transport amavis: No such file or directory
    Sep 24 22:11:13 localhost postfix/virtual[26321]: fatal: open /etc/postfix/mysql                                             -virtual_mailbox_limit_maps.cf: No such file or directory
    Sep 24 22:11:14 localhost postfix/master[16051]: warning: process /usr/lib/postfix/virtual pid 26321 exit status 1
    Sep 24 22:11:14 localhost postfix/master[16051]: warning: /usr/lib/postfix/virtual: bad command startup -- throttling
    Sep 24 22:11:29 localhost postfix/smtpd[26322]: connect from unknown[192.168.1.199]
    Sep 24 22:11:29 localhost postfix/smtpd[26322]: disconnect from unknown[192.168.1.199]
    Sep 24 22:11:40 localhost postfix/qmgr[26289]: warning: connect to transport amavis: No such file or directory
    Sep 24 22:12:14 localhost postfix/virtual[26325]: fatal: open /etc/postfix/mysql                                             -virtual_mailbox_limit_maps.cf: No such file or directory
    Sep 24 22:12:15 localhost postfix/master[16051]: warning: process /usr/lib/postfix/virtual pid 26325 exit status 1
    Sep 24 22:12:15 localhost postfix/master[16051]: warning: /usr/lib/postfix/virtual: bad command startup -- throttling
    root@architect:~#
    
    maybe im blind but i didnt see the mssing file defined in main.cf?
     
    Last edited: Sep 24, 2006
  3. geekman

    geekman New Member

    Ok i think that im supposed to change 192.168.1.0/28 to 192.168.1.0/24...i think, no good with that subnet mask thing, doubt it would fix anything but still good to change.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Yes, that's a good idea.
    Also make sure that the DNS record for uberhosting.ath.cx is ok. Finally, what's the output of
    Code:
    postconf -d | grep mail_version
    ?
     
  5. geekman

    geekman New Member

    the /var/log/mail.err file is most definitely going to be attached, i flooded my network trying to cat it on ssh at a remote location, which caused by router to crash :D. Lucky someone is home or I'd have to wait 2 days. Ill have to make another post filling in the info when its all accessible again ;) I would also like to mention that im sorry for so much spam, i can just attach all the files and remove the code boxes if you'd prefer.

    ok finally got it all back up again with the mail.err log its way too big, but ill post the tail and also the whole thing as an attachment.
    Code:
    Sep 24 22:06:39 localhost postfix/qmgr[25648]: fatal: timeout connecting to transport: virtual
    Sep 24 22:07:09 localhost postfix/virtual[26292]: fatal: open /etc/postfix/mysql-virtual_mailbox_limit_maps.cf: No such file or directory
    Sep 24 22:08:10 localhost postfix/virtual[26295]: fatal: open /etc/postfix/mysql-virtual_mailbox_limit_maps.cf: No such file or directory
    Sep 24 22:09:11 localhost postfix/virtual[26319]: fatal: open /etc/postfix/mysql-virtual_mailbox_limit_maps.cf: No such file or directory
    Sep 24 22:10:12 localhost postfix/virtual[26320]: fatal: open /etc/postfix/mysql-virtual_mailbox_limit_maps.cf: No such file or directory
    Sep 24 22:11:13 localhost postfix/virtual[26321]: fatal: open /etc/postfix/mysql-virtual_mailbox_limit_maps.cf: No such file or directory
    Sep 24 22:12:14 localhost postfix/virtual[26325]: fatal: open /etc/postfix/mysql-virtual_mailbox_limit_maps.cf: No such file or directory
    Sep 24 22:13:15 localhost postfix/virtual[26327]: fatal: open /etc/postfix/mysql-virtual_mailbox_limit_maps.cf: No such file or directory
    Sep 24 22:14:16 localhost postfix/virtual[26330]: fatal: open /etc/postfix/mysql-virtual_mailbox_limit_maps.cf: No such file or directory
    Sep 24 22:15:17 localhost postfix/virtual[26336]: fatal: open /etc/postfix/mysql-virtual_mailbox_limit_maps.cf: No such file or directory
    
    also i didnt think that this file was covered in the howto?
    and one last thing, i couldnt find a mysql log on neo, im running mysql 5

    ok so thats all i can think of, hope someone can help me

    Thanks everyone in advance.
     
  6. geekman

    geekman New Member

    thanks i missed your response falko, im pretty sure DNS records are OK but even still if they aren't i dont think i can change them as im using DynDns. Also the output of `postconf -d | grep mail_version` is:
    mail_version = 2.2.4

    also i dont know if you read it but i mentioned that and also that i had the latest quota patch applied...i guess you just needed to be sure.

    Thanks man, also the logs are *not* attached (i couldnt be bothered to get them to this box as the mail server has no ftp or http, i did put them on my shared apache but but) attached and the tails of both were edited into the other post. The logs can be found at http://uberhosting.ath.cx/~geekman/mail.log and http://uberhosting.ath.cx/~geekman/mail.err

    Ok so now i *have* uploaded them, sometimes i surprise even my own mind :D

    Thankyou again
     

    Attached Files:

    Last edited: Sep 24, 2006
  7. geekman

    geekman New Member

    Ok so it seems im extremely blind or extremely tired, or maybe i need to sleep more. But i was sure the `mysql-virtual_mailbox_limit_maps.cf` was not mentioned in the howto but seeing as the logs were swamped with the error i decided to grep main.cf and see where it was being called, then i looked in the howto for the file :eek:

    Ok but now i am still getting some errors with amavis that ive had all along
    Code:
    Sep 25 15:56:15 localhost postfix/master[29013]: daemon started -- version 2.2.4, configuration /etc/postfix
    Sep 25 15:56:15 localhost postfix/qmgr[29016]: 957B262117: from=<[email protected]>, size=508, nrcpt=1 (queue active)
    Sep 25 15:56:15 localhost postfix/qmgr[29016]: warning: connect to transport amavis: No such file or director
    thats all i get in the mail logs when i restart postfix, i havent done any testing yet but i assume it wont work still because i have been reading orielly's 'definitive guide to postfix' and seeing as amavis is the content filter, i assume it will not be passed on to store?

    Thanks in Advance
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Please post your main.cf and master.cf here (please strip out the comments).

    I just fly over the posts as there are so many questions to answer in this forum that I just can't afford to spend more than 5 minutes per question... So it's possible I didn't read it.
     
  9. geekman

    geekman New Member

    Thats cool, as you requested:
    the `/etc/postfix/main.cf` file
    Code:
    smtpd_banner = $myhostname ESMTP Server
    biff = no
    append_dot_mydomain = no
    myhostname = uberhosting.ath.cx
    alias_maps = hash:/etc/aliases, ldap:/etc/postfix/ldap-aliases.cf
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8,192.168.1.0/24
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_base = /var/spool/vmail
    virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_uid_maps = static:1002
    virtual_gid_maps = static:1002
    virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_fowardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    mailbox_command = /usr/bin/procmail
    virtual_alias_domains =
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_use_tls = yes
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    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
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings

    and the `/etc/postfix/master.cf` file
    Code:
    smtp      inet  n       -       -       -       -       smtpd
    pickup    fifo  n       -       -       60      1       pickup
    cleanup   unix  n       -       -       -       0       cleanup
    qmgr      fifo  n       -       -       300     1       qmgr
    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
    smtp      unix  -       -       -       -       -       smtp
    relay     unix  -       -       -       -       -       smtp
            -o fallback_relay=
    showq     unix  n       -       -       -       -       showq
    error     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
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    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       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
      ${nexthop} ${user}
    192.168.1.203: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,192.168.1.0/28
            -o strict_rfc821_envelopes=yes
            -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
            -o smtpd_bind_address=192.168.1.203
    Also i noticed that in my `/etc/courier/authmysqlrc` file
    it has
    Code:
    MYSQL_CRYPT_PWFIELD password
    #MYSQL_CLEAR_PWFIELD password
    The thing is that i didnt edit out the password, so i assume i have to put in the mysql user password? But also seen as im currently using `MYSQL_CRYPT_PWFIELD`, how do i encrypt the password for use with this parameter? Or should i just use `MYSQL_CLEAR_PWFIELD` instead?

    Thanks in Advance
    PS i changed the
    Code:
    -o mynetworks=127.0.0.0/8,192.168.1.0/28
    string to
    Code:
    -o mynetworks=127.0.0.0/8,192.168.1.0/24
    after i noticed
     
    Last edited: Sep 26, 2006
  10. falko

    falko Super Moderator Howtoforge Staff

    You forgot to put

    Code:
    amavis unix - - - - 2 smtp
            -o smtp_data_done_timeout=1200
            -o smtp_send_xforward_command=yes
    into master.cf, as shown on http://www.howtoforge.com/virtual_postfix_mysql_quota_courier_p3

    Also use
    Code:
    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
    instead of your code.

    No, don't replace the string password. It means the password column in the MySQL database.
     

Share This Page