Sunday, May 2, 2010

Postfix + Cyrus IMAP Relay access denied (state 14)

Solving this problem was freaking easy. I just did add the user, must have the proper domain name link to your IMAP, like us, I have toytoy.is-a-geek.org.

So what I did, I just add first the user's e-mail address like for example:
echo "mypassword" | /usr/sbin/saslpasswd2 -p -u toytoy.homeunix.org toytoy@toytoy.homeunix.org
 Since I have the script to create an IMAP account for Cyrus, I just run

/path/to/imapcreate.pl -u cyrus -m "toytoy@toytoy.is-a-geek.org" -p cyruspassword -s localhost

then cd to the assigned virtual_alias file, if your postfix configuration doesn't modify or customized the default config, so execute (mostly /etc/postfix/virtual_alias)

cd /etc/postfix/virtual_alias
echo "toytoy@toytoy.is-a-geek.org toytoy@toytoy.is-a-geek.org" >> virtual_alias
which postmap virtual_alias
Then try sending e-mails, you can check the spool at
/var/spool/imap/domain/t/toytoy.is-a-geek.org/t/user/toytoy/2.
where "2." is the file.

Hope this helps!