# Postfix virtual domains trouble [SOLVED]

## lostone

I've just  installed a fresh gentoo (wich is great, btw), but I ran into some trouble with the virtual domains for postfix.

First, i want to mention that i followed exactly the vdomains howto form the gentoo.org website, in the docs section.

i solved some of the errors, but still got some in my logs:

```

Jan  6 02:28:56 localhost postfix/trivial-rewrite[13127]: fatal: match_list_parse: read file /home/vmail: Is a directory

Jan  6 02:28:57 localhost postfix/master[26596]: warning: process /usr/lib/postfix/trivial-rewrite pid 13127 exit status 1

Jan  6 02:28:57 localhost postfix/master[26596]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

```

the section where the mailbox directory is declared looks like this:

```

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

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

local_transport = local

local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname

virtual_transport = virtual

virtual_mailbox_domains =  domain1.com, domain2.ro, domain3.net, 

        virtual_minimum_uid = 1000

        virtual_gid_maps = static:1001

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

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

        virtual_uid_maps = static:1001

        virtual_mailbox_base = /home/vmail

        #virtual_mailbox_limit =

```

ok, the second problem is that it doesn't seem to send email anywhere. i'm guessing it's the smtp engine not running or smth, although when i telnet to port 25, i get:

```

Trying 81.196.16.222...

Connected to mail.lostone.net.

Escape character is '^]'.

220 mail.lostone.net ESMTP Postfix (powered by unwm)

EHLO lostone.net

250-mail.lostone.net

250-PIPELINING

250-SIZE 10240000

250-VRFY

250-ETRN

250-STARTTLS

250-AUTH LOGIN PLAIN

250-AUTH=LOGIN PLAIN

250 8BITMIME

```

wich it's just like it should, in the howto.

what am i doing wrong ?! any suggestions ?! please, i'm pretty desperate...Last edited by lostone on Wed Jan 12, 2005 8:08 am; edited 1 time in total

----------

## langthang

 *lostone wrote:*   

> 
> 
> virtual_mailbox_base = /home/vmail
> 
> 

 

change it to

```
virtual_mailbox_base = /
```

and in your users table add "/home/vmail/" to "homedir" column, home/vmail/your_domain/username/.maildir/ to "maildir" column. the "/" after .maildir is important, don't miss it.

----------

## lostone

ok, thank you very much! that solved the login thing from webmail.

now for the other problem: when i send email to one of the domains hosted on the server, if i tai -f for the mail.log file, i can see the remote host connecting to my email server to deliver the email, but there it stops, and no mail is delivered.

For the hosted vdomains, in the mysql table i have 

```

domain1.com    virtual:

domain2.com    virtual:

```

for example, i tried to send an email from my gmail box, and this is what i get:

```

Jan  6 09:41:06 localhost postfix/smtpd[16507]: starting TLS engine

Jan  6 09:41:06 localhost postfix/smtpd[16507]: connect from rproxy.gmail.com[64.233.170.202]

Jan  6 09:41:22 localhost postfix/trivial-rewrite[16508]: fatal: match_list_parse: read file /: Is a directory

Jan  6 09:41:23 localhost postfix/master[16469]: warning: process /usr/lib/postfix/trivial-rewrite pid 16508 exit status 1

Jan  6 09:41:23 localhost postfix/master[16469]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

```

also, the smtp is not working, i cannot send any mails from localhost, or from squirrelmail interface.

any advice here, please ?

lateredit:

i forgot to post the postconf -n output, maybe it helps:

```

alias_database = hash:/etc/mail/aliases

alias_maps = hash:/etc/mail/aliases

broken_sasl_auth_clients = yes

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/lib/postfix

debug_peer_level = 2

default_destination_concurrency_limit = 2

home_mailbox = .maildir/

html_directory = no

inet_interfaces = all

local_destination_concurrency_limit = 2

local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname

local_transport = local

mail_owner = postfix

mailq_path = /usr/bin/mailq

manpage_directory = /usr/share/man

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

mydomain = lostone.net

myhostname = mail.lostone.net

mynetworks = 192.168.1.0/24, 127.0.0.0/8, 82.208.176.197

myorigin = $mydomain

newaliases_path = /usr/bin/newaliases

queue_directory = /var/spool/postfix

readme_directory = /usr/share/doc/postfix-2.1.5-r1/readme

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

sample_directory = /etc/postfix

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

smtpd_banner = $myhostname ESMTP $mail_name (powered by unwm)

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain =

smtpd_sasl_security_options = noanonymous

smtpd_tls_CAfile = /etc/postfix/cacert.pem

smtpd_tls_cert_file = /etc/postfix/newcert.pem

smtpd_tls_key_file = /etc/postfix/newreq.pem

smtpd_tls_loglevel = 3

smtpd_tls_received_header = yes

smtpd_tls_session_cache_timeout = 3600s

smtpd_use_tls = yes

tls_random_source = dev:/dev/urandom

unknown_local_recipient_reject_code = 550

virtual_mailbox_domains = cni-gstc.ro, ultimulnivel.ro, lostone.net, lifeseeker.net, littlegiants.ro    virtual_minimum_uid = 1000 virtual_gid_maps = static:1001   virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf    virtual_uid_maps = static:1001  virtual_mailbox_base = /

virtual_transport = virtual

```

----------

## langthang

