Hot answers tagged

13

Don't manage mailboxes from postfix. Never. Redirect messages for delivery via POP/IMAP server that has appropriate functionality. In case of dovecot there is dovecot-lda aka deliver that do everything and much more, like user-controlled message filtering, quota management, autoreplying and so on. Anyway maildir is newer and preferrable format due to the ...


11

If you're using NFS, do not use mbox under any circumstances whatsoever. And if you want a scalable solution, Maildir is the way to go. The main problem with mbox is that of file locking - if you have more than one mail server, or more than one process trying to access the mailbox at the same time, you run a large risk of getting a corrupted mailbox. It's ...


6

mutt also uses a global muttrc file. Typically it's in /etc/Muttrc or /usr/local/etc/Muttrc if you compiled it separately from the distro. You can just put the Maildir settings there. This mutt & Maildir Mini-HOWTO should give you an idea of what settings you need to change. Essentially you need to set folder and mbox and spoolfile to all point to ~/...


6

Yes In this particular case, you are using a 'Maildir' format mailbox. In Maildir, it's safe to use 'rm' to remove an individual piece of email, to use 'mv' to move an individual mail between folders on the same file system, etc. With other mail storage types, it may not be safe to rm a single email. More about Maildir: http://cr.yp.to/proto/maildir....


5

While I haven't checked out ext4 yet, I'm using xfs with LVM almost everywhere. You get the snapshots, you get online partition growing, and instant fsck if you do crash. When my mail spool fills up, I'm happy to know its a 30 seconds procedure to fix - assuming your LVM volume group has some free space in it.


5

According to the documentation, mailbox_command takes precedence over home_mailbox. Either disable the former, or set up your .procmailrc to deliver to Maildir (by suffixing the mailboxes with a slash, if memory serves).


4

It's not a one-liner, but you could copy chunks like this (in csh): foreach file (`ls | head -n 1000`) mv $file /tmp/new/dir end I'm not 100% sure that pipe will work with the number of files you've got, but it's worth a shot. Also, you might be able to do 500 at a time with this command, just change that 1000 to 500.


4

Your first guess was pretty close :-) I made a bash script to scan a whole maildir against spam #!/bin/bash DIR="/home/vmail/example.net/exampleuser/cur/" for f in $(ls $DIR); do spamassassin -Le "$DIR/$f" > /dev/null ERR=$? echo $ERR if [ $ERR -gt 0 ]; then mv "$DIR/$f" /tmp/spam/ else echo "This was no spam." ...


4

I think I jumped the gun asking this question. I went ahead and gave it a try with an unimportant account. I simply copied files from the old server new directory to the new server new directory, and my mail client downloaded them without any issues. Problem solved!


4

There are projects like libpst allowing access to PST files from within Linux, but I doubt that anything aside from Microsoft's tools themselves will give you a "clean" PST output. I cannot see though why you could not connect to the IMAP server using Outlook from your machine and simply copy the messages to one or more PST stores mounted in Outlook - this ...


4

You use Dovecot, so each file in the maildir folder that has :2,S near the end of the file name means it has been flagged as "Seen" or "Read". More useful info about Maildir formats: http://wiki.dovecot.org/MailboxFormat/Maildir http://cr.yp.to/proto/maildir.html An example file name from my Maildir: 1324304849.M312689P14620.subdomain.domain,S=24816,W=...


4

Your problem has nothing to do with maildir, and everything to do with bad mail routing. The key is the error message "mail for domain.com loops back to myself". You've setup MX records such that mail for domain.com points to your own mail server, but you haven't configured said mail server to actually accept and deliver mail. Set mydestination (or the ...


4

Postfix does not care, mostly. It just stuffs the mail into some file. The intersting part comes when you want to fetch the mail from the machine via IMAP (or POP3). Most IMAP-servers (I tried) prefer Maildirs, as these are easier extendable with various meta-data the IMAP-server could want, while still maintaining a basic "this is a Maildir" structure, so ...


4

Taken from postfixadmin FAQ 1) Why isn't PostfixAdmin creating my mailbox? PostfixAdmin is only a web interface for storing configuration settings. It does not (by default!) have the ability to create mail folders on disk. In a normal setup, sending the 'Welcome' email accomplishes this task - as Courier/Cyrus/etc do it (and have ...


4

