23 messages in net.sourceforge.lists.courier-usersRe: [courier-users] Need authProg help
FromSent OnAttachments
Mark ConstableMay 29, 2007 12:54 am 
Mark ConstableMay 30, 2007 3:35 am 
Mark ConstableMay 30, 2007 5:17 am 
Mark ConstableMay 30, 2007 6:27 am 
Sam VarshavchikMay 30, 2007 3:16 pm 
Mark ConstableMay 31, 2007 2:58 am 
Sam VarshavchikMay 31, 2007 3:59 am 
Mark ConstableMay 31, 2007 4:43 am 
Sam VarshavchikMay 31, 2007 4:08 pm 
Mark ConstableMay 31, 2007 7:52 pm 
Sam VarshavchikMay 31, 2007 9:00 pm 
Mark ConstableJun 1, 2007 12:21 am 
Sam VarshavchikJun 1, 2007 3:58 am 
Mark ConstableJun 1, 2007 5:59 am 
Aidas KasparasJun 1, 2007 7:15 am 
Sam VarshavchikJun 1, 2007 3:42 pm 
Mark ConstableJun 2, 2007 7:19 am 
Gordon MessmerJun 2, 2007 9:58 pm 
Mark ConstableJun 3, 2007 3:37 am 
Gordon MessmerJun 3, 2007 2:12 pm 
Mark ConstableJun 4, 2007 5:25 am 
Gordon MessmerJun 4, 2007 9:12 am 
Mark ConstableJun 4, 2007 10:01 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] Need authProg helpActions...
From:Mark Constable (mar@renta.net)
Date:May 30, 2007 3:35:52 am
List:net.sourceforge.lists.courier-users

On Tuesday 29 May 2007 07:54:28 Mark Constable wrote:

I'm trying to get courier-authlib-pipe 0.58-4 on Debian4 to work and have got this far... any suggestions ?

May 29 03:18:24 us imapd-ssl: authentication error: Input/output error May 29 03:18:24 us authdaemond: cat: write error: Broken pipe May 29 03:25:58 us authdaemond: /etc/courier/authProg: line 23: echo: write
error: Broken pipe

I have now tried this on a working system using MySQL, to make sure the courier install is otherwise correct, and only made the most minimal changes from using courier-authlib-mysql to using courier-authlib-pipe. I copied the authProg from the previous server and only changed the DB lookup line to point to the local MySQL server (instead of sqlite) and tested the script itself to make sure it works without error.

However it's still failing to write stdout to authdaemond.

May 30 21:57:35 mail2 authdaemond: + echo FAIL May 30 21:57:35 mail2 authdaemond: /etc/courier/authProg: line 26: echo: write
error: Broken pipe

Perhaps I completely misunderstand how authlib-pipe is meant to work. The perl example indicates the authProg script should just read stdin input, do an auth test, and return the results to stdout output in a certain format. Can someone confirm that that is indeed how authlib-pipe is supposed to work ?

This is a set -x trace from the mail logfile for an IMAP connection and it seems to indicate all is well until it goes to output to STDOUT which obviously fails.

Can anyone suggest why a simple write to STDOUT would fail ?

imapd-ssl: Connection, ip=[::ffff:xx.xx.xx.xx] authdaemond: ++ /bin/cat - imapd-ssl: LOGIN FAILED, user=adm@xxxx.com, ip=[::ffff:xx.xx.xx.xx] imapd-ssl: authentication error: Input/output error authdaemond: + ARGS='AUTH 32 authdaemond: imap authdaemond: login authdaemond: adm@xxxx.com authdaemond: xxxxxx' authdaemond: ++ /bin/date '+%Y%m%d %T' authdaemond: + echo 20070530 22:15:32 AUTH 32 imap login adm@xxxx.com xxxxxx authdaemond: ++ echo AUTH 32 imap login adm@xxxx.com xxxxxx authdaemond: ++ awk '{print $5}' authdaemond: + ID=adm@xxxx.com authdaemond: ++ echo AUTH 32 imap login adm@xxxx.com xxxxxx authdaemond: ++ awk '{print $6}' authdaemond: + PW=xxxxxx authdaemond: ++ echo 'select mpath,mquota from passwd where
uid='\''adm@xxxx.com'\'' and pw='\''xxxxxx'\''' authdaemond: ++ mysql -BN admin authdaemond: + RESULT='/home/u/com/xxxx/admin^I104857600S' authdaemond: + '[' 'x/home/u/com/xxxx/admin^I104857600S' '!=' x ']' authdaemond: ++ echo /home/u/com/xxxx/admin 104857600S authdaemond: ++ awk '{print $1}' authdaemond: + MPATH=/home/u/com/xxxx/admin authdaemond: + /bin/cat authdaemond: /bin/cat: write error: Broken pipe

--markc