Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

where does OS X server (ML) store IMAP messages?

Hi,


On linux systems, the IMAP server stores mail message folders as files in the users home directory. On OS X server, I can't find where they are stored. Are they in some kind of relational database? (I tried creating a unique folder, storing on the server, then using mdfind to find a file, but no luck).


Thanks in advance, Pete

Mac Pro, OS X Mountain Lion (10.8.1), OS X SERVER

Posted on Jan 25, 2013 10:19 AM

Reply
Question marked as Best reply

Posted on Jan 26, 2013 4:34 AM

On Lion server and above it looks like Apple has changed the default location.


On a standard installation they are in /Library/Server/Mail/Data/mail/some_GUID_for_each_user


So...


server:mail Administrator$ pwd

/Library/Server/Mail/Data/mail

server:mail Administrator$ ls -la

total 0

drwxrwxr-x 8 _dovecot mail 272 Jan 9 16:00 .

drwxr-xr-x 10 root wheel 340 Jan 3 13:40 ..

drwx------ 21 _dovecot mail 714 Jan 26 13:04 26AB5EF5-5396-451A-93F2-5E457E287169

drwx------ 21 _dovecot mail 714 Jan 26 12:35 3B021A1A-4527-41AC-8B76-922C13E091E1

drwx------ 21 _dovecot mail 714 Jan 26 12:16 4563D675-454C-4B68-AF5E-D680D264525B

drwx------ 9 _dovecot mail 306 Jan 9 16:00 6D588E18-BD64-4DEC-AF8B-CEE8A074281D

drwx------ 13 _dovecot mail 442 Dec 28 08:36 9F1A7733-6335-4B28-B583-F06B7F2799C2

drwx------ 9 _dovecot mail 306 Dec 29 18:13 F0524C48-C367-4021-BA80-BD14DE0068ED


Note also that the files/directories only readable by the Dovecot daemon, each users' mail directory are not even accessible (via the OS) to each user. To see contents of directories/files you need to do as root.


The reason (educated guess) Apple has/is changing this is because they are progressively moving away from standard Unix/Linux file locations for a number of add-on applications like Postfix, Dovecot and so on.


[RANT]

This is due to (in my opinion) them being put into a corner because of the so-called 'free', Free Software Foundation. Specifically the terms of the GPL3 licence which is specifically designed to be anti companies like Apple, Microsoft & every commercial software company, and makes it impossible for Apple to use any GPL3 licenced software on the Mac. They certainly cannot rely and trust in the licence, and reasonably build software using it into OS X Server.


The GPL3 takes away your freedom to use software as you may wish. You may thank Richard Stallman — who is a fanatic.


A significant number of open-source software creators (Apache, Postfix etc.) have spoken out against the GPL3 licence, and they licence their open source software under a more rational licence.


Personally, I have been very disappointed in the attitude of the Samba team.

[/RANT]

2 replies
Question marked as Best reply

Jan 26, 2013 4:34 AM in response to peteriley

On Lion server and above it looks like Apple has changed the default location.


On a standard installation they are in /Library/Server/Mail/Data/mail/some_GUID_for_each_user


So...


server:mail Administrator$ pwd

/Library/Server/Mail/Data/mail

server:mail Administrator$ ls -la

total 0

drwxrwxr-x 8 _dovecot mail 272 Jan 9 16:00 .

drwxr-xr-x 10 root wheel 340 Jan 3 13:40 ..

drwx------ 21 _dovecot mail 714 Jan 26 13:04 26AB5EF5-5396-451A-93F2-5E457E287169

drwx------ 21 _dovecot mail 714 Jan 26 12:35 3B021A1A-4527-41AC-8B76-922C13E091E1

drwx------ 21 _dovecot mail 714 Jan 26 12:16 4563D675-454C-4B68-AF5E-D680D264525B

drwx------ 9 _dovecot mail 306 Jan 9 16:00 6D588E18-BD64-4DEC-AF8B-CEE8A074281D

drwx------ 13 _dovecot mail 442 Dec 28 08:36 9F1A7733-6335-4B28-B583-F06B7F2799C2

drwx------ 9 _dovecot mail 306 Dec 29 18:13 F0524C48-C367-4021-BA80-BD14DE0068ED


Note also that the files/directories only readable by the Dovecot daemon, each users' mail directory are not even accessible (via the OS) to each user. To see contents of directories/files you need to do as root.


The reason (educated guess) Apple has/is changing this is because they are progressively moving away from standard Unix/Linux file locations for a number of add-on applications like Postfix, Dovecot and so on.


[RANT]