If you still have access to Google apps mail using imap protocol then you can use imapsync tool to copy all mail from one account to another regardless of their storage backend.


3

I used XFS for a mail server setup (has been ext3 before) and definitely noticed an improvement with all the small files but it has been a while back and IIRC there are/were some "issues" with XFS and power-cuts (or any abrupt disruption to disk access for that matter) leaving all opened files filled with "0" and similar. But as mention by others: testing ...


3

ext3 can be tuned to better handle large directories run this: tune2fs -O dir_index /dev/hdXY then this: e2fsck -D -f /dev/hdXY The first one enables it for all future directories. The second one crawls through all your existing directories and builds the hash trees. That may take a good long while, so plan for some downtime.


3

LVM running ReiserFS - managed a server storing in the region of 20,000,000 quarantined messages and never skipped a beat. Plus for reasons I never worked out, the LVM on hardware RAID was faster than native file system access. There is the potential for an issue with flock, non syncronous updates and Reiser but I never actually ran into it in the best ...


3

It sounds like you want Vritual mailbox delivery. This is well-documented at the Postfix website, and will do exactly what you are asking. Note that you will need to do some lookup tables for this, although the official docs do mention that you can use a SQL backend at some point, should it all become too unmanageable.


3

consider a tar pipe like this one : tar cf - . | ssh remote "cd /backup; tar xf -" I would also be looking at bbcp. I realise the page about bbcp is enormous and confusing, but take the time to read it because I feel its probably the best solution here. http://www.slac.stanford.edu/~abh/bbcp/ I've done bbcp transfers on a variety of networks and found ...


3

I've made some significant improvements to Kevin's script mentioned above, and he was kind enough to accept my pull requests. Eventually we split this off into a dedicated project which you can find here: https://github.com/kdeldycke/maildir-deduplicate


3

for generic files in linux, I use fdupes utils to remove duplicate files. I found it also works for Maildir messages.


3

In bash you can use the ${} substring match to get a single letter from a string: coredump@anita:~$ x="john"; echo ${x:0:1} j coredump@anita:~$ x="john"; echo ${x:1:1} o coredump@anita:~$ x="john"; echo ${x:2:1} h So in your script you can assign those letters to variables and use it on the mkdir commands to create your directory structure, something like ...


3

The 2 indicates that each character following the comma is a flag. The S flag means "seen" (i.e. the message has been read). http://cr.yp.to/proto/maildir.html


3

Here is a Perl script that sets the file date to the value in the Date: line in the message header. http://www.athensfbc.com/public/fix_msg_dates Usage: fix_msg_dates.pl <path to message directory> -Rick


3

Since you've already configured Dovecot, the easiest solution to your problem is to use deliver from Dovecot as the mail delivery agent (MDA). This could be done by adding this line to main.cf (paths may vary according to your distribution, on Debian it's /usr/lib/dovecot/dovecot-lda): mailbox_command = /usr/libexec/dovecot/dovecot-lda -f "$SENDER" -a "$...


3

You're probably not sharing the same mailbox location/folder and/or mailbox delivery style (MBOX vs. MDIR) in both Postfix and Dovecot. As a result, Postfix is (correctly) writing under "/home/mailuser/Maildir" (where you see your mail arriving, under the "new" subfolder), but as dovecot is searching somewhere else... it doesn't find such mails (so you get a ...


3

I think it mostly a historical convention which assumes that users have an actual home directory and more access than just to their e-mail. Then it makes sense to have a ~/Maildir/ subdirectory in addition to ~/public_html/ , ~/.ssh/ etc. For virtual mail users there isn't much actual need for such an intermediate ~/Maildir/ directory, but using it doesn't ...


3

I have my own experience with this setup because I'm using dovecot without a ~/Maildir/ subdirectory. It's usually no problem at all, the only thing I noticed is that users can under certain circumstances see system folders in their mail client. In my case, users keep asking me what the 'dovecot' and 'sieve' folders in the folder subscription windows are for....


3

Given that Maildir uses the filesystem exclusively, I feel it should be possible to just mv ~fred/Maildir ~oldemployees/Maildir/fred or similar It depends on dovecot configuration By default dovecot use Maildir++ layout to store the email. ~/Maildir/new, ~/Maildir/cur and ~/Maildir/tmp directories contain the messages for INBOX. The tmp directory is ...



Only top voted, non community-wiki answers of a minimum length are eligible