• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

IMAP folders.

cygus

Basic Pleskian
Hi,

I saw that Plesk 11 doesn't create IMAP folder like sent items, deleted items or draft, junk etc.
Is possible to fix this problem?

Regards.
 
I have the same problem too. in effect i have to login each mailbox thru webmail to create all the folders, otherwise the mobile devices (iPad, iPhone) don't recognize the default sent/trash/draft folders automatically!
is there any fix for this?
 
I have the same problem too. in effect i have to login each mailbox thru webmail to create all the folders, otherwise the mobile devices (iPad, iPhone) don't recognize the default sent/trash/draft folders automatically!
is there any fix for this?

We have the same issue - any fix?
 
Why should Plesk generate them? This is a question of the user. If the user decide to use POP3 instead of IMAP he does noz Need the Folders.
 
Why should Plesk generate them? This is a question of the user. If the user decide to use POP3 instead of IMAP he does noz Need the Folders.

This is a question of usability! When you setup a new account and the user decides to setup IMAP on his smartphone, the folders should be there already. Having to instruct the user to first login using Webmail before setting up the account on the smart phone is NOT user friendly! If Roundcube Webmail can create the folders on the first login, why shouldn't Plesk be able to do it when you create the account? After all, Plesk should be there to simplify things.
 
In my opinion you mix 2 different things. And of course you cannot compare Roundcube and Plesk. Of course Roundcube creates the Directories because it is a mail-program
 
In my opinion you mix 2 different things. And of course you cannot compare Roundcube and Plesk. Of course Roundcube creates the Directories because it is a mail-program

*sigh* I am just saying that there should be an automated IMAP folder creation functionality within Plesk when you create a new mail account. Just like you have a DNS template when creating a new DNS zone there should be a folder template when creating a new e-mail account. For a good user experience it just needs to work out of the box - why should the user first login using Webmail before he can use the full IMAP functionality on his smart phone? It should work straight away on the smart phone. Again, in the end it's all about usability, shouldn't be so hard to understand.
 
I agree. It has become particularly important now that certain programs, like Outlook 2013 for Windows, LOOK for the folders like "Sent" and use them if there, but default to LOCAL Sent folders if they don't find them.

Try this little script I wrote. Takes the email address as the argument.

#!/usr/bin/perl

$data = $ARGV[0];

