Virtual Users And Domains With Postfix, Courier And MySQL (Debian Etch)

Discussion in 'HOWTO-Related Questions' started by White, Apr 23, 2008.

  1. White

    White Member

    Ok, in order to make this how to work for me at all i had to remove the proxy: from the mysql statements in main.cf

    virtual_mailbox_maps=proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf

    and make it look like this

    virtual_mailbox_maps=mysql:/etc/postfix/mysql-virtual_mailboxes.cf

    which is copied from Christoph Haas's tutorial falko has linked to in his tutorial.

    and figure out that if i have virtual domains example.com and example2.com then my server is still mail.mydomain.tld for all my virtual domains.

    The system is now creating mailboxes for domains i have created in mysql there are a couple of problems im encountering now,

    i can send and receive emails from my [email protected] using mail.mydomain.tld and i can send emails to my new virtualdomains.com to activate them.

    i can mail in to mydomain.tld from outside my network but if i send a mail to [email protected] and [email protected] then somewhere from the other day is a cached email forwarding address that i inputted wrong and the emails fail and get returned to the external email address. Does anyone know in which file or db these cached addresses are so i can delete it, and no its not in mysql mail database. see below

    from hotmail mailer-daemon

    [email protected](generated from [email protected])SMTP error from remote mail server after RCPT TO:<[email protected]>:host mx3.hotmail.com [65.54.244.200]: 550 Requested action not taken:mailbox unavailable

    now from this line above i think in know that this domain is working (generated from [email protected])

    and i have [email protected] working and sending and receiving emails into and out of my network so it has to be this hidden cached file from the other day.

    Hope what i have done might work for others who have difficulty with this how to aswell but like always no guarantees.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Did you check the forwards table?
     
  3. White

    White Member

    yes, i completely emptied maildb and filled it up from fresh, twice (i only have half a dozen sites so it didnt take long)

    i know it was the first time as the 2nd and 3rd times i populated the db i put nothing in the forwards or transport tables.

    in your tutorial it says that postfix caches the emails but you can speed this up by doing $ postfix reload

    im wondering if there is a file somewhere where these cached email accounts get stored that i can manually view and if need be clear.

    as i say only 2 of my accounts fail due to this [email protected], all the others are now sending and receiving emails perfectly
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Did you restart Postfix?

    I don't know if Postfix is using files to cache, I rather think it's caching in memory.
     
  5. White

    White Member

    Important: Postfix uses a caching mechanism for the transports, therefore it might take a while until you changes in the transport table take effect. If you want them to take effect immediately, run

    postfix reload

    am i getting this mixed up with something else?

    i have done the postfix reload many times, my server is not fully operational yet and is turned off every evening so all programs reload from boot each day as i play with it.

    i may start again and do a clean install tonight if no one has any suggestions, either way its a good practise for me.
     
  6. falko

    falko Super Moderator Howtoforge Staff

    What's in /etc/postfix/main.cf and /etc/aliases?
     
  7. White

    White Member

    There was nothing in either file that was untoward.

    I spent yesterday and did a clean install and now i have it working flawlessly, this is what i have done

    followed debian etch perfect server setup but only to the hostname and hostname -f

    i did NO updates, i then followed the virtual users and domains setup but not to the letter, i deleted the proxy: as mentioned in my first post and added my home pc 192.168.1.3 to the mynetworks.

    i manually inputted my domains into phpmyadmin not using mysql shell but placed nothing in transports or email2email

    i sent each account an opening message from my main user account [email protected] and all opened new files in /home/vmail.

    only when i was convinced everything was ok did i allow the system to update

    i then went back to debian server and copied some extra files for mysql, php and apache2 but nothing for postfix or courier.

    this may not be the right way to do it, i dont know but its the only way with my very limited knowledge i could get it to work.

    my server seems to be happy now, which is a first, and so i can now get on with sorting out my sites. its been a good learning experience anyway.
     

Share This Page