This is due to (in my opinion) them being put into a corner because of the so-called 'free', Free Software Foundation. Specifically the terms of the GPL3 licence which is specifically designed to be anti companies like Apple, Microsoft & every commercial software company, and makes it impossible for Apple to use any GPL3 licenced software on the Mac. They certainly cannot rely and trust in the licence, and reasonably build software using it into OS X Server.


The GPL3 takes away your freedom to use software as you may wish. You may thank Richard Stallman — who is a fanatic.


A significant number of open-source software creators (Apache, Postfix etc.) have spoken out against the GPL3 licence, and they licence their open source software under a more rational licence.


Personally, I have been very disappointed in the attitude of the Samba team.

[/RANT]

Apr 28, 2013 2:15 AM in response to FromOZ

Can you please explain then how all emails to my system are being routed to /var/mail/<user.name> file?


This has me befuddled and wanting to shoot the computer. I have NOT set:


# DELIVERY TO MAILBOX

#

# The home_mailbox parameter specifies the optional pathname of a

# mailbox file relative to a user's home directory. The default

# mailbox file is /var/spool/mail/user or /var/mail/user. Specify

# "Maildir/" for qmail-style delivery (the / is required).

#

#home_mailbox = Mailbox

#home_mailbox = Maildir/


If I turn on the "Maildir/" option -> then mail is routed to /Users/<user.name>/Maildir


I cannot for the life of me get it to route to where the IMAP daemon is reading it's files. I can verify that when I send from one user to another on my system (from outside the domain) - the .SENT MESSAGES folder DOES show the email being sent - so it does find those in the MAILDIR structure - it's only when sending out that it doesn't work.


Is there some parameter, setting, blessing to some mail goddess that will get this to correctly route out?


I really need some help here.


Here's my main.cf (just for kicks):


sh-3.2# vi main.cf



# It will take a minute or so before changes become visible. Use

# "postfix reload" to eliminate the delay.

#

#alias_maps = dbm:/etc/aliases

#alias_maps = hash:/etc/aliases

#alias_maps = hash:/etc/aliases, nis:mail.aliases

#alias_maps = netinfo:/aliases



# The alias_database parameter specifies the alias database(s) that

# are built with "newaliases" or "sendmail -bi". This is a separate

# configuration parameter, because alias_maps (see above) may specify

# tables that are not necessarily all under control by Postfix.

#

#alias_database = dbm:/etc/aliases

#alias_database = dbm:/etc/mail/aliases

#alias_database = hash:/etc/aliases

#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases



# ADDRESS EXTENSIONS (e.g., user+foo)

#

# The recipient_delimiter parameter specifies the separator between

# user names and address extensions (user+foo). See canonical(5),

# local(8), relocated(5) and virtual(5) for the effects this has on

# aliases, canonical, virtual, relocated and .forward file lookups.

# Basically, the software tries user+foo and .forward+foo before

# trying user and .forward.

#

#recipient_delimiter = +



# DELIVERY TO MAILBOX

#

# The home_mailbox parameter specifies the optional pathname of a

# mailbox file relative to a user's home directory. The default

# mailbox file is /var/spool/mail/user or /var/mail/user. Specify

# "Maildir/" for qmail-style delivery (the / is required).

#

#home_mailbox = Mailbox

#home_mailbox = Maildir/



# The mail_spool_directory parameter specifies the directory where

# UNIX-style mailboxes are kept. The default setting depends on the

# system type.

#

#mail_spool_directory = /var/mail

#mail_spool_directory = /var/spool/mail



# The mailbox_command parameter specifies the optional external

# command to use instead of mailbox delivery. The command is run as

# the recipient with proper HOME, SHELL and LOGNAME environment settings.

# Exception: delivery for root is done as $default_user.

#

# Other environment variables of interest: USER (recipient username),

# EXTENSION (address extension), DOMAIN (domain part of address),

# and LOCAL (the address localpart).

#

# Unlike other Postfix configuration parameters, the mailbox_command

# parameter is not subjected to $parameter substitutions. This is to

# make it easier to specify shell syntax (see example below).

#

# Avoid shell meta characters because they will force Postfix to run

# an expensive shell process. Procmail alone is expensive enough.

#

# IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN

# ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.

#

#mailbox_command = /some/where/procmail

#mailbox_command = /some/where/procmail -a "$EXTENSION"



# The mailbox_transport specifies the optional transport in master.cf

# to use after processing aliases and .forward files. This parameter


# The mailbox_transport specifies the optional transport in master.cf

# to use after processing aliases and .forward files. This parameter

# has precedence over the mailbox_command, fallback_transport and

# luser_relay parameters.

#

# Specify a string of the form transport:nexthop, where transport is

