Mailing List Archive

Unterminated lines, mail relays, and hard to configure clients
Currently, I am running two instances of qmail under supervise. One on port
25 and the other on port 26. The one on port 26 is for the servers that I
manage which send unterminated lines which I then run through fixcrio in
order to insert missing CRs at the ends of lines.
I'm now being asked to set up a third instance for our servers which send
unterminated lines as well as refuse to go to a non-standard port. Does it
make sense to set up a third instance, or is there a way to set up one
instance of qmail to listen to two different ports at the same time?

Mike Robison
Re: Unterminated lines, mail relays, and hard to configure clients [ In reply to ]
On Monday 13 Jul 2015 09:51:59 Mike Robison wrote:
> Currently, I am running two instances of qmail under supervise. One on port
> 25 and the other on port 26.

I assume you mean qmail-smtpd via tcpserver or indeed inetd or xinetd running
on those ports.

> The one on port 26 is for the servers that I
> manage which send unterminated lines which I then run through fixcrio in
> order to insert missing CRs at the ends of lines.
> I'm now being asked to set up a third instance for our servers which send
> unterminated lines as well as refuse to go to a non-standard port. Does it
> make sense to set up a third instance, or is there a way to set up one
> instance of qmail to listen to two different ports at the same time?

One tcpserver process can only listen to a single port, so you'll need
separate instances for each port - but you don't need separate instances of
qmail[-send] itself - each tcpserver/qmail-smtpd instance can feed into the
same qmail queue (and corresponding qmail-send etc).

I hope that helps.

Andrew Richards.
--
====================================================================
* Custom email solutions * Systems Administration * Networking
http://www.acrconsulting.co.uk/email/qmail.html
====================================================================
Re: Unterminated lines, mail relays, and hard to configure clients [ In reply to ]
Thus said Mike Robison on Mon, 13 Jul 2015 09:51:59 -0400:

> I'm now being asked to set up a third instance for our servers which
> send unterminated lines as well as refuse to go to a non-standard
> port. Does it make sense to set up a third instance, or is there a way
> to set up one instance of qmail to listen to two different ports at
> the same time?

I suppose correcting the problem at the source (e.g. the non-compliant
servers) is out of the question?

As for whether or not it makes sense to setup a third instance... did it
make sense to setup the second instance?

Thanks,

Andy
--
TAI64 timestamp: 4000000055a3cea1
Re: Unterminated lines, mail relays, and hard to configure clients [ In reply to ]
On Mon, Jul 13, 2015 at 10:07 AM, Andrew Richards <
ar-djblists@acrconsulting.co.uk> wrote:

