LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 10-29-2007, 07:25 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,357

Rep: Reputation: 50
Where is Maildir


Hi folks,


Ubuntu 7.04 server amd64
Postfix 2.3.8


This is a newly built server. I can't locate the Maildir after sending mail.


Steps performed as follows;

$ hostname
Code:
ubuntu
$ hostname -f
Code:
ubuntu.mydomain.com
$ cat /etc/postfix/main.cf | grep mailbox_command
Code:
mailbox_command =
$ cat /etc/postfix/main.cf | grep home_mailbox
Code:
home_mailbox = Maildir/
$ cat /etc/postfix/main.cf | grep mydestination
Code:
mydestination = ubuntu.mydomain.com, localhost.mydomain.com, localhost.localdomain, localhost
$ cat /etc/postfix/main.cf | grep inet_interfaces
Code:
inet_interfaces = all
$ cat /etc/postfix/main.cf | grep inet_protocols
Code:
inet_protocols = all
$ cat /etc/postfix/main.cf | grep mynetworks
Code:
mynetworks = 127.0.0.0/8, 192.168.1.0/24"
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination

ping both ubuntu.mydomain.com/mydomain.com works.

On browser type both ubuntu.mydomain.com/mydomain.com displaying Apache2 default page.


$ telnet mail.mydomain.com 25
Code:
Trying 64.202.165.92...
telnet: Unable to connect to remote host: Connection timed out

$ telnet ubuntu.mydomain.com 25
Code:
Trying 127.0.1.1...
Connected to ubuntu.mydomain.com.
Escape character is '^]'.
220 ubuntu.mydomain.com ESMTP Postfix (Ubuntu)
ehlo mydomain.com
250-ubuntu.mydomain.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: root@mydomain.com
250 2.1.0 Ok
rcpt to: fmaster@mydomain.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>

Subject: My first mail for my domain

Hi

Are you there?

Admin
.
250 2.0.0 Ok: queued as 85354DF0168
quit
221 2.0.0 Bye
Connection closed by foreign host.

$ su - fmaster
Password:

fmaster@ubuntu:~$ ls -al
Code:
total 24
drwxr-xr-x 2 fmaster fmaster 4096 2007-10-28 20:16 .
drwxr-xr-x 5 root    root    4096 2007-10-28 09:57 ..
-rw------- 1 fmaster fmaster  112 2007-10-29 01:40 .bash_history
-rw-r--r-- 1 fmaster fmaster  220 2007-10-28 09:57 .bash_logout
Where is the Maildir ???


Do I need changing hostname as "mydomain.com"? If YES, please advice;

1) Apart from /etc/hosts and /etc/postifx/main.cf what other files I have to change as well ?

2) After changes made what command shall I run to activate the changes rather than rebooting the server ?


TIA


B.R.
satimis
 
Old 10-29-2007, 08:27 AM   #2
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
The /Maildir would be located in the users home directory..


Code:
username@mail:~$ ls
mail  Maildir  selections.txt  test.file
This folder is created using the command maildirmake

When you setup your mail server you would run this command as the user in the users directory, or as root in the /etc/skel/ directory so all new users would automatically get the Mail directories created..

man maildirmake


1) if you are sending and receiving mail from the internet then your hostname MUST be set to math your registered Domain name and DNS entries for your MX (Mail exchanger) here is a guide: http://www.cpqlinux.com/hostname.html.

If you are just sending mail locally within your own server the postfix config file must match the hostname on your local machine or it will try sending the mail elsewhere..


2) postfix reload

heres the most recent how-to I used for setting upa postfix server...
http://www.debian-administration.org/articles/364
 
Old 10-29-2007, 11:37 PM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,357

Original Poster
Rep: Reputation: 50
Hi farslayer,


Thanks for your advice.


I'm following;
PostfixBasicSetupHowto
https://help.ubuntu.com/community/Po...asicSetupHowto

to continue the test.

Under "Check the mailbox of fmaster"
Code:
su - fmaster
cd Maildir/new
ls
I wonder how can the Maildir be created. I repeated those steps 3 times without result.


Quote:
The /Maildir would be located in the users home directory..

Code:
username@mail:~$ ls
mail  Maildir  selections.txt  test.file
I can't find them.

$ ls -al /home/fmaster/
Code:
total 28
drwxr-xr-x 2 fmaster fmaster 4096 2007-10-29 09:12 .
drwxr-xr-x 5 root    root    4096 2007-10-28 09:57 ..
-rw------- 1 fmaster fmaster  267 2007-10-29 09:37 .bash_history
-rw-r--r-- 1 fmaster fmaster  220 2007-10-28 09:57 .bash_logout
-rw-r--r-- 1 fmaster fmaster 2298 2007-10-28 09:57 .bashrc
-rw------- 1 fmaster fmaster  102 2007-10-29 09:13 .lesshst
-rw-r--r-- 1 fmaster fmaster  566 2007-10-28 09:57 .profile

Quote:
This folder is created using the command maildirmake

When you setup your mail server you would run this command as the user in the users directory, or as root in the /etc/skel/ directory so all new users would automatically get the Mail directories created..

man maildirmake
I'm searching for info to config /etc/postfix/main.cf, so that Maildir will be created automatically on creating a new user. Any advice? Thanks.


