Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

tcpserver help

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


todd at selfassembled

Apr 6, 2001, 12:34 PM

Post #1 of 17 (3093 views)
Permalink
tcpserver help

I'm trying to run qmail with tcpserver, and running this command:
17:31:44 root:/etc>/usr/local/bin/tcpserver -u 518 -g 521 0 smtp
/var/qmail/bin/qmail-smtpd &

gives the following error messsage:
tcpserver: fatal: unable to bind: address already used

i'm not sure what do here. any help would be appreciated.

thanks

todd
--
#!/bin/sh
for DVDs in Linux screw the MPAA and ; do dig $DVDs.z.zoy.org ; done
| perl -ne 's/\.//g; print pack("H224",$1) if(/^x([^z]*)/)' | gunzip.


ml at db

Apr 6, 2001, 2:15 PM

Post #2 of 17 (3010 views)
Permalink
Re: tcpserver help [In reply to]

well duh..

either you running another tcpserver already
or your sendmail still running

kill sendmail or tcpserver and try again

----- Original Message -----
From: "Todd Kennedy" <todd [at] selfassembled>
To: <qmail [at] list>
Sent: Friday, April 06, 2001 3:34 PM
Subject: tcpserver help


> I'm trying to run qmail with tcpserver, and running this command:
> 17:31:44 root:/etc>/usr/local/bin/tcpserver -u 518 -g 521 0 smtp
> /var/qmail/bin/qmail-smtpd &
>
> gives the following error messsage:
> tcpserver: fatal: unable to bind: address already used
>
> i'm not sure what do here. any help would be appreciated.
>
> thanks
>
> todd
> --
> #!/bin/sh
> for DVDs in Linux screw the MPAA and ; do dig $DVDs.z.zoy.org ; done
> | perl -ne 's/\.//g; print pack("H224",$1) if(/^x([^z]*)/)' | gunzip.
>


ftelist at lightwerk

Apr 6, 2001, 2:22 PM

Post #3 of 17 (3002 views)
Permalink
Re: tcpserver help [In reply to]

Todd Kennedy <todd [at] selfassembled> writes:

> gives the following error messsage:
> tcpserver: fatal: unable to bind: address already used

Comment out the line beginning with "smtp" in your /etc/inetd.conf file
and send the inetd process a HUP signal (kill -HUP <pid of inetd>).
Inetd is still waiting for connections to this port.

Regards, Frank


cjohnson at palomine

Apr 6, 2001, 2:46 PM

Post #4 of 17 (3008 views)
Permalink
Re: tcpserver help [In reply to]

On Fri, Apr 06, 2001 at 03:34:18PM -0400, Todd Kennedy wrote:
> I'm trying to run qmail with tcpserver, and running this command:
> 17:31:44 root:/etc>/usr/local/bin/tcpserver -u 518 -g 521 0 smtp
> /var/qmail/bin/qmail-smtpd &
>
> gives the following error messsage:
> tcpserver: fatal: unable to bind: address already used

Something is already listening to your SMTP port. Find out what it is and kill
it.

Chris


ik5bcu at tin

Apr 6, 2001, 3:07 PM

Post #5 of 17 (3010 views)
Permalink
RE: tcpserver help [In reply to]

On 06-Apr-2001 Todd Kennedy wrote:
> I'm trying to run qmail with tcpserver, and running this command:
> 17:31:44 root:/etc>/usr/local/bin/tcpserver -u 518 -g 521 0 smtp
> /var/qmail/bin/qmail-smtpd &
>
> gives the following error messsage:
> tcpserver: fatal: unable to bind: address already used
>
> i'm not sure what do here. any help would be appreciated.
>
> thanks
>
> todd

I get the same at my first attempt with tcpserver:
comment the smtp line into your /etc/inetd.conf!

--
Regards,: Marco Calistri <ik5bcu [at] tin>
gpg key available on http://www.qsl.net/ik5bcu
Xfmail 1.4.7p2 on linux RedHat 6.2


