fetchmail-friends
[Top] [All Lists]

[fetchmail]Possible false/strange return code in fetchmail 5.9.6

2002-02-01 16:44:14
Hi,

I have been playing around with the fetchmail interface configuration command
(-I command line option) lately. I try to get it to work in such a way, that
it only tries to fetch mail, if I have any kind of ethernet connection at all.
I am not interested in limiting fetchmail to only receive mail when inside a
certain network, but what I like to achieve is, that fetchmail only tries to
fetch mail, if my ethernet interface is up and has a valid IP.

What works fine so far for me, is to issue the command 

"fetchmail -I eth0/0.0.0.0/0.0.0.0"

So, it detects perfectly if my interface is up or down, and if it has an ip or
not. So far so good. But now I would like to write a wrapper script around
this command invocation, so that I can check on basis of the exit code of
fetchmail if I have a connection or not. If I don't have one, I want to omit
my call to "exim -qf" and otherwise execute it.

Sadly, this can't be done, cause fetchmail returns an exit code of 0 if it has
sucessfully fetched some mail. But it also returns the same exit code if it 
can't
connect to the mailserver, cause no link is down ot not existend. Wouldn't be
an exit code of 2 be the right choice. The fetchmail man page tells me about
exit code 2, that it is return in case fetchmail couldn't open the socket.
Well, so you could think that this is the case if no connection is available
at all.

Any comments? Am I complete wrong or just don't understand something. Or do I
try to overstress fetchmails abilities?

Best regards,
Oliver


-- 
-----------------------------------------------------------------------------
Oliver Andrich                   | Tel.:  0261-5009075
IT Projektmanagement,            | Mobil: 0172-6538591
Systemprogrammierung und -design | Fax:   069-13305990076
                                 | Email: oliver(_at_)andrich(_dot_)net
-----------------------------------------------------------------------------
Fingerpring: 2AB5 B998 8BD2 AC3A E12A  3A8A 171E 5B1B EC4B 3C2B
-----------------------------------------------------------------------------

Attachment: pgpEFBOze7byk.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>