smrsh sendmail redirect to script error 255


I was trying to pipe emails into a script via a .forward command and I was getting this error... DSN: unknown mailer error 255.  I found this was due to my php script not knowing the interpreter


tail -f /var/log/maillog

Apr 27 07:16:40 dev-upload sendmail[6062]: t3RCGePd006062: from=apache, size=76029, class=0, nrcpts=1, msgid=<201504271216.t3RCGePd006062@upload.mydomain.dev>, relay=apache@localhost
Apr 27 07:16:40 dev-upload sendmail[6063]: t3RCGeX7006063: from=<apache@upload.mydomain.dev>, size=76264, class=0, nrcpts=1, msgid=<201504271216.t3RCGePd006062@upload.mydomain.dev>, proto=ESMTP, daemon=MTA, relay=upload.mydomain.dev [127.0.0.1]
Apr 27 07:16:40 dev-upload sendmail[6062]: t3RCGePd006062: to=uploader@upload.mydomain.dev, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=106029, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (t3RCGeX7006063 Message accepted for delivery)
Apr 27 07:16:41 dev-upload sendmail[6064]: t3RCGeX7006063: to="| /home/uploader/wrapper.sh", ctladdr=<uploader@upload.mydomain.dev> (1000/1000), delay=00:00:01, xdelay=00:00:01, mailer=prog, pri=106500, dsn=5.3.0, stat=unknown mailer error 255
Apr 27 07:16:41 dev-upload sendmail[6064]: t3RCGeX7006063: t3RCGfX7006064: DSN: unknown mailer error 255
Apr 27 07:16:41 dev-upload sendmail[6064]: t3RCGfX7006064: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=107524, dsn=2.0.0, stat=Sent

so I created a symlink to have interpreter available in another location....
ln -s /usr/bin/php /usr/local/bin/php

Popular Posts