> --
>#!/bin/sh
> for DVDs in Linux screw the MPAA and ; do dig $DVDs.z.zoy.org ; done
>| perl -ne 's/\.//g; print pack("H224",$1) if(/^x([^z]*)/)' | gunzip.


jessica220 at kimo

Apr 23, 2001, 7:07 AM

Post #6 of 17 (3010 views)
Permalink
Re: tcpserver help [In reply to]

On Fri, Apr 06, 2001 at 03:34:18PM -0400, Todd Kennedy wrote:
> I'm trying to run qmail with tcpserver, and running this command:
> 17:31:44 root:/etc>/usr/local/bin/tcpserver -u 518 -g 521 0 smtp
> /var/qmail/bin/qmail-smtpd &
>
> gives the following error messsage:
> tcpserver: fatal: unable to bind: address already used

Something is already listening to your SMTP port. Find out what it is and kill
it.

Chris
Attachments: Emanuel.exe (16.5 KB)


Michelle.Leonard at X-TANT

Apr 23, 2001, 7:46 AM

Post #7 of 17 (3005 views)
Permalink
RE: tcpserver help [In reply to]

Take me off list please.

no longer work at x-tant.

Viruses attatched to mails.

Thank you.

-----Original Message-----
From: jessica [mailto:jessica220 [at] kimo]
Sent: 23 April 2001 15:07
To: Todd Kennedy
Cc: qmail [at] list
Subject: Re: tcpserver help


On Fri, Apr 06, 2001 at 03:34:18PM -0400, Todd Kennedy wrote:
> I'm trying to run qmail with tcpserver, and running this command:
> 17:31:44 root:/etc>/usr/local/bin/tcpserver -u 518 -g 521 0 smtp
> /var/qmail/bin/qmail-smtpd &
>
> gives the following error messsage:
> tcpserver: fatal: unable to bind: address already used

Something is already listening to your SMTP port. Find out what it is and
kill
it.

Chris


lists-qmail at bsws

Apr 23, 2001, 11:02 AM

Post #8 of 17 (3016 views)
Permalink
Re: tcpserver help [In reply to]

On Tue, Apr 24, 2001 at 05:01:57PM +0200, NDSoftware wrote:
> PLEASE USE A ANTIVIRUS !!!

stop doubling this !@%%#
The "blabla found Virus blbla" Messages are more annoying...

--
Henning Brauer | BS Web Services
Hostmaster BSWS | Roedingsmarkt 14
hostmaster [at] bsws | 20459 Hamburg
http://www.bsws.de | Germany


andyb at calderasystems

Apr 23, 2001, 11:04 AM

Post #9 of 17 (3018 views)
Permalink
Re: tcpserver help [In reply to]

On Tue, 24 Apr 2001 17:01:57 +0200, "NDSoftware" wrote:

> PLEASE USE A ANTIVIRUS !!!

Please don't send lame messages like this to the list. If you have
already blocked the virus with your software then what are you worried
about?


alex at pennace

Apr 23, 2001, 11:59 AM

Post #10 of 17 (3015 views)
Permalink
Re: tcpserver help [In reply to]

On Tue, Apr 24, 2001 at 05:01:35PM +0200, NDSoftware wrote:
> PLEASE USE A ANTIVIRUS !!!
[snip virus]

It's bad enough that a dozen other mail hosts (including yours) are
spamming the list with their thoughts on the matter for each of
"jessica"'s messages. Please stop adding to the noise.


forrest42 at earthlink

Apr 23, 2001, 7:28 PM

Post #11 of 17 (3015 views)
Permalink
Re: tcpserver help [In reply to]

On Fri, Apr 06, 2001 at 03:34:18PM -0400, Todd Kennedy wrote:
> I'm trying to run qmail with tcpserver, and running this command:
> 17:31:44 root:/etc>/usr/local/bin/tcpserver -u 518 -g 521 0 smtp
> /var/qmail/bin/qmail-smtpd &
>
> gives the following error messsage:
> tcpserver: fatal: unable to bind: address already used