check your vmail uid and gid and change  "virtual_uid_maps = static:vmail_uid" "virtual_gid_maps = static:vmail_gid"; do the same for "uid" and "gid" columns in "users" table. in my system, the uid=gid and >1000.

----------

## lostone

```

sirius root # cat /etc/passwd | grep vmail

vmail:x:1001:1001::/home/vmail:/bin/false

sirius root # cat /etc/group | grep vmail

vmail:x:1001:

```

as u can see, the uid and gid are ok. the same values are set both in postfix's main.cf and in the mysql users table. i'm totally out of ideeas...  :Sad: 

----------

## lostone

i noticed that in the logs i keep getting the messages:

```

Jan  6 13:35:05 localhost postfix/trivial-rewrite[25701]: fatal: match_list_parse: read file /: Is a directory

Jan  6 13:35:06 localhost postfix/master[20821]: warning: process /usr/lib/postfix/trivial-rewrite pid 25701 exit status 1

Jan  6 13:35:06 localhost postfix/master[20821]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

```

wheneve smtpd should deliver email. what's with this ?! i've chanded the setting as u said above, and now i can login in may email. everything works fine, except that... well... i cannot send or receive emails...

----------

## lostone

latest update  :Smile: 

what i get now in the logs is:

```

Jan  6 22:08:12 localhost postfix/smtpd[7476]: > rproxy.gmail.com[64.233.170.200]: 220 sirius.cni-gstc.ro ESMTP Postfix (powered by unwm)

Jan  6 22:08:12 localhost postfix/smtpd[7476]: watchdog_pat: 0x809f928

Jan  6 22:08:12 localhost postfix/smtpd[7476]: < rproxy.gmail.com[64.233.170.200]: EHLO rproxy.gmail.com

Jan  6 22:08:12 localhost postfix/smtpd[7476]: > rproxy.gmail.com[64.233.170.200]: 250-sirius.cni-gstc.ro

Jan  6 22:08:12 localhost postfix/smtpd[7476]: > rproxy.gmail.com[64.233.170.200]: 250-PIPELINING

Jan  6 22:08:12 localhost postfix/smtpd[7476]: > rproxy.gmail.com[64.233.170.200]: 250-SIZE 10240000

Jan  6 22:08:12 localhost postfix/smtpd[7476]: > rproxy.gmail.com[64.233.170.200]: 250-VRFY

Jan  6 22:08:12 localhost postfix/smtpd[7476]: > rproxy.gmail.com[64.233.170.200]: 250-ETRN

Jan  6 22:08:12 localhost postfix/smtpd[7476]: > rproxy.gmail.com[64.233.170.200]: 250-STARTTLS

Jan  6 22:08:12 localhost postfix/smtpd[7476]: > rproxy.gmail.com[64.233.170.200]: 250-AUTH LOGIN PLAIN

Jan  6 22:08:12 localhost postfix/smtpd[7476]: > rproxy.gmail.com[64.233.170.200]: 250-AUTH=LOGIN PLAIN

Jan  6 22:08:12 localhost postfix/smtpd[7476]: match_list_match: rproxy.gmail.com: no match

Jan  6 22:08:12 localhost postfix/smtpd[7476]: match_list_match: 64.233.170.200: no match

Jan  6 22:08:12 localhost postfix/smtpd[7476]: > rproxy.gmail.com[64.233.170.200]: 250 8BITMIME

Jan  6 22:08:12 localhost postfix/smtpd[7476]: watchdog_pat: 0x809f928

Jan  6 22:08:12 localhost postfix/smtpd[7476]: < rproxy.gmail.com[64.233.170.200]: MAIL FROM:<schiopu.ionut@gmail.com>

Jan  6 22:08:12 localhost postfix/smtpd[7476]: extract_addr: input: <real.email@gmail.com>

Jan  6 22:08:12 localhost postfix/smtpd[7476]: smtpd_check_addr: addr=real.email@gmail.com

Jan  6 22:08:29 localhost postfix/cleanup[7194]: warning: timeout on private/rewrite socket while reading input attribute name

Jan  6 22:08:29 localhost postfix/cleanup[7194]: warning: problem talking to service rewrite: Connection timed out

Jan  6 22:09:00 localhost postfix/trivial-rewrite[7479]: fatal: match_list_parse: read file /: Is a directory

Jan  6 22:09:01 localhost postfix/master[6921]: warning: process /usr/lib/postfix/trivial-rewrite pid 7479 exit status 1

Jan  6 22:09:01 localhost postfix/master[6921]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

```

and here is where it stops... no mail is delivered to the mailbox.

further more, no mail is sent from the server (from the webmail, to bo more precise...)

anyone else had a problem like this ?!?! c'mon guyz, i'm pretty desperate here  :Sad: 

----------

## langthang

hop on Freenode and /join #gentoo-netmail

----------

## lostone

case closed.

thanx to langthang, the problem si gone.

you'll probably gonna laugh 3 dayz in a row, but remember this:

if u follow the howto from gentoo.org regarding virtual email domains, and if you are rather lazy (...yes, like me) and copy-paste some things from the webpage in the config files, always remember to delete all the whitespaces and tabs from there.

now, i have an email system that really works, and it's doing a great job.

next step: spamassassin, clamav, or smth  :Smile:  most likely i will post here again shortly  :Razz: 

----------