if ( $data !~ /([0-9A-Za-z\.\-\_\'\+\~\*\{\}]+\@[0-9A-Za-z\.\-\_]+\.[a-zA-Z]{2,8})/ ) {

print "Invalid Email Address\n\n"; exit;

}

( $username, $domain ) = split(/\@/,$data);

print "User = $username\n";
print "Domain = $domain\n";

$path = "/var/qmail/mailnames/$domain/$username/Maildir";

@folders = ("Drafts","Sent","Trash","Junk","Spam");
@subfolders = ("new","tmp","cur");

foreach $folder (@folders) {

$command = "mkdir $path/.$folder";
print `$command`;
#print "\n";
$command = "chmod 700 $path/.$folder";
print `$command`;
#print "\n";
$command = "chown popuser $path/.$folder";
print `$command`;
#print "\n";

foreach $subfolder (@subfolders) {

$command = "mkdir $path/.$folder/$subfolder";
print `$command`;
print "\n";
$command = "chmod 700 $path/.$folder/$subfolder";
print `$command`;
print "\n";
$command = "chown popuser $path/.$folder/$subfolder";
print `$command`;
print "\n";

}
}
 
Hey rgfincher,

That's exactly my point! Thanks so much for the script, that will make things a lot easier!

@parallels - this should be standardized in your product!
 
You're welcome. No warranty of course! You can see that you may list the folders you wish the script to create. The script should be run as root (otherwise the permissions cannot be set correctly). I call it "folders.pl" and you invoke it from the command line something like this "./folders.pl [email protected]". If some of the folders already exist, it won't harm them.

Parallels' point is that they cannot arrive at a standard set of folders for IMAP users which suits everyone, and that such a thing is up to the ISP. However, there is a set of template folders used when new web sites are provisioned, so I don't see the difference with there being a template for the creation of a set of IMAP folders. In point of fact, the Junk folder is already created for you, and I venture to suggest that a Sent folder is more important than a Junk folder. (Horde creates a folder called "sent-items", note lower case, when it is first run, if no other Sent items folder already exists, but as this is a non-standard name, I suggest running my script before anyone logs into Horde)
 
Last edited:
Wow, i just noticed this topic and we have simulair issues. I would have never guessed about IMAP folders.
This explains for me why my emails on the server are disappearing from the trash folder after 7 days.

@rgfincher, a great script!

Does anyone know if there is any way of running a script through the Plesk dashboard?
 
As the script must be run as root, it would be inadvisable as well as difficult to run it from the Plesk Dashboard.
Another approach might be to run my script as a cron job for all users. This would also solve the problem of users renaming or deleting vital IMAP folders like "Sent" without being aware of the consequences (my script would create them again). You'd have to find some way of feeding the script a list of email addresses, either from the psa MySQL database, or by inspecting the /var/qmail/mailnames directory.

If iPhone users remove the "Deleted Items" folder (or "Trash" if that's what they've set it to), they will be unable to delete messages.
 
Hi,
I saw that Plesk 11 doesn't create IMAP folder like sent items, deleted items or draft, junk etc.
Is possible to fix this problem?
Regards.

I think its not Plesk to blaim because linux (mail) servers are running different modules.
Please correct me if i'm wrong. It depends if you are running a dovemail or courier which act as IMAP/POP delivery archivers for postfix or qmail mailservers.

@rgfincher, thanks for the additional information.

I found this the other day -- http://www.courier-mta.org/imap/maildirs.html
and this -- http://www.courier-mta.org/maildir.html (scroll down to 'Adding new mail to maildirs')
Is there a difference between maildir- command and mkdir- command that you are using in your script, and would it effect functionality?

I have my concerns about privileges, accessrights and ownerships if i would just use mkdir- command
 
Last edited:
Thank you for your reply. "Maildir" refers not to a command, but to a method of storing a mail spool. Maildir is an alternative to the old spool file where all messages were in a single file. With Maildir, folders are allowed (which are mapped to folders on the filesystem of your hard disk), and messages are stored as individual files within those folders). By convention, the top level directory is called "Maildir" to denote that this way of storing messages is being used.

In creating my script, I observed the effect of creating folders through an IMAP MUA, and replicated the effects using Unix shell commands. However, I'm aware that IMAP servers sometimes use specially modified versions of the ext4 filesystem to record metadata about messages, and my script doesn't take account of this, if it is being used. As previously mentioned, it is provided without warranty. In the spirit of open source, if you make improvements to my script, please do share it with the group.
 
I agree. It has become particularly important now that certain programs, like Outlook 2013 for Windows, LOOK for the folders like "Sent" and use them if there, but default to LOCAL Sent folders if they don't find them. .

I agree with your point of view. We use Plesk to simplify our sysadmin job. Now more and more users use IMAP (POP is retro) on several devices / tablets / phones / computers.
It puts some i.m.h.o. unecessary workload on support to ask the users to login to Roundcube first as I understand the folders are created afterwards.
Your script is an option but i.m.h.o it would be better if it would be like that out of the box.

And while we talking IMAP now maybe it is also better to raise the number of connections allowed (out of the box) see http://kb.odin.com/en/113841
as IMAP and multiple devices from same IP become more common.

Just my 2 c
 
I still don't really understand what the big issue is not having these additional mailboxes.
What exactly are the benefits of creating additional boxes?

Does anyone know if default sent/trash/draft folders for Apple products have been resolved....

We have Plesk for a couple of years now and have Couriermail with Postfix and roundcube as we support pop and imap. Everything is synchronizing fine without these additional server mailboxes as far as my knowledge extends. The only complain was a config file of courier-mail was cleaning trash after 7 days. If you have a Maildir folder you can see messages stored in couple of folders "Temp", "Cur" and "New" (http://www.courier-mta.org/maildir.html#messages)
 
Back
Top