+

Change return code

Benjamin Renard [2014-02-12 17:37:35]
Change return code
Filename
mail2gnokii
diff --git a/mail2gnokii b/mail2gnokii
index d7220a5..69a6291 100755
--- a/mail2gnokii
+++ b/mail2gnokii
@@ -50,7 +50,8 @@ use constant {
 	EX_NOUSER => 67,
 	EX_NOHOST => 68,
 	EX_UNAVAILABLE => 69,
-	EX_SOFTWARE => 70
+	EX_SOFTWARE => 70,
+	EX_TEMPFAIL => 75
 };


@@ -86,7 +87,7 @@ if (not $mob =~ m/^[0-9]*$/) {
 if (defined $ARGV[1]) {
 	if (not $ARGV[1]=~ m/^[0-9\+]*$/) {
 		print "Invalid SMSC phone number : "+$ARGV[1];
-		exit EX_DATAERR;
+		exit EX_CONFIG;
 	}
 	$smsc=$ARGV[1];
 }
@@ -105,7 +106,7 @@ if (not $check_authorized_number or $mob ne '' && in_array(\@authorized_number,$
 	close(GNOKII);
 	if($? != 0){
 		print "Error sending SMS";
-		exit EX_SOFTWARE;
+		exit EX_TEMPFAIL;
 	}
 }
 else{
ViewGit