# the name of a mail delivery transport defined in master.cf. The

# :nexthop part is optional. For more details see the sample transport

# configuration file.

#

# NOTE: if you use this feature for accounts not in the UNIX password

# file, then you must update the "local_recipient_maps" setting in

# the main.cf file, otherwise the SMTP server will reject mail for

# non-UNIX accounts with "User unknown in local recipient table".

#

#mailbox_transport = lmtp:unix:/file/name

#mailbox_transport = cyrus



# The fallback_transport specifies the optional transport in master.cf

# to use for recipients that are not found in the UNIX passwd database.

# This parameter has precedence over the luser_relay parameter.

#

# Specify a string of the form transport:nexthop, where transport is

# the name of a mail delivery transport defined in master.cf. The

# :nexthop part is optional. For more details see the sample transport

# configuration file.

#

# NOTE: if you use this feature for accounts not in the UNIX password

# file, then you must update the "local_recipient_maps" setting in

# the main.cf file, otherwise the SMTP server will reject mail for

# non-UNIX accounts with "User unknown in local recipient table".

#

#fallback_transport = lmtp:unix:/file/name

#fallback_transport = cyrus

#fallback_transport =



# The luser_relay parameter specifies an optional destination address

# for unknown recipients. By default, mail for unknown@$mydestination,

# unknown@[$inet_interfaces] or unknown@[$proxy_interfaces] is returned

# as undeliverable.

#

# The following expansions are done on luser_relay: $user (recipient

# username), $shell (recipient shell), $home (recipient home directory),

# $recipient (full recipient address), $extension (recipient address

# extension), $domain (recipient domain), $local (entire recipient

# localpart), $recipient_delimiter. Specify ${name?value} or

# ${name:value} to expand value only when $name does (does not) exist.

#

# luser_relay works only for the default Postfix local delivery agent.

#

# NOTE: if you use this feature for accounts not in the UNIX password

# file, then you must specify "local_recipient_maps =" (i.e. empty) in

# the main.cf file, otherwise the SMTP server will reject mail for

# non-UNIX accounts with "User unknown in local recipient table".

#

#luser_relay = $user@other.host

#luser_relay = $local@other.host

#luser_relay = admin+$local


# JUNK MAIL CONTROLS

#

# The controls listed here are only a very small subset. The file

# SMTPD_ACCESS_README provides an overview.



# The header_checks parameter specifies an optional table with patterns

# that each logical message header is matched against, including

# headers that span multiple physical lines.

#

# By default, these patterns also apply to MIME headers and to the

# headers of attached messages. With older Postfix versions, MIME and

# attached message headers were treated as body text.

#

# For details, see "man header_checks".

#

#header_checks = regexp:/etc/postfix/header_checks



# FAST ETRN SERVICE

#

# Postfix maintains per-destination logfiles with information about

# deferred mail, so that mail can be flushed quickly with the SMTP

# "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld".

# See the ETRN_README document for a detailed description.

#

# The fast_flush_domains parameter controls what destinations are

# eligible for this service. By default, they are all domains that

# this server is willing to relay mail to.

#

#fast_flush_domains = $relay_domains



# SHOW SOFTWARE VERSION OR NOT

#

# The smtpd_banner parameter specifies the text that follows the 220

# code in the SMTP server's greeting banner. Some people like to see

# the mail version advertised. By default, Postfix shows no version.

#

# You MUST specify $myhostname at the start of the text. That is an

# RFC requirement. Postfix itself does not care.

#

#smtpd_banner = $myhostname ESMTP $mail_name

#smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)



# PARALLEL DELIVERY TO THE SAME DESTINATION

#

# How many parallel deliveries to the same user or domain? With local

# delivery, it does not make sense to do massively parallel delivery

# to the same user, because mailbox updates must happen sequentially,

# and expensive pipelines in .forward files can cause disasters when

# too many are run at the same time. With SMTP deliveries, 10

# simultaneous connections to the same domain could be sufficient to

# raise eyebrows.

#

# Each message delivery transport has its XXX_destination_concurrency_limit

# parameter. The default is $default_destination_concurrency_limit for

# most delivery transports. For the local delivery agent the default is 2.



#local_destination_concurrency_limit = 2

#default_destination_concurrency_limit = 20



# DEBUGGING CONTROL

#

# The debug_peer_level parameter specifies the increment in verbose

# logging level when an SMTP client or server host name or address

# matches a pattern in the debug_peer_list parameter.

#

debug_peer_level = 2



# The debug_peer_list parameter specifies an optional list of domain

# or network patterns, /file/name patterns or type:name tables. When

# an SMTP client or server host name or address matches a pattern,

