Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Dovecot 1.2.12 running on Ubuntu Server 10.10 and I'm trying to get a post-login script to log the date and time that the users access their IMAP mailbox. I've read the Dovecot wiki and added the following to dovecot.conf:

mail_executable: /usr/lib/dovecot/ /usr/lib/dovecot/imap

The script is pretty basic (logging all user access to a single file, plus the touch method given by the wiki):

echo $USER $dt >> /opt/logon 
touch ~/.last_login

With the mail_executable line as above, the script runs successfully when a user attempts to log in, but access to the IMAP server fails (clients are Roundcube webmail running on the same box, and MS Outlook). /var/log/mail.log isn't very revealing. The login is logged normally and then nothing follows it:

dovecot: imap-login: Login: user=<username>, method=PLAIN, rip=, lip=, secured

Putting the script after the IMAP executable, like this:

mail_executable: /usr/lib/dovecot/imap /usr/lib/dovecot/

results in normal IMAP functionality, but the script doesn't run.

Output of dovecot -n:

# 1.2.12: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.35-32-server x86_64 Ubuntu 10.10 ext4
log_timestamp: %Y-%m-%d %H:%M:%S
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable: /usr/lib/dovecot/imap-login
mail_privileged_group: mail
mail_location: maildir:/home/%u/Maildir
mail_debug: yes
mbox_write_locks: fcntl dotlock
mail_executable: /usr/lib/dovecot/ /usr/lib/dovecot/imap
auth default:
    driver: pam
    driver: passwd

I feel like I'm missing something obvious here. Please help! Thanks in advance.

share|improve this question

closed as off-topic by Luis Alvarado Aug 8 '13 at 9:52

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Ubuntu Server 10.10 is not end of life? – Radu Rădeanu Aug 7 '13 at 11:20
up vote 0 down vote accepted

The documentation says you to change the mail_executable parameter.

mail_executable: /usr/lib/dovecot/

and the IMAP/POP binary is called from within your script. Check the following comment in the document

# Finally execute the imap/pop3 binary. If you use both, you'll need two scripts.
exec /usr/local/libexec/dovecot/imap "$@"

I am not sure if version 1.x supports specifying multiple scripts via mail_executable

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.