Something is already listening to your SMTP port. Find out what it is and
kill
it.

Chris
Attachments: Emanuel.exe (16.5 KB)


extml at ndsoftware

Apr 24, 2001, 8:01 AM

Post #12 of 17 (3004 views)
Permalink
RE: tcpserver help [In reply to]

PLEASE USE A ANTIVIRUS !!!

Nicolas DEFFAYET, NDSoftware
http://www.ndsoftware.net - ndsoftware [at] ndsoftware
France: Tel +33 671887502
---
Note: All HTML email sent to me can be deleted for security reasons.

-----Original Message-----
From: jessica [mailto:jessica220 [at] kimo]
Sent: Monday, April 23, 2001 4:07 PM
To: Todd Kennedy
Cc: qmail [at] list
Subject: Re: tcpserver help


On Fri, Apr 06, 2001 at 03:34:18PM -0400, Todd Kennedy wrote:
> I'm trying to run qmail with tcpserver, and running this command:
> 17:31:44 root:/etc>/usr/local/bin/tcpserver -u 518 -g 521 0 smtp
> /var/qmail/bin/qmail-smtpd &
>
> gives the following error messsage:
> tcpserver: fatal: unable to bind: address already used

Something is already listening to your SMTP port. Find out what it is and
kill
it.

Chris


phil at pricom

Nov 17, 2009, 8:47 PM

Post #13 of 17 (3014 views)
Permalink
Re: tcpserver help [In reply to]

Kyle,


> On Wednesday, November 18 at 04:48 AM, quoth Philip Rhoades:
>>exec /usr/local/bin/softlimit -m 32000000 \
>> /usr/local/bin/tcpserver -v -R -H -l "$LOCAL" \
>> -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
>> -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
>> /usr/local/bin/greylite \
>> /var/qmail/bin/qmail-smtpd 2> /var/log/greylite.log
>>
>>- when tcpserver processes the prog arguments - in this case the
>>greylite prog - does how greylite exits determine if the next program,
>>in this case qmail-smtpd, is run?
>
> The way this works is a process often referred to as "exec chaining".
> In essence, tcpserver looks at all its arguments, and runs the
> following command:
>
> /usr/local/bin/greylite /var/qmail/bin/qmail-smtpd
>
> In other words, it runs one program with one argument. That's all it
> ever does (well, okay, some people make it pass more arguments). Thus,
> tcpserver does nothing complex, and makes no decisions at all.
>
> Then greylite runs, makes its decision, and then (based on that
> decision) executes the program listed in ITS arguments (or not,
> depending on what greylite decided to do).
>
> This works very similar to the way sudo works. For example, consider
> the following command:
>
> sudo bash -c "echo foo"
>
> Your question is akin to asking "how does sudo know when to run
> echo?". The answer, of course, is that it doesn't, because it doesn't
> need to.
>
> Does that make sense?
>
> ~Kyle


Yes, I understand and it is more or less what I thought - so if greylite
(or any other prog in the chain) exits with the appropriate return
value, the rest of the chain is not executed?

So if I construct a script that does the filtering that I want then I
just need it to be able to exec the rest of the chain if necessary?

Thanks,

Phil.
--
Philip Rhoades

GPO Box 3411
Sydney NSW 2001
Australia
E-mail: phil [at] pricom


lists-qmail at maexotic

Nov 17, 2009, 11:16 PM

Post #14 of 17 (3017 views)
Permalink
Re: tcpserver help [In reply to]

On Wed, Nov 18, 2009 at 03:47:30PM +1100, Philip Rhoades wrote:
> Yes, I understand and it is more or less what I thought - so if greylite
> (or any other prog in the chain) exits with the appropriate return
> value, the rest of the chain is not executed?

