LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Dovecot imap-postlogin failed (https://www.linuxquestions.org/questions/linux-server-73/dovecot-imap-postlogin-failed-4175486036/)

Sayajin 11-27-2013 06:49 AM

Dovecot imap-postlogin failed
 
Hi,

In short I am trying to run a bash script which will then update
a mysql database with the last login date/time & last IP for each mailbox.

I have searched google dead but still cant figure out what im doing wrong
or if there is some issue with the centos 6 rpm's for dovecot.

--

- 1st i had the default dovecot in the centos 6 repo's which is version: 2.0.9
- I read that there was an issue with the script-login binary which was fixed in
version 2.0.14, so i updated dovecot to version 2.2.7.
- This sadly did not fix my issue with the bash script excecuting.

In my /etc/dovecot/conf.d/10-master.conf i have the following
service imap {
executable = imap imap-postlogin
}

service imap-postlogin {
executable = script-login /var/www/lighttpd/mail-admin/scripts/lastLogin.sh
}


But when i try login i still get the same error as with the previous version:
- Nov 27 14:44:36 dovecot: imap(MaIlBoX@DoMaIn.co.za): Error: net_connect_unix(/var/run/dovecot/imap-postlogin) failed: No such file or directory


- One thing i did notice on the one site was that someone had a ls of their /var/run/dovecot directory, and in there was a binary called imap-postlogin.
- But i dont have that binary anywhere on my server, with the old or new version
of dovecot.

Please any help would be appreciated.

Sayajin 12-06-2013 05:13 AM

Working More
 
Ok well i tried a few other things and got it working a bit more.
So the variables that i needed are now being set correctly etc, but im getting authentication errors now which I was not before.


my setup in 10-master.conf now looks like the following:
service imap-postlogin {
executable = script-login /var/www/lighttpd/mail-admin/scripts/lastLogin.sh
unix_listener imap-postlogin {
user = root
}
}

service imap {
executable = imap imap-postlogin
}

My lastLogin.sh bash script has the following in it for debugging
echo "$(date +%Y.%m.%d-%H:%M:%S)";
echo "User: ${USER}" >> /tmp/tracking.log 2>&1;
echo "Home: ${HOME}" >> /tmp/tracking.log 2>&1;
echo "Client IP: ${IP}" >> /tmp/tracking.log 2>&1;
echo "Server IP: ${LOCAL_IP}" >> /tmp/tracking.log 2>&1;

The output to my /tmp/tracker.log is the following
User: user@domain.com
Home: /var/spool/mail/domain.com/user
Client IP: x.x.x.x
Server IP: y.y.y.y

The Authentication Error I am getting now
dovecot: auth: Debug: Loading modules from directory: /usr/lib64/dovecot/auth
dovecot: auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
dovecot: auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_pgsql.so
dovecot: auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
dovecot: auth: Debug: Read auth token secret from /var/run/dovecot//auth-token-secret.dat
dovecot: auth: Debug: auth client connected (pid=25865)
dovecot: auth: Debug: client in: AUTH#0111#011PLAIN#011service=imap#011secured#011session=VPOQpNvsPwDELro2#011lip=X.X.X.X#011rip=Y.Y. Y.Y#011lport=143#011rport=58175
dovecot: auth: Debug: client passdb out: CONT#0111#011
dovecot: auth: Debug: client in: CONT#0111#011AHN1cHBvcnRAYmxhY2tsaXN0Ym94LmNvbQBzQHlAajFu (previous base64 data may contain sensitive data)
dovecot: auth-worker(25868): Debug: Loading modules from directory: /usr/lib64/dovecot/auth
dovecot: auth-worker(25868): Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
dovecot: auth-worker(25868): Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_pgsql.so
dovecot: auth-worker(25868): Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
dovecot: auth-worker(25868): Debug: sql(user=user@domain.com,Y.Y.Y.Y): query: SELECT CONCAT(mailboxes.local_part,'@',domains.fqdn) as `user`, mailboxes.password AS `password`,'/var/spool/mail/domain.com/user' AS `userdb_home`, 8 AS `userdb_uid`, 12 AS `userdb_gid` FROM `mailboxes`, `domains` WHERE mailboxes.local_part = 'user' AND mailboxes.active = 1 AND mailboxes.domain_name = domains.fqdn AND domains.fqdn = 'domain.com' AND domains.active = 1
dovecot: auth: Debug: client passdb out: OK#0111#011user=user@domain.com
dovecot: auth: Debug: master in: REQUEST#0112408185857#01125865#0111#0117b2d33b66e121f24e5393e87c3ae855f#011session_pid=25870#011requ est_auth_token
dovecot: auth-worker(25868): Debug: sql(user=user@domain.com,Y.Y.Y.Y): SELECT '/var/spool/mail/domain.com/user' AS `home`, 8 AS `uid`, 12 AS `gid`
dovecot: auth: Debug: master userdb out: USER#0112408185857#011user=user@domain.com#011home=/var/spool/mail/domain.com/user#011uid=8#011gid=12#011auth_token=505201029f52ca4318f4a283c1ad5449afd407d3
dovecot: imap-login: Login: user=<user=user@domain.com>, method=PLAIN, rip=Y.Y.Y.Y, lip=X.X.X.X, mpid=25870, TLS, session=<VPOQpNvsPwDELro2>
dovecot: imap(user=user@domain.com): Debug: Effective uid=8, gid=12, home=/var/spool/mail/domain.com/user
dovecot: imap(user=user@domain.com): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/var/spool/mail/domain.com/user
dovecot: imap(user=user@domain.com): Debug: maildir++: root=/var/spool/mail/domain.com/user, index=, indexpvt=, control=, inbox=/var/spool/mail/domain.com/user, alt=

Sayajin 01-28-2014 08:25 AM

*bump*


All times are GMT -5. The time now is 12:40 AM.