some import configure: plugin { mail_filter = mail-filter %u # %u = username given to the script as first mail_filter_out = mail-filter-out %u }
service mail-filter { executable = script /usr/local/bin/mail-filter.sh user = dovecot unix_listener mail-filter { mode = 0600 user = vmail } } service mail-filter-out { executable = script /usr/local/bin/mail-filter-out.sh user = dovecot unix_listener mail-filter-out { mode = 0600 user = vmail } } protocol lda { mail_plugins = quota sieve expire autocreate mail_filter auth_socket_path = /var/run/dovecot/auth-master
rejection_subject = Rejected: %s lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes sendmail_path = /usr/sbin/sendmail }
cat mail-filter-out.sh #!/bin/sh cat > tempfile
cat mail-filter.sh #!/bin/sh
USER=$1 cat > tempfile
Some important Error logs:
Feb 07 15:49:19 lda(q1@a.com)<53648>