Current User: Guest Login Register
Please consider registering


Register? | Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Problem accessing correct mailboxes

Reply to Post Add a New Topic
UserPost

8:53 am
September 27, 2010


chris

Member

posts 6

I have 12 domain names pointing to the same server. I host all websites by using the virtual host feature in Apache.

My goal is to set up a mail server that would allow each website would have its own dedicated email address.

I followed the tutorials on the home page of this site specifically the sections "How to install SMTP, POP3, IMAP and Webmail service", "How to integrate MySQL or support multiple domains", and How  to install Webmin.

Say for example I have domain1.com, and domain2.com

…and email adresses user@domain1.com and user@domain2.com

If I send an email to user1@domain1.com it goes into the vmail directory.

If I send an email to user2@domain2.com it also goes into the vmail directory.

 

When I try to read the email that was received on my system it reads from the user, or user2 accounts, and not the vmail accounts.

All my email is filed under /home/vmail/domain/user/Maildir

But when I try to access my mail via Squirrelmail, Webmin, or any other mail reader it reads from /home/user1 or /home/user2 instead of reading from vmail

Does anyone have any suggestions as how to solve this?

12:59 pm
September 28, 2010


Kendermin

Member

posts 15

if you want them all to go to the same address use an alias

11:53 am
September 29, 2010


chris

Member

posts 6

I want them to go to different addresses.

The problem is that when I receive an email it is delivered into the right mailbox (under vmail), but when i try to retrieve an email is tries to retrieve it from the users mailbox in /home/user (not /home/vmail/domain/user)

12:49 pm
September 29, 2010


Kendermin

Member

posts 15

Post edited 12:50 pm – September 29, 2010 by Kendermin


check your dovecot settings.  Make sure
 

	mail_location = maildir:/var/vmail/%d/%n/Maildir

I think that is the setting you want.  %d is domain and %n is user.

 

remove the Maildir if it is not in maildir format

2:41 pm
September 29, 2010


chris

Member

posts 6

I changed the mail_location setting as you advised and I got this following error in maillog:

 

Sep 29 14:39:42 localhost dovecot: imap-login: Login: user=<chris>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Sep 29 14:39:42 localhost dovecot: IMAP(chris): mkdir(/var/vmail//chris/Maildir/cur) failed: Permission denied
Sep 29 14:39:42 localhost dovecot: IMAP(chris): mkdir(/var/vmail//chris/Maildir/cur) failed: Permission denied
Sep 29 14:39:42 localhost dovecot: IMAP(chris): Disconnected: Logged out

Sep 29 14:39:42 localhost dovecot: imap-login: Login: user=<chris>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, securedSep 29 14:39:42 localhost dovecot: IMAP(chris): mkdir(/var/vmail//chris/Maildir/cur) failed: Permission deniedSep 29 14:39:42 localhost dovecot: IMAP(chris): mkdir(/var/vmail//chris/Maildir/cur) failed: Permission deniedSep 29 14:39:42 localhost dovecot: IMAP(chris): Disconnected: Logged out

3:28 pm
September 29, 2010


Kendermin

Member

posts 15

I looks like a permission issue… root access needed perhaps? shouldn't those folders exist from postfix? 

3:45 pm
September 29, 2010


chris

Member

posts 6

When mail is received it is correctly filed by postfix in those folders. If I manually look into these folders I notice the mail is being receives, but I don't understand why dovecot is having trouble retrieving these files?

Any suggestions how to fix this permission issue? or underlying issue?

6:36 pm
September 29, 2010


chris

Member

posts 6

Kendermin said:

I looks like a permission issue… root access needed perhaps? shouldn't those folders exist from postfix? 

On clue: It seems the %d parameter is empty. Is there any way to configure it so that %d returns the domain name?

 


9:13 am
September 30, 2010


Kendermin

Member

posts 15

Post edited 9:17 am – September 30, 2010 by Kendermin


chris said:

Kendermin said:

I looks like a permission issue… root access needed perhaps? shouldn't those folders exist from postfix? 

On clue: It seems the %d parameter is empty. Is there any way to configure it so that %d returns the domain name?

 


http://workaround.org/book/exp…..rt/html/60

this might help espically at the end.

"Before you send a first test email you will need to fix file system permissions for the

/etc/dovecot/dovecot.conf file so that the vmail user can access the Dovecot configuration.

The reason is that Postfix starts the delivery agent with vmail permissions.

 

$> chgrp vmail /etc/dovecot/dovecot.conf
$> chmod g+r /etc/dovecot/dovecot.conf"

Sorry if I am not much help.  I would love to set up a test system on my end to 
test these prior to giving you these codes but I can't even get post fix to send mail to
anything else other then root.  And of course dovecot is hardcoded not to allow root to
look up mail.

6:53 am
October 2, 2010


chris

Member

posts 6

I followed those instructions. Unfortunately the problem still exists.

9:59 am
October 2, 2010


consultant

Admin

posts 353

Hi chris,

 

Make sure your dovecot configuration looks like the one below.

 

auth_username_format = %Lu

passdb sql {
  args = /etc/dovecot-mysql.conf
}

userdb static {
  args = uid=501 gid=501 home=/home/vmail/%d/%n
}

Next, comment out the other passdb and userdb sections. It is possible that user chris also exists in the passwd file and thus uses the passwd settings instead of the static settings.

Reply to Post

Reply to Topic:
Problem accessing correct mailboxes

Guest Name (Required):

Guest Email (Required):

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
12 + 4
   


About the Linux Mail Server Setup and Howto Guide Forum

Forum Timezone: America/New_York

Most Users Ever Online: 60

Currently Online:
21 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 5
Topics: 343
Posts: 1062

Membership:

There are 966 Members
There have been 91 Guests

There is 1 Admin

Top Posters:

shanmugasundaram s – 46
Kendermin – 15
Ginger – 14
bighorn – 14
iron_michael86 – 12
Raminda – 11

Recent New Members: waveney, achal, niesul14, hesaum, sreevinodss, nasonov

Administrators: consultant (353 Posts)