Quote:
1) if you are sending and receiving mail from the internet then your hostname MUST be set to math your registered Domain name and DNS entries for your MX (Mail exchanger) here is a guide: http://www.cpqlinux.com/hostname.html.

If you are just sending mail locally within your own server the postfix config file must match the hostname on your local machine or it will try sending the mail elsewhere..


2) postfix reload

heres the most recent how-to I used for setting upa postfix server...
http://www.debian-administration.org/articles/364
Thanks for your advice and links. The server is NOT for production yet. Currently I'm testing sending mails on the same PC and on Intranet.


B.R.
satimis

Last edited by satimis; 10-29-2007 at 11:38 PM.
 
Old 10-30-2007, 07:18 AM   #4
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by satimis View Post

Under "Check the mailbox of fmaster"
Code:
su - fmaster
cd Maildir/new
ls
I wonder how can the Maildir be created. I repeated those steps 3 times without result.
Those steps will show you if the Maildir exists, but they will not create it..

Quote:
Originally Posted by satimis View Post
I'm searching for info to config /etc/postfix/main.cf, so that Maildir will be created automatically on creating a new user. Any advice? Thanks.
WOW your HOW-TO is completely missing the step on creating the Mail directories.. that's quite the oversight when you are telling someone to configure the Mail server to deliver to them..

Quote:

Creating Maildir directories


Now we need to create the Maildir directories for incoming mail to land in. We do this with the tool maildirmake, and we do it within the user's home directories. Do the following for existing users.
Code:
:# su user
:# cd ~
:# maildirmake Maildir (creates ~/Maildir plus cur, new, and tmp subdirs)
:# maildirmake -f Drafts Maildir (creates ~/Maildir/.Drafts)
:# maildirmake -f Junk Maildir (creates ~/Maildir/.Junk)
:# maildirmake -f Sent Maildir (creates ~/Maildir/.Sent)
:# maildirmake -f Templates Maildir (creates ~/Maildir/.Templates)
:# exit (back to being root)
Now repeat the above process as root in /etc/skel so new users will get Maildir directories automatically.
That should set it up for your user, and by putting the same Directories in /etc/skel they will be created automatically whenever you create anew user.
 
Old 10-30-2007, 10:59 AM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,357

Original Poster
Rep: Reputation: 50
I discover the trick

Hi farslayer,


Something funny happens here. Maildir(s) are found automatically recreated for satimis and fmaster but NOT for root. I just discovered them about 2 hours ago. Under each Maildir are cur,new and tmp. I did not create them manually. How can they come?


Now I discover the trick.


Create another user, administrator;

$ sudo useradd -m -s /bin/bash administrator
$ sudo passwd administrator
$ su - administrator
password
administrator@ubuntu~$ ls
No printout. Maildir can't be found.


Rebooted PC. Maildir still can't be found.


Sent a mail to administrator from satimis as root

$ telnet localhost 25
Code:
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 ubuntu.xyz.com ESMTP Postfix (Ubuntu)
ehlo localhost
250-ubuntu.xyz.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: root@localhost
250 2.1.0 Ok
rcpt to: administrator@localhost
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: First mail to administrator

Hi

How are you?

satimis    
.
250 2.0.0 Ok: queued as C0429DF005B
quit 
221 2.0.0 Bye
Connection closed by foreign host.
$ su - administrator
Password:
administrator@ubuntu:~$ ls
Code:
Maildir
Maildir created NOW.


$ ls Maildir/
Code:
cur  new  tmp
$ ls Maildir/new/
Code:
1193758653.Vfe00Ic5404fM742517.ubuntu
Mail came.

$ cat Maildir/new/1193758653.Vfe00Ic5404fM742517.ubuntu
Code:
Return-Path: <root@localhost>
X-Original-To: administrator@localhost
Delivered-To: administrator@localhost
Received: from localhost (localhost.localdomain [127.0.0.1])
        by ubuntu.xyz.com (Postfix) with ESMTP id C0429DF005B
        for <administrator@localhost>; Tue, 30 Oct 2007 08:35:49 -0700 (PDT)
Subject: First mail to administrator
Message-Id: <20071030153620.C0429DF005B@ubuntu.xyz.com>
Date: Tue, 30 Oct 2007 08:35:49 -0700 (PDT)
From: root@localhost
To: undisclosed-recipients:;

Hi

How are you?

satimis
That is the trick, Maildir created automatically when a mail comes.


I'm a little bid confused now.

If I want to create additional directories, say;
Drafts
Junk
Sent
Templates
etc.


How can I make them? Running the commands advised by you? Tks.


B.R.
satimis
 
Old 10-30-2007, 06:23 PM   #6
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Create them in /etc/skel as mentioned before. then when the new user is added the directories will be added automatically...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Maildir and mbox vikasumit Linux - Software 11 06-03-2006 12:48 AM
Is Maildir really the right choice? Red Squirrel Linux - Software 1 05-08-2005 12:06 AM
popa3d maildir??? razor7300 Linux - Software 0 08-31-2004 05:03 AM
maildir viewer fuzzyash Linux - Software 0 03-22-2004 03:31 PM
maildir and mbox deflin39 Linux - Newbie 1 01-07-2004 10:08 PM


All times are GMT -5. The time now is 04:35 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration