# Virtual Mailhosting System Guide [fixed]

## nasher

hihi,

its going about this guide: http://www.gentoo.org/doc/en/virt-mail-howto.xml

everything was ok(tested etc), till step 10. Configuring MySQL Authentication and vhosts

after that i could not authenticate myself anymore with a mail client,

errors i get :

Oct  7 12:44:28 gentoo postfix/trivial-rewrite[2895]: fatal: /etc/postfix/mysql-relocated.cf: mysql options file does not include database name

Oct  7 12:45:13 gentoo pop3d: LOGIN FAILED, ip=[192.168.0.195]

Oct  7 12:45:29 gentoo postfix/trivial-rewrite[2898]: fatal: /etc/postfix/mysql-relocated.cf: mysql options file does not include database name

i can logon into the database with phpmyadmin, 

created an alias:

Wijzigen  Verwijderen  3 nash nash@domain.exampl 

maked a user in table users *d0h*  :Razz:   : 

Wijzigen  Verwijderen  3 nash@domain.exampl x test 1001 100 /home/nash /home/nash/.maildir/   y 

and thats it   :Laughing:   :Rolling Eyes: Last edited by nasher on Thu Dec 11, 2003 9:16 am; edited 1 time in total

----------

## sebest

the error message seems to tell you that you didn't define the database name in the config file of postfix. Did you check that you put the 

-hostname

-databasename

-username

-password

?

----------

## nasher

 *sebest wrote:*   

> the error message seems to tell you that you didn't define the database name in the config file of postfix. Did you check that you put the 
> 
> -hostname
> 
> -databasename
> ...

 

gentoo postfix # cat mysql-virtual.cf

user            = mailsql

password        = hihihihihihihihi

dbname          = mailsql

table           = virtual

select_field    = destination

where_field     = email

hosts           = unix:/var/run/mysqld/mysqld.sock

 :Neutral: 

i *can* send emails localy - user to user

but i cant authenticate from an other computer <> sql <> pop3 / smtp   :Shocked: Last edited by nasher on Wed Oct 08, 2003 1:02 pm; edited 1 time in total

----------

## nasher

 *nasher wrote:*   

> 
> 
> i dont get the error anymore that i wrote ab0ve, 
> 
> maybe it was : 
> ...

 

Oct  7 14:12:18 gentoo postfix/smtpd[3698]: fatal: /etc/postfix/mysql-aliases.cf: mysql options file does not include database name

Oct  7 14:13:01 gentoo postfix/local[3699]: fatal: /etc/postfix/mysql-aliases.cf: mysql options file does not include database name

gentoo postfix # cat mysql-aliases.cf

user            = mailsql

password        = hhiihi

dbname          = mailsql

table           = alias

select_field    = destination

where_field     = alias

hosts           = unix:/var/run/mysqld/mysqld.sock

----------error----mail----client

+OK Hello there.

USER nash@gentoo.domainstuff

+OK Password required.

PASS <PASSWORD>

-ERR Login failed.Last edited by nasher on Thu Oct 09, 2003 6:42 am; edited 1 time in total

----------

## nasher

added /etc/postfix/main.cf :

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

mail_owner = postfix

myhostname = gentoo.domainstuff

mydomain = gentoo.domainstuff

inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain $mydomain

local_transport = local

local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname

virtual_transport = virtual

virtual_minimum_uid = 1000

virtual_gid_maps = static:1002

virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf

virtual_uid_maps = static:1002

virtual_mailbox_base = /

#virtual_mailbox_limit =

unknown_local_recipient_reject_code = 450

mynetworks = 192.168.0.0/24,127.0.0.0/8

virtual_mailbox_domains = gentoo.domainstuff

alias_maps = mysql:/etc/postfix/mysql-aliases.cf

alias_database = hash:/etc/mail/aliases

relocated_maps = mysql:/etc/postfix/mysql-relocated.cf

home_mailbox = .maildir/

local_destination_concurrency_limit = 2

default_destination_concurrency_limit = 10

debug_peer_level = 2

debugger_command =

         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

         xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail

newaliases_path = /usr/bin/newaliases

mailq_path = /usr/bin/mailq

setgid_group = postdrop

manpage_directory = /usr/share/man

sample_directory = /etc/postfix/sample

readme_directory = /usr/share/doc/postfix-2.0.11

smtpd_sasl_auth_enable = yes

smtpd_sasl2_auth_enable = yes

smtpd_sasl_security_options = noanonymous

broken_sasl_auth_clients = yes

smtpd_sasl_local_domain =

smtpd_recipient_restrictions =

        permit_sasl_authenticated,

        permit_mynetworks,

        reject_unauth_destination

smtpd_use_tls = yes

#smtpd_tls_auth_only = yes

smtpd_tls_key_file = /etc/postfix/newreq.pem

smtpd_tls_cert_file = /etc/postfix/newcert.pem

smtpd_tls_CAfile = /etc/postfix/cacert.pem

smtpd_tls_loglevel = 3

smtpd_tls_receiver_header = yes

smtpd_tls_session_cache_timeout = 3600s

tls_random_source = dev:/dev/urandom

-----eof----

----------

## nasher

*kick*

-----edit------

ok

shame on me   :Shocked: 

MYSQL_HOME_FIELD        home

must be 

MYSQL_HOME_FIELD        homedir

----------