# increase the verbose logging level by the amount specified in the

# debug_peer_level parameter.

#

#debug_peer_list = 127.0.0.1

#debug_peer_list = some.domain



# The debugger_command specifies the external command that is executed

# when a Postfix daemon program is run with the -D option.

#

# Use "command .. & sleep 5" so that the debugger can attach before

# the process marches on. If you use an X-based debugger, be sure to

# set up your XAUTHORITY environment variable before starting Postfix.

#

debugger_command =

PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

xxgdb $daemon_directory/$process_name $process_id & sleep 5



# If you can't use X, use this to capture the call stack when a

# daemon crashes. The result is in a file in the configuration

# directory, and is named after the process name and the process ID.

#

# debugger_command =

# PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont;

# echo where) | gdb $daemon_directory/$process_name $process_id 2>&1

# >$config_directory/$process_name.$process_id.log & sleep 5

#

# Another possibility is to run gdb under a detached screen session.

# To attach to the screen sesssion, su root and run "screen -r

# <id_string>" where <id_string> uniquely matches one of the detached

# sessions (from "screen -list").

#

# debugger_command =

# PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; screen

# -dmS $process_name gdb $daemon_directory/$process_name

# $process_id & sleep 1



# INSTALL-TIME CONFIGURATION INFORMATION

#

# The following parameters are used when installing a new Postfix version.

#

# sendmail_path: The full pathname of the Postfix sendmail command.

# This is the Sendmail-compatible mail posting interface.

#

sendmail_path = /usr/sbin/sendmail



# newaliases_path: The full pathname of the Postfix newaliases command.

# This is the Sendmail-compatible command to build alias databases.

#

newaliases_path = /usr/bin/newaliases



# mailq_path: The full pathname of the Postfix mailq command. This

# is the Sendmail-compatible mail queue listing command.

#

mailq_path = /usr/bin/mailq



# setgid_group: The group for mail submission and queue management

# commands. This must be a group name with a numerical group ID that

# is not shared with other accounts, not even with the Postfix account.

#

setgid_group = _postdrop



# html_directory: The location of the Postfix HTML documentation.

#

html_directory = /usr/share/doc/postfix/html



# manpage_directory: The location of the Postfix on-line manual pages.

#

manpage_directory = /usr/share/man



# sample_directory: The location of the Postfix sample configuration files.

# This parameter is obsolete as of Postfix 2.1.

#

sample_directory = /usr/share/doc/postfix/examples



# readme_directory: The location of the Postfix README files.

#

readme_directory = /usr/share/doc/postfix

#======================================================================

# dovecot

dovecot_destination_recipient_limit = 1



# default mailbox size limit set to no limit

mailbox_size_limit = 0



# List of ciphers or cipher types to exclude from the SMTP server cipher

# list at all TLS security levels.

smtpd_tls_exclude_ciphers = SSLv2, aNULL, ADH, eNULL



# Protect SSL/TLS encryption keys

tls_random_source = dev:/dev/urandom



# (APPLE) Credentials for using URLAUTH with IMAP servers.

imap_submit_cred_file =



# (APPLE) The SACL cache caches the results of Mail Service ACL lookups.

# Tune these to make the cache more responsive to changes in the SACL.

# The cache is only in memory, so bouncing the sacl-cache service clears it.

use_sacl_cache = yes

# sacl_cache_positive_expire_time = 7d

# sacl_cache_negative_expire_time = 1d

# sacl_cache_disabled_expire_time = 1m



# (APPLE) Reject messages having any MIME body part (attachment, etc.)

# larger than this number of bytes. 0, the default, means no limit.

# mime_max_body_size = 0

#======================================================================

inet_interfaces = all

mydomain_fallback = fe77.com

smtpd_tls_cert_file = /etc/certificates/www.fe77.com.79A627DA8A4924043CEC496E8022C529069F0B01.cert.pe m

smtpd_tls_CAfile = /etc/certificates/www.fe77.com.79A627DA8A4924043CEC496E8022C529069F0B01.chain.p em

smtpd_tls_key_file = /etc/certificates/www.fe77.com.79A627DA8A4924043CEC496E8022C529069F0B01.key.pem

config_directory = /Library/Server/Mail/Config/postfix

virtual_alias_maps = $virtual_maps

smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination

smtpd_use_pw_server = yes

enable_server_options = yes

smtpd_pw_server_security_options = cram-md5,digest-md5,login,plain

smtpd_sasl_auth_enable = yes

smtpd_enforce_tls = no

smtpd_use_tls = yes

smtpd_tls_loglevel = 0


Man thanks in advance...


Joe...

where does OS X server (ML) store IMAP messages?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.