# jail + reverse proxy - postfix bounced email



## s2r (Jan 30, 2021)

I've got a jail just to act as a reverse proxy to another jail depending on the web hosts requested.
I found in the main host that the jail is trying to send mails, I guess a the daily reports emails, but bounces. How can I read those emails? I don't mind loging into the jail and reading them there. i would be better to read it in the main host.



```
reverse:/var/log@[4:05] # tail /var/log/maillog
Jan 30 03:53:44 reverse sendmail[92837]: 10P611Kr048239: to=root, ctladdr=root (0/0), delay=5+00:52:43, xdelay=00:00:00, mailer=relay, pri=570503, relay=[127.0.0.1] [10.0.0.1], dsn=4.1.8, reply=450 4.1.8 <root@reverse.my.domain>: Sender address rejected: Domain not found, stat=Deferred: 450 4.1.8 <root@reverse.my.domain>: Sender address rejected: Domain not found
Jan 30 03:53:44 reverse sendmail[92837]: 10P611Kr048239: 10U6rRcb092837: sender notify: Cannot send message for 5 days
Jan 30 03:53:44 reverse sendmail[92837]: 10U6rRcb092837: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31861, relay=[127.0.0.1] [10.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 067D4D7921)
```

Inside the jail I get that there's no email for root. 
This is the log from the main host:

```
[jas@li1349-286:/usr/local/etc/postfix $]> tail -n25 /var/log/maillog
Jan 30 03:53:41 li1249-186 postfix/smtpd[92839]: D6321D791F: client=unknown[10.0.0.1]
Jan 30 03:53:43 li1249-186 postfix/cleanup[92855]: D6321D791F: message-id=<202101300653.10U6rRca092837@reverse.my.domain>
Jan 30 03:53:44 li1249-186 postfix/qmgr[14395]: D6321D791F: from=<>, size=7224, nrcpt=1 (queue active)
Jan 30 03:53:44 li1249-186 postfix/smtpd[92839]: NOQUEUE: reject: RCPT from unknown[10.0.0.1]: 450 4.1.8 <root@reverse.my.domain>: Sender address rejected: Domain not found; from=<root@reverse.my.domain> to=<root@reverse.my.domain> proto=ESMTP helo=<reverse.my.domain>
Jan 30 03:53:44 li1249-186 postfix/smtp[92857]: D6321D791F: to=<root@reverse.my.domain>, relay=none, delay=3.2, delays=3.2/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=reverse.my.domain type=A: Host not found)
Jan 30 03:53:44 li1249-186 postfix/smtpd[92839]: 067D4D7921: client=unknown[10.0.0.1]
Jan 30 03:53:44 li1249-186 postfix/qmgr[14395]: D6321D791F: removed
Jan 30 03:53:44 li1249-186 postfix/cleanup[92855]: 067D4D7921: message-id=<202101300653.10U6rRcb092837@reverse.my.domain>
Jan 30 03:53:44 li1249-186 postfix/qmgr[14395]: 067D4D7921: from=<>, size=3071, nrcpt=1 (queue active)
Jan 30 03:53:44 li1249-186 postfix/smtpd[92839]: disconnect from unknown[10.0.0.1] ehlo=2 starttls=1 mail=15 rcpt=4/15 data=4/15 rset=25 quit=1 commands=52/74
Jan 30 03:53:44 li1249-186 postfix/smtp[92857]: 067D4D7921: to=<root@reverse.my.domain>, relay=none, delay=0.05, delays=0.04/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=reverse.my.domain type=A: Host not found)
Jan 30 03:53:44 li1249-186 postfix/qmgr[14395]: 067D4D7921: removed
```
Postfix is listening in all the devices, including lo1

```
lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet 10.0.0.2 netmask 0xffffffff
        inet 10.0.0.1 netmask 0xffffffff
        groups: lo
[jas@li1349-286:/usr/local/etc/postfix $]> postconf | grep interfaces
inet_interfaces = all
```
 Should I add reverse.my.domain to mainf.cf in "mydestination" variable?


----------



## im (Jan 30, 2021)

s2r said:


> 450 4.1.8 <root@reverse.my.domain>: Sender address rejected: Domain not found


First of all, try to add your internal networks to the postfix "mynetworks = ".
It is happening because of "reject_unknown_sender_domain" is enabled. It is a correct behavior.

If you wants to receive the mail at host then try to add these domains to the "mydestination".


----------

