List Info

Thread: cc'ing to external script: unsigned int ("!Err" and "EXITCODE = 4294967295")




cc'ing to external script: unsigned int ("!Err" and "EXITCODE = 4294967295")
country flaguser name
Germany
2007-02-26 09:27:56
Hi all,

sorry if this has been answered already, i did check on the
list
archives but couldn't quite figure out my problem.

I have a general maildroprc that has among other things
this:

SHELL="/bin/sh"
TIMESTAMP=`date "+%b %d %H:%M:%S"`
logfile "log.txt"
log "=== new run on $TIMESTAMP ==="

and a user-included maildroprc from there that looks kinda
like this:

SMS=1
if ( $SMS == 1 )
{
  exception {
    cc "| /path/to/some/prog $USER"
    xfilter "subjadd [SMS]"
  }
  log "EXITCODE=$EXITCODE, TEMPFAIL=$EX_TEMPFAIL"
  echo "EXITCODE=$EXITCODE,
TEMPFAIL=$EX_TEMPFAIL"
}
to $DEFAULT


"prog" takes usermail and the message, works on it
some and then sends 
out an sms via an sms gateway. the internals of prog seem ok
as
the program works fine on the command line ("cat
mailfile | prog
userserver.tld") but I am unable to run it from
within maildrop:

Feb 26 15:33:14 - BEGIN maildrop processing for userserver.tld ===
 == User will.test has own mailfilter, including
 /var/spool/mail/virtual_mailboxes/.mailfilters/userserver.tld ...
 inside user's mailfilter file...
 Date: Mon Feb 26 15:33:14 2007
 From: Fred Jounters <fjserver.tld>
 Subj: dada
 !Err: | /path/to/some/prog userserver.tld                 
 (918)

 EXITCODE = 4294967295, TEMPFAIL =

Now from another mailinglist I found out that 
4294967295 == 0xffffffff == (unsigned int) -1

Question: What does this mean? / Where to look for the
error?

Whenever my prog runs well, it returns "1", else
it might return
something like "60", "59", etc.

Does the prog always have to return TRUE/1 for mailfilter to
keep on
going "ok"?

Btw: the prog is a perl program with executable bits set and
a correct
shebang, no switches (wcT) so that it doesn't output
anything else.

Any ideas?
Thanks for looking into this,
Fred

------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

Re: cc'ing to external script: unsigned int ("!Err" and "EXITCODE = 4294967295")
country flaguser name
United States
2007-02-26 17:18:19
Fred J writes:

> userserver.tld") but I am unable to run it from
within maildrop:
> 
> Feb 26 15:33:14 - BEGIN maildrop processing for
userserver.tld ===
>  == User will.test has own mailfilter, including
> 
/var/spool/mail/virtual_mailboxes/.mailfilters/userserver.tld ...
>  inside user's mailfilter file...
>  Date: Mon Feb 26 15:33:14 2007
>  From: Fred Jounters <fjserver.tld>
>  Subj: dada
>  !Err: | /path/to/some/prog userserver.tld                 
 (918)
> 
>  EXITCODE = 4294967295, TEMPFAIL =
> 
> Now from another mailinglist I found out that 
> 4294967295 == 0xffffffff == (unsigned int) -1
> 
> Question: What does this mean? / Where to look for the
error?

It's your script, only you can figure out why it breaks.

The only thing that you need to know that's not immediately
obvious is that 
your script must read the entire message it receives piped
in on standard 
input.  If maildrop detects that the script terminated
before it consumed 
everything, it will - rightfully - conclude that the mail
delivery script 
failed.


------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

Re: cc'ing to external script: unsigned int ("!Err" and "EXITCODE = 4294967
country flaguser name
Germany
2007-02-27 06:41:52
* Sam Varshavchik <mrsamcourier-mta.com>
[2007-02-26 18:18:19 -0500]:

> Fred J writes:
> 
> >userserver.tld") but I am unable to run
it from within maildrop:
> >
> 
> It's your script, only you can figure out why it
breaks.
> 
> The only thing that you need to know that's not
immediately obvious is that 
> your script must read the entire message it receives
piped in on standard 
> input.  If maildrop detects that the script terminated
before it consumed 
> everything, it will - rightfully - conclude that the
mail delivery script 
> failed.
> 

Indeed. The problem was due to an "exit 0;" call
before declaration of
some subroutines being called. Instead of following general
programmation rules (0libs, 1config, 2subroutines, 3rd main)
I had
inversed the latter ones due to very sloppy coding and
called exit 
somewhere after the second part. This led to the error. mc.

I new about the reading from stdin from one of your posts
long time ago
so that wasn't the problem. But thanks!

Maybe you can help with another clarification?

Is there a list of error return codes such as 99/0/..? Or
are they
related to dot-courier-file:

<quote from="http://www.courier-mta.org/?dot-courier.html">

If the external command terminates with the exit code of 99,
any
additional delivery instructions in the file are NOT
executed, but the
message is considered to be successfully delivered.

If the external command terminates with any of the following
exit codes:
64, 65, 67, 68, 69, 70, 76, 77, 78, or 112, the E-mail
message will be
returned as undeliverable, and no further delivery
instructions will
take place.

If the external command terminates with any other exit code,
it is
interpreted as a temporary error, and the message will be
requeued for
another delivery attempt later.
</quote>

Can I return any other error code (1-63?) without
undeliverable status
or requeuing taking place? If i read the courier-dot right,
this can
only work if i can somehow influence the action ensuing
EX_TEMPFAIL
(meaning: no requeing for late delivery).

Regards & thanks again,
Fred

------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

Re: cc'ing to external script: unsigned int ("!Err" and "EXITCODE = 4294967
country flaguser name
United States
2007-02-27 17:20:52
Fred J writes:

> 
> Can I return any other error code (1-63?) without
undeliverable status
> or requeuing taking place?

That would be 0.


------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )