LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Dovecot doesnt create all folders for virtual users. (http://www.linuxquestions.org/questions/linux-server-73/dovecot-doesnt-create-all-folders-for-virtual-users-680447/)

robertjinx 11-01-2008 09:05 AM

Dovecot doesnt create all folders for virtual users.
 
I have setup Dovecot with MySQL and Postfix for virtual users and domains. It works, can send mails and receive, but the users only have Inbox folder, there is no Trash, Drafts, Sent and so on.

Here is the configuration of dovecot:

base_dir = /var/run/dovecot/
protocols = imap imaps
listen = *
log_path = /var/log/maillog
log_timestamp = "%Y-%m-%d %H:%M:%S "
ssl_disable = no
ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.pem
login_dir = /var/run/dovecot/login
login_process_size = 64
login_greeting = IMAP/IMAPS Server Ready
mail_location = mbox:/srv/mail/vmail/%d/%n
mail_privileged_group = mail
verbose_proctitle = no
first_valid_uid = 500
last_valid_uid = 10005
mbox_read_locks = fcntl
mbox_write_locks = fcntl

protocol imap {
imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
}
protocol pop3 {

}

auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
auth_verbose = yes

auth default {
mechanisms = plain login

passdb pam {
}
passdb shadow {
}
passdb sql {
args = /applications/dovecot-mail/etc/dovecot-mysql.conf
}
userdb passwd {
}
userdb sql {
args = /applications/dovecot-mail/etc/dovecot-mysql.conf
}
user = root
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
}

dovecot-mysql configuration:

driver = mysql
#default_pass_scheme = plain
default_pass_scheme = PLAIN-MD5
#connect = host=/var/run/mysqld/mysqld.sock dbname=mail user=root password=default
# Alternatively you can connect to localhost as well:
connect = host=localhost dbname=mail user=mail password=XXXXX
password_query = SELECT password FROM mailbox WHERE username = '%u'
user_query = SELECT '/srv/mail/vmail/%d/%n' as home, 'maildir:/srv/mail/vmail/%d/%n' as mail, 10005 AS uid, 12 AS gid, concat('dirsize:storage=',quota) AS quota FROM mailbox WHERE username ='%u' AND active ='1'

postfix configration:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
unknown_local_recipient_reject_code = 450
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /applications/postfix/conf
inet_protocols = ipv4
mail_spool_directory = /var/spool/mail
smtpd_banner = $myhostname ESMTP Mail Server (example.net hosting)
smtpd_helo_required = yes
smtpd_delay_reject = yes
disable_vrfy_command = yes
unverified_recipient_reject_code = 550
unverified_sender_reject_code = 550
biff = no
append_dot_mydomain = no
readme_directory = no
myhostname = example.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = example.net
mydestination = mail.example.net, localhost
relayhost =
my_networks = 127.0.0.0/8 208.83.212.8/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

virtual_mailbox_domains = proxy:mysql:/applications/postfix/conf/mysql_virtual_domains_maps.cf
virtual_mailbox_base = /srv/mail/vmail
virtual_mailbox_maps = proxy:mysql:/applications/postfix/conf/mysql_virtual_mailbox_maps.cf
virtual_alias_maps = proxy:mysql:/applications/postfix/conf/mysql_virtual_alias_maps.cf
virtual_minimum_uid = 10005
virtual_uid_maps = static:10005
virtual_gid_maps = static:12

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
broken_sasl_auth_clients = yes
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_hostname, reject_non_fqdn_sender,
reject_non_fqdn_recipient, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname,
reject_rbl_client list.dsbl.org, reject_rbl_client bl.spamcop.net, reject_rbl_client sbl-xbl.spamhaus.org

smtp_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/ssl/smtpd/smtpd.crt
smtpd_tls_key_file = /etc/ssl/smtpd/smtpd.key
smtpd_tls_CAfile = /etc/ssl/smtpd/cacert.pem
smtpd_tls_received_header = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
tls_random_source = dev:/dev/urandom
smtpd_tls_session_cache_timeout = 3600s
smtpd_tls_recieved_header = yes

postfix mysql configration:

user = mail
password = XXXX
hosts = localhost
dbname = mail
table = alias
select_field = goto
where_field = address
additional_conditions = and active = '1'

user = mail
password = XXXX
hosts = localhost
dbname = mail
table = domain
select_field = domain
where_field = domain
additional_conditions = and backupmx = '0' and active = '1'

user = mail
password = XXXX
hosts = localhost
dbname = mail
table = mailbox
select_field = quota
where_field = username
additional_conditions = and active = '1'

user = mail
password = XXXX
hosts = localhost
dbname = mail
table = mailbox
select_field = CONCAT(domain,'/',maildir)
where_field = username
additional_conditions = and active = '1'

Does anyone know what is the problem?

Please let me know if u can help, Thanks!

billymayday 11-02-2008 03:10 PM

Are you sying that these are not created as require - ie, if a user connects a mail client and deletes an email, is the trash folder created? Ditto for sending mail being copied to sent?

robertjinx 11-03-2008 03:18 AM

Hello, no if I am using for example roundcube for check mail, there is only Inbox. There is no Sent, or Trash or Drafts. If Im using SquirrelMail then the folders will be created, by SquirrelMail.

I have busted my head to figure it out whats the deal... I know that normaly Dovecot shouldnt create the folders, but who should? and how to set it... coz not everybody likes to use SquirrelMail so then if they use Roundcube, they wont have the stupid folder, only if they use first SquirrelMail :)

Weird and sick, what can I say :)

billymayday 11-03-2008 03:29 AM

I'd expect the client to create them myself.

I even had the misfortune to use Outlook Express today, and that forced the creation of necessary folders.

I've never used roundcube - are you sure there's no way of getting it to create what's required? Are you sure it doesn't create them when they're needed? What happens if you delete a message in roundcube if the deleted folder doesn't exist?

Why don't you write a script to create them for new users?


All times are GMT -5. The time now is 12:59 AM.