# -*- coding: utf-8 -*-

# configure mailbox path for Maildir
/^session[[:space:]]\+[^[:space:]]\+[[:space:]]\+pam_mail\.so/ {
	# skip, if alreday present
	\@[[:space:]]\+dir=~/Maildir\([[:space:]]\+\|$\)@b

	# replace noenv, if present
	s@\([[:space:]]\+\)noenv\([[:space:]]\+\|$\)@\1dir=~/Maildir\2@
	t

	# insert before comment
	s@\([[:space:]]\+#.*$\)@ dir=~/Maildir\1@
	t

	# append at end of line
	s@$@ dir=~/Maildir@
}