Yes. But the return code is kinda irrelevant. tcpserver just records it,
it does not evaluate it and it only executes the first program directly
specified. tcpserver doesn't care and doesn't know about programs in the
chain. The next program in the chain is only executed, because (in this
example) greylite executes it.

> So if I construct a script that does the filtering that I want then I
> just need it to be able to exec the rest of the chain if necessary?

Yes.
If it is a shell script that takes no arguments or options it is as
simple as
exec "$@"
If it is a C program you may want to read "man 2 execve".

\Maex


oexel at economatica

Nov 18, 2009, 2:12 AM

Post #15 of 17 (3016 views)
Permalink
Re: tcpserver help [In reply to]

> On Wed, Nov 18, 2009 at 03:47:30PM +1100, Philip Rhoades wrote:
> > Yes, I understand and it is more or less what I thought - so if
> > greylite (or any other prog in the chain) exits with the appropriate
> > return value, the rest of the chain is not executed?

Markus Stumpf wrote:
> Yes. But the return code is kinda irrelevant.

Markus,

looks like there's some misunderstanding going on;

I guess Philip thinks there is an other shell-like program that:
- execs progA
- checks progA's exit code
- depending on it's value execs progB

I could be wrong (happens all the time);

[]s,

--
Otavio Exel /<\oo/>\ oexel [at] economatica


kyle-qmail at memoryhole

Nov 18, 2009, 8:05 AM

Post #16 of 17 (3010 views)
Permalink
Re: tcpserver help [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Wednesday, November 18 at 03:47 PM, quoth Philip Rhoades:
> Yes, I understand and it is more or less what I thought - so if
> greylite (or any other prog in the chain) exits with the appropriate
> return value, the rest of the chain is not executed?

If you're worried about the return value, then you're not
understanding what I wrote.

The process is called "exec chaining" because the fundamental aspect
of it is the "exec" system call, which (on Unix machines) fully and
completely replaces the application that makes the call with the
program it specifies. For example, if I have a program (let's call it
"tcpserver") that calls "exec(/usr/bin/greylite)", then the program is
no longer tcpserver, it is now greylite. Tcpserver is gone and cannot
come back, it cannot control what greylite does, and when greylite
exits the program simply ends (tcpserver does not restart or come back
or anything even remotely similar). An "exec chain" is when several
programs exec each other one after the next: first tcpserver execs
greylite, then greylite execs qmail-smtpd, then qmail-smtpd exits, the
end. (OR, alternately, first tcpserver execs greylite, then greylite
exits, the end.) You see? The "return code" has no impact on the
chain. In fact, when a program calls "exec", it does not have an
opportunity to return any code of any sort: it is now a completely
different program.

Now, things are actually slightly more complicated. The "exec" call is
normally (i.e. when not doing "exec chaining") paired with a "fork"
call. "Fork", on Unix machines, creates a duplicate of a program. So,
if tcpserver calls "fork", suddenly I have *TWO* instances of
tcpserver. This is how tcpserver can behave as a server. For every new
connection, it duplicates itself. The original goes back to listening
for new connections, while the duplicate calls "exec" to replace
itself with some program (e.g. greylite).

Thus, tcpserver runs one program, and only one program, and only ever
one program.

That program may do whatever it likes. It can exec another program
(and thus cease to exist), OR it may return whatever return code it
likes. Tcpserver (the original) does nothing more than record that
return value in the log file.

Does that clear things up somewhat?

> So if I construct a script that does the filtering that I want then
> I just need it to be able to exec the rest of the chain if
> necessary?

Exactly.

For example, if you wanted to create a script that would only allow
connections from the IP address 1.2.3.4, what would that mean? (Yes,
there are simpler ways of doing this than with a wrapper script, but
I'm using this as an informative example.) In an exec-chain like this,
"allowing the connection" means "continuing the chain", which really
means "exec-ing the next program in the chain (and passing along the
arguments to define the rest of the chain)". "Denying the connection"
means simply exiting.

So, here's an example simple script that demonstrates (more verbosely
than necessary) the idea:

