Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs

Discussion in 'Installation/Configuration' started by Rocky, Jan 31, 2006.

  1. Rocky

    Rocky New Member

    I have sucessfully set up Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAssassin, ClamAV) using Debian. However, I have a question.
    If I wanted to catch mails coming to domainA and forward them over to my exchange box, do I have to set up the virtual users? I know I have to create the domain and transport entries, which I've already done.:confused:
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    If you forward the emails with a transport to your exchange server, you dont have to create the virtual users. Or did you get any errors?
     
  3. Rocky

    Rocky New Member

    Below is how my system is configure:

    1- I have entered damainA into the domain table.
    2- I have entered domainA --> smtp:[192.168.x.x] into the transport table.

    Now when I try to send mails to [email protected], it rejects saying Permanent Failure:
    550_<[email protected]>:_Recipient_address_rejected:_User_unknown_in_virtual_m
    ailbox_table
     
    Last edited: Jan 31, 2006
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please try and remove the domain in the domain table.
     
  5. Rocky

    Rocky New Member

    I removed the domain and now I'm getting the following error:
    Permanent Failure: 554_<[email protected]>:_Relay_access_denied
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you issue a:

    postfix reload

    after you inserted the transport?
     
  7. Rocky

    Rocky New Member

    I confiigured the transport table with the following:
    domainA.com ---> smtp:[192.168.x.x]

    Then I issued the following command:
    postfix reload.

    Below is what I have in my /var/log/mail.log file after issuing the postfix reload command:
    Jan 31 15:22:27 server1 postfix/smtpd[16393]: connect from rwcrmhc11.comcast.net[204.127.192.81]
    Jan 31 15:22:27 server1 postfix/smtpd[16393]: NOQUEUE: reject: RCPT from rwcrmhc11.comcast.net[204.127.192.81]: 554 <malli@mc
    rirents.com>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<rwcrmhc11.comcast.ne
    t>
    Jan 31 15:22:29 server1 postfix/smtpd[16393]: disconnect from rwcrmhc11.comcast.net[204.127.192.81]

    I would like to use it to filter the emails for spam and viruses for 2 domains only.
     
    Last edited: Feb 1, 2006
  8. falko

    falko Super Moderator ISPConfig Developer

    You must have the domain in the domain table, and then you must put your transport in the transport table. Please restart Postfix after the change to the transport table.
     
  9. Rocky

    Rocky New Member

    When I do that, I get the following error:
    Permanent Failure: 550_<[email protected]>:_Recipient_address_rejected:_User_unknown_in_virtual_mailbox_table


    Any suggestions?
     
  10. falko

    falko Super Moderator ISPConfig Developer

    What does /etc/postfix/main.cf look like?
     
  11. Rocky

    Rocky New Member

    My main.cf looks like this:

    # See /usr/share/postfix/main.cf.dist for a commented, more complete version

    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

    myhostname = server1.mcrirents.org
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = server1.mcrirents.org, localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2emai
    l.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_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 = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_mailbox_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 $virt
    ual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $re
    located_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
     
  12. falko

    falko Super Moderator ISPConfig Developer

    Ok, I guess these linebreaks are only in this forum, not in your file:
    What's in /etc/postfix/mysql-virtual_transports.cf?
    Also, can you try to comment out
    Code:
    receive_override_options = no_address_mappings
    in /etc/postfix/main.cf and restart Postfix?
     
  13. Rocky

    Rocky New Member

    My mysql-virtual_transports.cf looks like this:

    user = mail_admin
    password = xxxxxxx
    dbname = mail
    table = transport
    select_field = transport
    where_field = domain
    hosts = 127.0.0.1

    I tried to comment out 'receive_override_options = no_address_mappings' but received the following:
    Permanent Failure: 550_<[email protected]>:_Recipient_address_rejected:_User_unknown_in_virtual_mailbox_table
     
    Last edited: Feb 2, 2006
  14. falko

    falko Super Moderator ISPConfig Developer

    Can you double-check all your configuration files and compare them with the ones from the tutorial? Maybe you have a typo or something like this somewhere...
     
  15. Rocky

    Rocky New Member

    I've compared my 6 config files and all seems correct. I did copy and paste the config information. I don't know what else could be wrong.
     
    Last edited: Feb 7, 2006
  16. Rocky

    Rocky New Member

    Would it be better for me just to create all the mail users manually? Also, how do I lower the lever of spam identification?
     
  17. falko

    falko Super Moderator ISPConfig Developer

    You mean on the command line, without tools as phpMyAdmin? That makes no difference.

    You can change that in the amavisd configuration file /etc/amavisd.conf, towards the end. Restart amavisd afterwards.
     
  18. Rocky

    Rocky New Member

    What i meant was since the virtual setup is not allowing mails to pass through without the users being created, should i create the users or would it be better to try a re-install?

    My setup is as follows:
    Hosting domain is domainC
    I have domainA entered in the domian table
    I have smtp:[192.168.0.xx] entered in the transport table

    If i didn't create the virtual users, shouldn't the server catch mails going to domainA and pass it over to my exchange? Or does it only work if the users are added to the virtual table?
     
  19. falko

    falko Super Moderator ISPConfig Developer

    The transports worked for me without users being created...
     
  20. Rocky

    Rocky New Member

    Falko I know that I'm being a pain about this setup but I really would like to implement this in my organizaton.

    I reloaded the server and tried the following config:
    Domain = domainA
    Transport = domainA -> smtp:[192.168.0.xx]
    This produced the error, the user does not exist in the virtual user table.

    I then tried:
    Domain = domainA
    Transport = domainA -> smtp:[192.168.0.xx]
    Forwarding = @domainA -> @domainA
    This config allowed mails to be filtered and passed to my exchange without creating the users.:confused:

    I checked my confiuration thorougly and every setting/configuraton seems correct. The question is, would my second configuration work without causing any problems?

    I will eventually be filtering mails for domainA and domainB which will then be routed to my exchange server through the transport.

    I was able to figure out how to change the spamassassin level check, thanks to you.
     

Share This Page