> On Monday 13 Jul 2015 09:51:59 Mike Robison wrote:
> > Currently, I am running two instances of qmail under supervise. One on
> port
> > 25 and the other on port 26.
>
> I assume you mean qmail-smtpd via tcpserver or indeed inetd or xinetd
> running
> on those ports.
>
Yes, tcpserver. And under /var/qmail/supervise, I have qmail-smtpd and
qmail-smtpd2 (I must have been following these instructions at the time:
http://mugurel.sumanariu.ro/linux/running-toaster-qmail-smtp-on-a-2nd-port/)
qmail-smtpd is on port 25
qmail-smtpd2 is on port 26 and runs fixcrio.
Both listen, using the server's localname.


> > The one on port 26 is for the servers that I
> > manage which send unterminated lines which I then run through fixcrio in
> > order to insert missing CRs at the ends of lines.
> > I'm now being asked to set up a third instance for our servers which send
> > unterminated lines as well as refuse to go to a non-standard port. Does
> it
> > make sense to set up a third instance, or is there a way to set up one
> > instance of qmail to listen to two different ports at the same time?
>
> One tcpserver process can only listen to a single port, so you'll need
> separate instances for each port - but you don't need separate instances of
> qmail[-send] itself - each tcpserver/qmail-smtpd instance can feed into the
> same qmail queue (and corresponding qmail-send etc).



I hope that helps.
>
So I guess this modifies my question to, how does one get two instances of
tcpserver to listen on the same port, but to requests coming to either two
different interfaces (ie eth0 and eth1) or two different hostnames (host1
and host2 but pointing to the same machine)? I see that tcpserver has a -l
flag for localname. Is that an avenue I could pursue?

>
> Andrew Richards.
> --
> ====================================================================
> * Custom email solutions * Systems Administration * Networking
> http://www.acrconsulting.co.uk/email/qmail.html
> ====================================================================
>
Re: Unterminated lines, mail relays, and hard to configure clients [ In reply to ]
On Mon, Jul 13, 2015 at 10:43 AM, Andy Bradford <
amb-sendok-1439390589.bkbolefmogjlpebjbpca@bradfords.org> wrote:

> Thus said Mike Robison on Mon, 13 Jul 2015 09:51:59 -0400:
>
> > I'm now being asked to set up a third instance for our servers which
> > send unterminated lines as well as refuse to go to a non-standard
> > port. Does it make sense to set up a third instance, or is there a way
> > to set up one instance of qmail to listen to two different ports at
> > the same time?
>
> I suppose correcting the problem at the source (e.g. the non-compliant
> servers) is out of the question?
>
Sigh. I wish it wasn't.

>
> As for whether or not it makes sense to setup a third instance... did it
> make sense to setup the second instance?
>
I think so. As I recall, I didn't want everything running through fixcrio.

>
> Thanks,
>
> Andy
> --
> TAI64 timestamp: 4000000055a3cea1
>
>
>
Re: Unterminated lines, mail relays, and hard to configure clients [ In reply to ]
On Monday 13 Jul 2015 11:19:55 Mike Robison wrote:
> On Mon, Jul 13, 2015 at 10:07 AM, Andrew Richards <
>
> ar-djblists@acrconsulting.co.uk> wrote:
> > On Monday 13 Jul 2015 09:51:59 Mike Robison wrote:
> > > Currently, I am running two instances of qmail under supervise. One on
> > > port 25 and the other on port 26.
> >
> > I assume you mean qmail-smtpd via tcpserver or indeed inetd or xinetd
> > running on those ports.
>
> Yes, tcpserver. And under /var/qmail/supervise, I have qmail-smtpd and
> qmail-smtpd2 (I must have been following these instructions at the time:
> http://mugurel.sumanariu.ro/linux/running-toaster-qmail-smtp-on-a-2nd-port/)
> qmail-smtpd is on port 25
> qmail-smtpd2 is on port 26 and runs fixcrio.
> Both listen, using the server's localname.
>
> > > The one on port 26 is for the servers that I
> > > manage which send unterminated lines which I then run through fixcrio in
> > > order to insert missing CRs at the ends of lines.
> > > I'm now being asked to set up a third instance for our servers which
> > > send unterminated lines as well as refuse to go to a non-standard port.
> > > Does it make sense to set up a third instance, or is there a way to set
> > > up one instance of qmail to listen to two different ports at the same
> > > time?
> >
> > One tcpserver process can only listen to a single port, so you'll need
> > separate instances for each port - but you don't need separate instances
> > of qmail[-send] itself - each tcpserver/qmail-smtpd instance can feed into
> > the same qmail queue (and corresponding qmail-send etc).
>
> I hope that helps.
>
> So I guess this modifies my question to, how does one get two instances of
> tcpserver to listen on the same port, but to requests coming to either two
> different interfaces (ie eth0 and eth1) or two different hostnames (host1
> and host2 but pointing to the same machine)? I see that tcpserver has a -l
> flag for localname. Is that an avenue I could pursue?

Specify the host argument for the IP address to listen on (you may have this
set to '0' at the moment, meaning all IP addresses that the machine listens
on) (see the webpage on tcpserver, or install the ucspi-tcp man pages which
includes a man page for tcpserver).

cheers,

Andrew.
--
====================================================================
* Custom email solutions * Systems Administration * Networking
http://www.acrconsulting.co.uk/email/qmail.html
====================================================================
Re: Unterminated lines, mail relays, and hard to configure clients [ In reply to ]
On Mon, Jul 13, 2015 at 12:41 PM, Andrew Richards <
ar-djblists@acrconsulting.co.uk> wrote:

> On Monday 13 Jul 2015 11:19:55 Mike Robison wrote:
> > On Mon, Jul 13, 2015 at 10:07 AM, Andrew Richards <
> >
> > ar-djblists@acrconsulting.co.uk> wrote:
> > > On Monday 13 Jul 2015 09:51:59 Mike Robison wrote:
> > > > Currently, I am running two instances of qmail under supervise. One
> on
> > > > port 25 and the other on port 26.
> > >
> > > I assume you mean qmail-smtpd via tcpserver or indeed inetd or xinetd
> > > running on those ports.
> >
> > Yes, tcpserver. And under /var/qmail/supervise, I have qmail-smtpd and
> > qmail-smtpd2 (I must have been following these instructions at the time:
> >
> http://mugurel.sumanariu.ro/linux/running-toaster-qmail-smtp-on-a-2nd-port/
> )
> > qmail-smtpd is on port 25
> > qmail-smtpd2 is on port 26 and runs fixcrio.
> > Both listen, using the server's localname.
> >
> > > > The one on port 26 is for the servers that I
> > > > manage which send unterminated lines which I then run through
> fixcrio in
> > > > order to insert missing CRs at the ends of lines.
> > > > I'm now being asked to set up a third instance for our servers which
> > > > send unterminated lines as well as refuse to go to a non-standard
> port.
> > > > Does it make sense to set up a third instance, or is there a way to
> set
> > > > up one instance of qmail to listen to two different ports at the same
> > > > time?
> > >
> > > One tcpserver process can only listen to a single port, so you'll need
> > > separate instances for each port - but you don't need separate
> instances
> > > of qmail[-send] itself - each tcpserver/qmail-smtpd instance can feed
> into
> > > the same qmail queue (and corresponding qmail-send etc).
> >
> > I hope that helps.
> >
> > So I guess this modifies my question to, how does one get two instances
> of
> > tcpserver to listen on the same port, but to requests coming to either
> two
> > different interfaces (ie eth0 and eth1) or two different hostnames (host1
> > and host2 but pointing to the same machine)? I see that tcpserver has a
> -l
> > flag for localname. Is that an avenue I could pursue?
>
> Specify the host argument for the IP address to listen on (you may have
> this
> set to '0' at the moment, meaning all IP addresses that the machine listens
> on) (see the webpage on tcpserver, or install the ucspi-tcp man pages which
> includes a man page for tcpserver).
>
Oh great. I think I can handle that. Currently, it uses the hostname:

-l "resh.wts.edu"

But if I'm interpreting right, I could just point two dns records at my
machine resh.wts.edu and resh2.wts.edu and on a second setup, use -l "
resh2.wts.edu" and that would differentiate between endpoints. Right?

Much thanks,
Mike


> cheers,
>
> Andrew.
> --
> ====================================================================
> * Custom email solutions * Systems Administration * Networking
> http://www.acrconsulting.co.uk/email/qmail.html
> ====================================================================
>
Re: Unterminated lines, mail relays, and hard to configure clients [ In reply to ]
Thus said Mike Robison on Mon, 13 Jul 2015 11:21:31 -0400:

> I think so. As I recall, I didn't want everything running through
> fixcrio.

You could make it optionally controlled via tcpserver environment
variables. For example,

$ cat /var/qmail/bin/qmail-fixcrio
#!/bin/sh

if [ x"$FIXCRIO" = x"YES" ]
then
exec fixcrio ${1+"$@"}
fi
exec ${1+"$@"}

Then, in your /etc/tcp/smtp (or whatever you have tcpserver configured
to use with -x) you add something like:

192.168.1.1:allow,FIXCRIO="YES"

In your run script for qmail-smtpd, just inject qmail-fixcrio in the
chain; for example:

exec ... tcpserver ... qmail-fixcrio qmail-smtpd 2>&1

I've left out whatever details you might have in your run script for
qmail-smtpd, so you'll have to fill in those details.

This allows you to run qmail-smtpd on port 25 and selectively apply
fixcrio to various IP addresses that require it, while leaving the rest
alone.

Andy
--
TAI64 timestamp: 4000000055a40907
Re: Unterminated lines, mail relays, and hard to configure clients [ In reply to ]
On Mon, Jul 13, 2015 at 2:56 PM, Andrew Richards <
ar-djblists@acrconsulting.co.uk> wrote:

> On Monday 13 Jul 2015 13:17:54 Mike Robison wrote:
> > > So I guess this modifies my question to, how does one get two
> instances of
> > > tcpserver to listen on the same port, but to requests coming to either
> two
> > > different interfaces (ie eth0 and eth1) or two different hostnames
> (host1
> > > and host2 but pointing to the same machine)? I see that tcpserver has
> a -l
> > > flag for localname. Is that an avenue I could pursue?
> >
> > Specify the host argument for the IP address to listen on (you may have
> this
> > set to '0' at the moment, meaning all IP addresses that the machine
> listens
> > on) (see the webpage on tcpserver, or install the ucspi-tcp man pages
> which
> > includes a man page for tcpserver).
> > Oh great. I think I can handle that. Currently, it uses the hostname:
> >
> > -l "resh.wts.edu"
> >
> > But if I'm interpreting right, I could just point two dns records at my
> > machine resh.wts.edu and resh2.wts.edu and on a second setup, use -l
> > "resh2.wts.edu" and that would differentiate between endpoints. Right?
>
> I reiterate: see the webpage on tcpserver, or install the ucspi-tcp man
> pages
> which includes a man page for tcpserver.
>
Yeah, you're right. I thought I was reading it right and thought the piece
of it that read "*-l localname (Do not look up the local host name; use
localname for TCPLOCALHOST)"* was what you were referring to. Your comment
about '0' should have clued me in. Once I reattached my brain, I understood
that you were probably referring me to the top of the man page and not the
depths... Sigh.
Thanks so much for your help! It's all working great now.
Mike

>
> cheers,
>
> Andrew.
> --
> ====================================================================
> * Custom email solutions * Systems Administration * Networking
> http://www.acrconsulting.co.uk/email/qmail.html
> ====================================================================
>