I followed the virtual_postfix_mysql_quota_courier tutorial, and after some fiddling got everything to seemingly work ok. I checked the user directories, and saw that everything was being delivered into /home/vmail/$domain/$user/. This seemed fine, but i thought i was being smart, and changed mysql-virtual_mailboxes.cf and authmysqlrc from: MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') to MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/Maildir/') This seemed to work for a while, then i started getting errors using squirrelmail stating that it could not open INBOX and INBOX.SENT. After some research, i learned that it looks for cur tmp and new folders. i had those in the /home/vmail/$domain/$user/Maildir folder, so i made them in the /home/vmail/$domain/$user/ folder. this also seemed to work for a time. Now my squirrelmail is bouncing between the /home/vmail/$domain/$user/cur and /home/vmail/$domain/$user/Maildir/cur folders to display messages. Postfix and courier are set with the: MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') Again, but if i rename the maildir, squirrelmail will error out saying it cannot find maildir, if I restore Maildir, and move the cur,new and tmp files from /home/vmail/$domain/$user/ then i get the open INBOX and INBOX.SENT errors back. with these errors, if i do nothing and wait for ~10 minutes, it will bounce back to the other folder, wait 10 minutes, and bounce back again. i cannot figure out why it is trying to use 2 different folders and any help would be appreciated. Also, as a side note. Do you know any good tutorials to set spamassassin and procmail up to run on a per-user basis with virtual users from teh mysql database? Edit: I also made sure to restart the mail services between file edits. Thanks!
You could try to use symlinks (make one folder a symlink of the other one). Have a look here: http://www.howtoforge.com/postfix_amavisd_antispam http://www.howtoforge.com/virtual_postfix_antispam http://www.howtoforge.com/postfix_mailfilter http://www.howtoforge.com/autoresponders_for_virtual_postfix_users
Falko, Thanks for the response. Ill try symlinks, but my bigger question is, why would it try to use 2 different folders? No matter how IMAP is set, it tries to use both folders as the inbox. Also, using symlinks poses the restriction that i will have to create symlinks everytime a new user is created, which isnt a huge deal, but i like to do things right Edit: I had a few ideas, and as of right now, both /etc/postfix/mysql-virtual_mailboxes.cf and /etc/courier/authmysqlrc have this line: MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/Maildir/') This as far as I know, tells courier and postfix that i want the mail written to folder /home/vmail/domain/user/Maildir/ Squirrelmail seems to be working better, but every once in a while it tries to read from the /home/vmail/domain/user/ folder still. So, I made symlinks like you said Falko, but this is getting tedious, cause I end up needing a symlink for every folder in the Maildir. If i have 10 users, and each of them makes thier own folders, then im stuck takign requests to make symlinks... and it defeats the purpose of only having 1 folder with files in it.. cause the user folder is cluttered with symlinks.
If you follow the tutorial as close as possible, you shouldn't hava any problems. I haven't quite understood why you changed the MYSQL_MAILDIR_FIELD line.
mconway <--- I have plans to post a per user setting using a backported version of Amavis and Mailzu (http://sourceforge.net/projects/mailzu) with the SQL settings in Amavis with control via a Squirrel Mail plugin. I'm working out a few bugs though in relation to redelivering mail using the Amavis tools (nanny etc etc) so I can't post the guide until then! In the meantime look at the distrobution copy of amavisd.conf in /etc/amavis before you replace it with the Falko copy and you will see how to do it in both flat file form and MySQL.