# Postfix woes

## miha

Any suggestions?

```
zheka root # postfix check 

postfix: warning: My hostname localhost is not a fully qualified name - set myho                                                           stname or mydomain in /etc/postfix/main.cf

postfix/postfix-script: warning: My hostname localhost is not a fully qualified                                                            name - set myhostname or mydomain in /etc/postfix/main.cf

postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/privat                                                           e/.keep

postfix/postfix-script: warning: My hostname localhost is not a fully qualified                                                            name - set myhostname or mydomain in /etc/postfix/main.cf

postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/public                                                           /.keep

postsuper: warning: My hostname localhost is not a fully qualified name - set my                                                           hostname or mydomain in /etc/postfix/main.cf

postsuper: warning: bogus file name: defer/.keep

postsuper: warning: bogus file name: bounce/.keep

postsuper: warning: bogus file name: flush/.keep

postfix/postfix-script: warning: My hostname localhost is not a fully qualified                                                            name - set myhostname or mydomain in /etc/postfix/main.cf

postfix/postfix-script: warning: damaged message: corrupt/.keep
```

----------

## UberLord

You can safely erase the .keep files

You also need to specifiy a fqdn in /etc/postfix/main.cf for your server

----------

## puggy

Well. localhost is not a fully qualified domain name, as the error says. You need to set it to your fully qualified domain name. Such as machine.yourdomain.com. 

Puggy

----------

## UberLord

OT - Reading eh? Small world   :Laughing: 

----------

## puggy

 *UberLord wrote:*   

> OT - Reading eh? Small world  

 

Might I know you?

Puggy

----------

## miha

fqdn?

 *UberLord wrote:*   

> You can safely erase the .keep files
> 
> You also need to specifiy a fqdn in /etc/postfix/main.cf for your server

 

----------

## Arno

Fully Qualified Domain Name

E.G. myhost.mydomain.com

----------

## miha

well, I tried mycompname.isp domain.net wich of course doesn't resolve...

so...

 *Arno wrote:*   

> Fully Qualified Domain Name
> 
> E.G. myhost.mydomain.com

 

----------

## puggy

 *miha wrote:*   

> well, I tried mycompname.isp domain.net wich of course doesn't resolve...
> 
> so...
> 
>  *Arno wrote:*   Fully Qualified Domain Name
> ...

 

No. your computer should already have a fully qualified domain name.

What does 

```
hostname
```

 tell you?

In the install you have to set your hostname....

Puggy

----------

## UberLord

 *puggy wrote:*   

>  *UberLord wrote:*   OT - Reading eh? Small world   
> 
> Might I know you?
> 
> Puggy

 

Probably not - but hey. I rarely see someone from Reading on the forums I goto so it was kinda a shock!

----------

## UberLord

 *miha wrote:*   

> well, I tried mycompname.isp domain.net wich of course doesn't resolve...
> 
> so...

 

You need to give your computer a name.

My names are fairly basic. I'm typing on uberlaptop and I've got a server called uberserver. Both are in the domain ubernet.

So the fqdn name is uberserver.ubernet and uberlaptop.ubernet

You put the hostname (uberserver) in /etc/hostname

You put the domain name (ubernet) in /etc/dnsdomainname

Obviously, change uberserver and ubernet to names of your own liking.

For internal servers - which you will probably have it's best if the domain name does NOT exist on the 'net. IE don't use .com, .org, etc.

----------

## puggy

 *UberLord wrote:*   

> For internal servers - which you will probably have it's best if the domain name does NOT exist on the 'net. IE don't use .com, .org, etc.

 

Of course, if your hosting your own domain, like I am, it makes it nice and easy to make the localdomain the same as the domain I'm hosting for. Then (as soon as I get around to setting up DNS locally) I should be able to ssh mymachine.mydomain.com and it will work locally and from the outside.

Puggy

----------

## UberLord

 *puggy wrote:*   

> Of course, if your hosting your own domain, like I am, it makes it nice and easy to make the localdomain the same as the domain I'm hosting for. Then (as soon as I get around to setting up DNS locally) I should be able to ssh mymachine.mydomain.com and it will work locally and from the outside.
> 
> Puggy

 

There's a caveat to that.

If you're using NAT port forward to access a server from the 'net you can't use the external name internally as most routers won't allow internal IP's to get to the external IP and back in again.

So you need to run a DNS server that only responds to internal network requests so it can

a) server DNS to the LAN

b) redirect myhostname.demon.co.uk (xxx.xxx.xxx.xxx) to uberserver.ubernet (192.168.0.2) This allows any request to my public hostname to resolve correctly whether internal or external.

This in term creates havoc for using TLS over FTP as you need to masquerade the FTP for the external address. So internally you need a good FTP client that can work out the correct internal address if you need FTP. There are many workarounds for this however  :Smile: 

----------

## puggy

 *UberLord wrote:*   

>  *puggy wrote:*   Of course, if your hosting your own domain, like I am, it makes it nice and easy to make the localdomain the same as the domain I'm hosting for. Then (as soon as I get around to setting up DNS locally) I should be able to ssh mymachine.mydomain.com and it will work locally and from the outside.
> 
> Puggy 
> 
> There's a caveat to that.
> ...

 

I wasn't aware of the FTP issue. I am using NAT, but I never ssh to more than my server (and then ssh from there onwards) which is forwarded from the router on port 22.

Puggy

----------

## miha

I think I got it... but...

```
zheka root # postfix check

postsuper: warning: bogus file name: defer/.keep

postsuper: warning: bogus file name: bounce/.keep

postsuper: warning: bogus file name: maildrop/.keep

postsuper: warning: bogus file name: active/.keep

postsuper: warning: bogus file name: deferred/.keep

postsuper: warning: bogus file name: hold/.keep

postsuper: warning: bogus file name: flush/.keep

postfix/postfix-script: warning: damaged message: corrupt/.keep
```

----------

## miha

postfix seems to be running fine but... any pointers?

```
32 messages for mgl at mail.freeshell.org (226609 octets).

reading message mgl@mx.freeshell.org:1 of 32 (36185 octets) fetchmail: fetchmail: getaddrinfo(localhost.smtp)

fetchmail: SMTP connect to localhost failed

fetchmail: SMTP transaction error while fetching from mail.freeshell.org

fetchmail: Query status=10 (SMTP)

bash-2.05b$ 

```

----------

## UberLord

 *UberLord wrote:*   

> You can safely erase the .keep files

 

 :Smile: 

As to the other problem, post the contents of your .fetchmailrc

----------

## miha

 *UberLord wrote:*   

>  *UberLord wrote:*   You can safely erase the .keep files 
> 
> As to the other problem, post the contents of your .fetchmailrc

 

```
bash-2.05b$ cat .fetchmailrc 

set postmaster "mgl"

poll mail.freeshell.org. with proto POP3 auth password user "xxx" there 

with password "xxxxxx" is mgl here options warnings 3600
```

----------

## UberLord

I must have been having a brain fart this afternoon   :Embarassed: 

Anyways, it looks like postfix isn't allowing local connections through.

Ensure that you have 127.0.0.0/8 in mynetworks

If you're using SASL then ensure that you have permit_mynetworks in smtpd_client_restrictions and smtpd_recipient_restrictions

----------