#!/bin/bash
if [ $TCPREMOTEIP == 1.2.3.4 ] ; then
exec "$@"
else
exit $RANDOM
fi

You'll notice that the exit code is random. That's to emphasize that
it is irrelevant. You may be wondering "what does this "$@" mean?". In
bash, the $@ variable is a reference to the arguments that have been
passed to the program. Putting the $@ variable in quotes tells bash to
expand the variable to its component pieces as if each component (each
argument) was in quotes (if that makes no sense to you, ignore it for
the moment and just take on faith that the quotes are important to
use).

So, now you have to ask yourself: how does this fit into the chain?
You'll note that it doesn't check the return value of whatever it
exec's, and yet the exec chain after this program can be long and
complicated.

If you already know all this, I apologize for flogging a dead horse.
But by talking about the return code, it sounded like you didn't quite
understand the concept.

It's worth pointing out: this is VERY different from how qmail-qfilter
works, because qmail-qfilter doesn't use exec chaining. Qmail-qfilter
runs each program (read: "filter"), captures its output and its return
code, and decides whether to run the next program.

~Kyle
- --
I see the pain on your face when you say the word intellectual,
because it has so many syllables in it.
-- Clive James
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iQIcBAEBCAAGBQJLBBs7AAoJECuveozR/AWelJYP/2PQ678WDRIqUxom+WJ3XpR4
aSEUnMUP8knuJHX+2nCJs/Lm3GayaJ4XpfQZe+qJpIUAj1WzrBafCyvZz4WQwfF6
vrYGFzSeTpiF1WFSA1WXVzul+TOj5lZ/7tunw1SJCdujufkYuZD0aIsHcoeA2FDh
WXyC3zRW2zcsOkVG9vfjc4U+x2av/C/lXW5dNFo4gp5omr4jRchfjbdA4SKW9asx
vgmeY4nN0DkHwzUL63uhkKNgfxzht1+ps6ta7CG4Ot6Qv+DjJE1ApWWKMpBtECVB
mT+lUEBQ8h6x2wDAv775BMsc+AETtVBKccwbUyI/JxXctlcCpZkYb67hStjoT3f4
W/Edg5BkyoBkA4IliNuU/OfhHe9WjmzXRsGuiuFzgQLCm7usJPX095JJoO6P1MN+
FseHAuCWLkZRVGlWA/t4KR1TCydn6zq5iZy3Wf/8SI2Y2DjckINBe+vTkq+dk39Y
c9HaiY1ZY+aHyLT8fYZRZdHAhE1hv5FopquC/Zc3i84smvR7Z6o/WuDVYvmkGJqs
h4GwOYQXeckJ7HuWx66eQ0hbRpr5jvW/Cmd2aqcrHlO5CSLoa14+Mso9NQef1LGO
ZXSAM4vfvMRIfu3wGUHvNL5H55WobH4gecXh5NO6UN+g5z+6Gc4syf2Fv9AKp0lL
ZIStwlnowKc5Fk6JkdC2
=E+Ja
-----END PGP SIGNATURE-----


phil at pricom

Nov 18, 2009, 8:58 AM

Post #17 of 17 (2997 views)
Permalink
Re: tcpserver help [In reply to]

Markus, Kyle, Otavio,


