# [SOLVED] Relay access denied - Again

## jecepede

Aloha !

And yet another 'Relay access denied'-question.

I have followed this document : https://wiki.gentoo.org/wiki/Complete_Virtual_Mail_Server : to create a virtual mailserver.

Most things went quite smooth. I have two test addresses and I can send from one to the other and vice versa however...

...when I try to send mail to an external hotmail account, I end up with the following error :

```

Jun 17 22:48:17 zaxxon postfix/smtpd[3887]: connect from unknown[10.0.1.129]

Jun 17 22:48:17 zaxxon postfix/smtpd[3887]: NOQUEUE: reject: RCPT from unknown[10.0.1.129]: 454 4.7.1 <external@hotmail.com>: Relay access denied; from=<jecepede@domain-one.nl> to=<external@hotmail.com> proto=ESMTP helo=<[10.0.1.129]>

Jun 17 22:48:18 zaxxon postfix/smtpd[3887]: disconnect from unknown[10.0.1.129] ehlo=1 mail=1 rcpt=0/1 quit=1 commands=3/4

```

Some extra info :

* My mail is send from Thunderbird which hangs in the same network as the mail server.

* When I use the same PC to an older mailserver in the same network (the one this one should be replacing) it works ok.

* Not sure if it matters : This new mailserver with the relay problem, runs in a VM....

```

zaxxon /etc/postfix # postconf -n

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

command_directory = /usr/sbin

compatibility_level = 2

daemon_directory = /usr/libexec/postfix

data_directory = /var/lib/postfix

debug_peer_level = 2

debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5

html_directory = no

inet_interfaces = all

inet_protocols = ipv4

local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname

local_transport = local

mail_owner = postfix

mail_spool_directory = /var/spool/mail

mailq_path = /usr/bin/mailq

manpage_directory = /usr/share/man

meta_directory = /etc/postfix

mydestination = localhost.$mydomain, localhost

mydomain = domain-one.nl

newaliases_path = /usr/bin/newaliases

queue_directory = /var/spool/postfix

readme_directory = no

relayhost = [smtp.upcmail.nl]

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

sample_directory = /etc/postfix

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

shlib_directory = /usr/lib64/postfix/${mail_version}

smtp_tls_note_starttls_offer = no

smtp_use_tls = no

smtpd_tls_auth_only = no

smtpd_use_tls = no

unknown_local_recipient_reject_code = 550

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

virtual_gid_maps = static:5000

virtual_mailbox_base = /var/vmail

virtual_mailbox_domains = domain-one.nl, domain-two.nl, domain-three.nl

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

virtual_minimum_uid = 1000

virtual_transport = virtual

virtual_uid_maps = static:5000

```

I have been at this for several weeks now so hopefully someone can help me see the light . . .

Cheeeeeeeeeeeers,

Jecepede

----------

## bbgermany

Hi,

does the old server run postfix as well? If yes, check whether it contains "mynetworks" and "smtpd_recipient_restrictions" in the main.cf

i have the following lines setup:

```

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.23.0/24 192.168.0.0/24

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination

```

This allows me to relay from my local LANs but not from the outside.

greets bb

----------

## jecepede

Aloha !

You Sir, bbgermany, are brilliant !!! #NotWorthy

How could I have completely missed this. I added the lines and yeah it works like a charm. 

Have to check if I indeed can't sent aimail from outside my own network but I think that should not be any problem.

To answer the question :

 *Quote:*   

> does the old server run postfix as well

 

Yes it does but.... it has none of these lines and yet the old one functiones just fine ?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

By the way; I did change one line :

```
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.23.0/24 192.168.0.0/24 
```

into :

```
mynetworks = 127.0.0.0/8 10.0.1.0/24
```

I do not use IPv6 (just yet) and my internal network is not a 192-IP 

Cheeeeeeeeeeeers,

Jecepede

----------

