# Configure a Postfix

## matulik

Hello.

I'm trying to configure Postfix by http://wiki.gentoo.org/wiki/Complete_Virtual_Mail_Server.

I stayed in this moment: http://wiki.gentoo.org/wiki/Complete_Virtual_Mail_Server/Postfix_to_Database

I created a configuration files in /etc/postfix, and I've problem with "Connecting postfix to the queries".

After this..

(part of /etc/postfix/main.cf)

```

virtual_uid_maps = static:5000

virtual_gid_maps = static:5000

virtual_mailbox_base = /var/vmail

virtual_mailbox_domains = pgsql:/etc/postfix/pgsql/virtual_mailbox_domains.cf

virtual_mailbox_maps = pgsql:/etc/postfix/pgsql/virtual_mailbox_maps.cf

virtual_alias_maps = pgsql:/etc/postfix/pgsql/virtual_alias_maps.cf

```

..I'm trying to send test-message by telnet. Buy in logs I get:

```

Dec 21 22:44:25 matulik postfix/smtpd[20602]: error: open database /etc/mail/aliases.db: No such file or directory

Dec 21 22:44:25 matulik postfix/smtpd[20602]: connect from localhost[127.0.0.1]

Dec 21 22:44:38 matulik postfix/trivial-rewrite[20595]: warning: do not list domain matulik.pl in BOTH mydestination and virtual_mailbox_domains

Dec 21 22:44:38 matulik postfix/smtpd[20602]: 866E17FC51: client=localhost[127.0.0.1]

Dec 21 22:44:46 matulik postfix/cleanup[20610]: 866E17FC51: message-id=<20131221214438.866E17FC51@matulik.pl>

Dec 21 22:44:46 matulik postfix/qmgr[20592]: 866E17FC51: from=<me@you.com>, size=298, nrcpt=1 (queue active)

Dec 21 22:44:46 matulik postfix/trivial-rewrite[20595]: warning: do not list domain matulik.pl in BOTH mydestination and virtual_mailbox_domains

Dec 21 22:44:46 matulik postfix/local[20613]: error: open database /etc/mail/aliases.db: No such file or directory

Dec 21 22:44:46 matulik postfix/local[20613]: warning: hash:/etc/mail/aliases is unavailable. open database /etc/mail/aliases.db: No such file or directory

Dec 21 22:44:46 matulik postfix/local[20613]: warning: hash:/etc/mail/aliases: lookup of 'testuser' failed

Dec 21 22:44:46 matulik postfix/local[20613]: 866E17FC51: to=<testuser@matulik.pl>, relay=local, delay=15, delays=15/0.01/0/0.04, dsn=4.3.0, status=deferred (alias database unavailable)

Dec 21 22:44:47 matulik postfix/smtpd[20602]: disconnect from localhost[127.0.0.1]

```

What's with the /etc/mail/aliases.db file?

I tried to set alias_database variable in main.cf and run newaliases, but it's not done.

----------

## papahuhn

You need to set alias_maps to something that exists.

----------

## matulik

I created a aliases file with local aliases, after this run newaliases. Now its fine  :Smile: 

Now I've another problem. Im trying to run IMAP by SSL, like this: https://wiki.gentoo.org/wiki/Complete_Virtual_Mail_Server/SSL_Certificates

But I have this problem:

```

Dec 22 17:44:41 matulik imapd-ssl: couriertls: accept: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol

```

When I try to telnet localhost 993, but openssl s_client -connect localhost:993 works.

----------