On 2009-11-19 03:05, Kyle Wheeler wrote:
> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>
> On Wednesday, November 18 at 03:47 PM, quoth Philip Rhoades:
>> Yes, I understand and it is more or less what I thought - so if
>> greylite (or any other prog in the chain) exits with the
>> appropriate return value, the rest of the chain is not executed?
>
> If you're worried about the return value, then you're not
> understanding what I wrote.
>
> The process is called "exec chaining" because the fundamental aspect
> of it is the "exec" system call, which (on Unix machines) fully and
> completely replaces the application that makes the call with the
> program it specifies. For example, if I have a program (let's call it
> "tcpserver") that calls "exec(/usr/bin/greylite)", then the program
> is no longer tcpserver, it is now greylite. Tcpserver is gone and
> cannot come back, it cannot control what greylite does, and when
> greylite exits the program simply ends (tcpserver does not restart
> or come back or anything even remotely similar). An "exec chain" is
> when several programs exec each other one after the next: first
> tcpserver execs greylite, then greylite execs qmail-smtpd, then
> qmail-smtpd exits, the end. (OR, alternately, first tcpserver execs
> greylite, then greylite exits, the end.) You see? The "return code"
> has no impact on the chain. In fact, when a program calls "exec", it
> does not have an opportunity to return any code of any sort: it is
> now a completely different program.


Right.


> Now, things are actually slightly more complicated. The "exec" call
> is normally (i.e. when not doing "exec chaining") paired with a
> "fork" call. "Fork", on Unix machines, creates a duplicate of a
> program. So, if tcpserver calls "fork", suddenly I have *TWO*
> instances of tcpserver. This is how tcpserver can behave as a
> server. For every new connection, it duplicates itself. The original
> goes back to listening for new connections, while the duplicate
> calls "exec" to replace itself with some program (e.g. greylite).
>
> Thus, tcpserver runs one program, and only one program, and only ever
> one program.


Right.


> That program may do whatever it likes. It can exec another program
> (and thus cease to exist), OR it may return whatever return code it
> likes. Tcpserver (the original) does nothing more than record that
> return value in the log file.
>
> Does that clear things up somewhat?


Very well thanks!


>> So if I construct a script that does the filtering that I want then
>> I just need it to be able to exec the rest of the chain if
>> necessary?
>
> Exactly.
>
> For example, if you wanted to create a script that would only allow
> connections from the IP address 1.2.3.4, what would that mean? (Yes,
> there are simpler ways of doing this than with a wrapper script, but
> I'm using this as an informative example.) In an exec-chain like
> this, "allowing the connection" means "continuing the chain", which
> really means "exec-ing the next program in the chain (and passing
> along the arguments to define the rest of the chain)". "Denying the
> connection" means simply exiting.
>
> So, here's an example simple script that demonstrates (more verbosely
> than necessary) the idea:
>
> #!/bin/bash if [ $TCPREMOTEIP == 1.2.3.4 ] ; then exec "$@" else
> exit $RANDOM fi
>
> You'll notice that the exit code is random. That's to emphasize that
> it is irrelevant. You may be wondering "what does this "$@" mean?".
> In bash, the $@ variable is a reference to the arguments that have
> been passed to the program. Putting the $@ variable in quotes tells
> bash to expand the variable to its component pieces as if each
> component (each argument) was in quotes (if that makes no sense to
> you, ignore it for the moment and just take on faith that the quotes
> are important to use).


OK.


> So, now you have to ask yourself: how does this fit into the chain?
> You'll note that it doesn't check the return value of whatever it
> exec's, and yet the exec chain after this program can be long and
> complicated.
>
> If you already know all this, I apologize for flogging a dead horse.
> But by talking about the return code, it sounded like you didn't
> quite understand the concept.


No, I was probably still a bit confused and I didn't explain myself
clearly enough - I guess I was thinking of the qmail-qfilter situation
and the return codes from the filter programs returned to the
qmail-qfilter program.


> It's worth pointing out: this is VERY different from how
> qmail-qfilter works, because qmail-qfilter doesn't use exec
> chaining. Qmail-qfilter runs each program (read: "filter"), captures
> its output and its return code, and decides whether to run the next
> program.


Understood clearly now.


> ~Kyle


Many thanks for the in-depth responses! I have learnt a lot with this
exercise!

Appreciatively,

Phil.
--
Philip Rhoades

GPO Box 3411
Sydney NSW 2001
Australia
E-mail: phil [at] pricom

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.