# [SOLVED] Setting up a mail server

## Deadly Assassin

I rent a vServer and already installed a web server (lighty), a MySQL server and a murmur server.

Everything works fine.

A few days ago I tried to set up a mail server with this Gentoo Virt Mail HowTo.

Everything worked well until Step 10.

When I finished Step 10 I should have a full working mail server, but not everything worked.

It is possible to receive emails and download them with an external mail client.

It is also possible to send local mails.

You can local send mails to some extern mail server, like gmx (but not every extern mail server is possible).

It is also impossible to send mails with an email client.

I hope anybody can help me!  :Wink: 

----------

## jodel

perhaps this helps, though it's not for virtual but real users:

http://www.kurzor.org/entry/16/setting-up-a-mailserver-on-gentoo

----------

## Deadly Assassin

Thanks, but I don't search for a new tutorial.

I am searching for a solution to "repair" my existing installation.

But if nothing could solve my problems, I will try this tutorial.  :Wink: 

----------

## Anarcho

What about some log files when something goes wrong?

----------

## Deadly Assassin

I don't know exactly which logs you need, but here are the logs of mail:

mail.err

http://paste.pocoo.org/show/257995/

mail.log

http://paste.pocoo.org/show/258004/

But I don't think there is any useful information in this logs.

Tell me if you need some other log files.

----------

## Anarcho

These logfiles are pretty old and from sSMTP which should no longer be on your system.

Please look for the correct logfiles.

----------

## Deadly Assassin

Here is a list with the whole directories of /var/log/

http://paste.pocoo.org/show/258070/

----------

## Anarcho

You could have a look in messages

or try

grep postfix /var/log/*

----------

## ctwx

Thanks for your help. I wondered where smtp saves it's log. Due to /var/log/messages I found out, that the file /etc/postfix/mysql-virtual-maps.cf was missing. I created one:

```
# mysql-virtual.cf

user         = mailsql

password     = *censored*

dbname       = mailsql

table        = users

select_field = maildir

where_field  = email

additional_conditions = and postfix = 'y'

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

Thunderbird now finds the smtp server but it fails to accept the SSL certificate. It downloads the cert. but I cannot except it. The server log says (this is just an excerpt):

 *Quote:*   

> Sep 11 09:14:48 vadmin16 postfix/smtpd[9325]: SSL3 alert read:fatal:unknown CA
> 
> Sep 11 09:14:48 vadmin16 postfix/smtpd[9325]: SSL_accept:failed in SSLv3 read client certificate A
> 
> Sep 11 09:14:48 vadmin16 postfix/smtpd[9325]: SSL_accept error from my-public-hostname.provider.de[my.public.ip.address]: 0
> ...

 

I replaced my public ip and my public hostname with my.public.ip.address and my-public-hostname.provider.de. (I'm currently forced to run Windows and I don't want to risk anything^^)

I think, this part is the interesting one:

 *Quote:*   

> Sep 11 09:14:48 vadmin16 postfix/smtpd[9325]: match_hostname: my-public-hostname.provider.de ~? my.ip.net.work/24
> 
> Sep 11 09:14:48 vadmin16 postfix/smtpd[9325]: match_hostaddr: my.public.ip.address ~? my.ip.net.work/24
> 
> Sep 11 09:14:48 vadmin16 postfix/smtpd[9325]: match_hostname: my-public-hostname.provider.de ~? 127.0.0.0/8
> ...

 

It matches my ip and hostname with localhost, but of course it does not match. So, do I have to disable this match or is there a whitelist I can use? But the next problem is, if I add my current ip and/or hostname, I won't able to access tomorrow.

Thank you.

p.s.: I'm not Deadly Assassin, I'm the second server admin.

p.s.2: The SSL certificate is self-signed.

----------

## ctwx

I solved it. The certs had to include the name of the two servers, imap.bluepanel.de and smtp.bluepanel.de.

Thanks for your help.

----------

