smtp relaying w/ qmail and iptables

smtp relaying w/ qmail and iptables

Post by Dea » Thu, 03 Apr 2003 14:52:26



Short:

My SMTP server rejects mail from the internal LAN but not from the
server itself. I've set up qmail to relay from localhost and the LAN,
but it doesn't seem to be working. I just set up a firewall, but I
doubt that has anything to do with it.

Long:

I'm using qmail 1.03 on RedHat Linux 7.3 with kernel 2.4.18-27.7.x.

I recently got broadband access and set up an iptables firewall that
does very simple input/output/forwarding, just enough to allow SNAT
for my internal LAN, DHCP for the external interface and internal LAN,
any internal connections, and no *new* external connections at all.

I have qmail set up to allow relaying from the internal LAN:

[/etc/hosts.allow]
tcp-env: 127.0.0.1, .my.lans.fake.domain.name: setenv = RELAYCLIENT

My DNS server has valid zones for this fake domain as well; it works
with all other applications, including DHCPd, which gets the hostname
from DNS, not statically from the conf file.

I can send an external email (and verify it is delivered) from the
server itself with no problem.


But when I attempt to email via SMTP from the internal LAN, I get the
mail returned immediately as undeliverable with this error:

"553 sorry, that domain isn't in my list of allowed rcpthosts
(#5.7.1)"

/var/qmail/control/rcpthosts lists all possible domains I receive mail
for (via local delivery and fetchmail only though), but as per
documentation, qmail should ignore rcpthosts when tcpwrappers are
used.

Just in case, here's /etc/xinetd.d/smtp:

service smtp
{
        socket_type = stream
        protocol    = tcp
        wait        = no
        user        = qmaild
        server      = /var/qmail/bin/tcp-env
        server_args = /var/qmail/bin/qmail-smtpd
        disable     = no

Quote:}

I'm relatively sure this is a qmail problem, but as I also just set up
the firewall, it may be related. I'll probably kick myself for
forgetting something easy, but I'd appreciate any help. Any ideas?

Thanks.

Dean

[Previously posted to comp.os.linux.networking with no response.]

 
 
 

smtp relaying w/ qmail and iptables

Post by nobodadd » Mon, 07 Apr 2003 17:13:40


<snip>

Quote:> "553 sorry, that domain isn't in my list of allowed rcpthosts
> (#5.7.1)"

> /var/qmail/control/rcpthosts lists all possible domains I receive mail
> for (via local delivery and fetchmail only though), but as per
> documentation, qmail should ignore rcpthosts when tcpwrappers are
> used.

FWIW, I think xinetd != tcpwrappers.

Quote:> I'm relatively sure this is a qmail problem, but as I also just set up
> the firewall, it may be related. I'll probably kick myself for
> forgetting something easy, but I'd appreciate any help. Any ideas?

My only other idea is you might try opening up the fw (set all iptables
rules to ACCEPT), just for a minute, to make sure it's not the fw.  Prolly
won't kill 'ya.

Quote:

> Thanks.

> Dean

> [Previously posted to comp.os.linux.networking with no response.]

Try searching google groups on the 553 msg, plus "qmail" and "relay".

Try posting to alt.comp.mail.qmail.

--
The other day a dog peed on me.  A bad sign.
- H.L. Mencken

 
 
 

1. qmail-smtp relaying problem.

    Hello.

    I'm having a bit of a problem witih q-mail's smtp relaying.  In the
past we had all of our machines as thier own smtp server and everything
worked fine.  Howerver now I'm trying to centralize to one smtp server,
with all other machines having thier mail packages set with that server
as thier smtp server.
    Relaying is working, but I get delivery failure notice if I try to
send from any of the client machiens to addresses outside our subnet
with qmail claiming it could not find the destination host.  However, if
I send dirrectly from the server, or from a machine that has not been
switched over, the mail goes though fine.
    Can anyone suggest what I'm doing wrong here? It almost feels like a
DNS issue, but I can't figure out why the relay would be doing lookups
differntly then a machine with a server sitting on it.

    Any help would be appreciated.

2. Newbie Compiler Question

3. Qmail for smtp-relay on a pix?

4. help:use the trident Blade 3D video card

5. iptables and smtp relaying

6. Cardbus DMA with CardBus card as initiator

7. qmail open relay

8. Using a serial keyboard under X11

9. qmail refuses to relay

10. qmail relay

11. qmail open relay

12. Qmail relaying stopped working