Postfix enable Maildir
To enable postfix, run
1 2 |
postconf -e "home_mailbox = Maildir/" systemctl restart postfix |
You can do it by editing /etc/postfix/main.cf
1 |
vi /etc/postfix/main.cf |
Add
1 |
home_mailbox = Maildir/ |
if home_mailbox entry already in main.cf file, then modify instead of adding a new entry.
Virtual Mailbox
If you are using virtual mailbox, make sure you spedify folder in your virtual_mailbox_maps.
Here is what i have in main.cf
1 |
virtual_mailbox_maps = hash:/etc/postfix/vmailbox |
in /etc/postfix/vmailbox
1 2 3 |
root@ip-172-26-9-39:~# cat /etc/postfix/vmailbox boby@serverok.in serverok.in/boby/ root@ip-172-26-9-39:~# |
if you miss / at end of the line, mail will get stored in mailbox format even if you specify home_mailbox = Maildir/
Verify Maildir
Create a user
1 |
useradd -m -s /bin/bash incoming |
Sent a mail to the user
1 2 3 4 5 6 7 8 9 10 |
telnet localhost 25 ehlo localhost mail from: root@localhost rcpt to: incoming@localhost data Subject: Testing mail Testing mail . quit |
Login as the user
1 |
sudo - incoming |
Check the mail
1 2 |
MAIL=/home/incoming/Maildir mail |
You will see the mail. Only recent version of mail command support Maildir. If you are using older version, it won’t work. If you are using recent version of Linux, you will be fine.
See Postfix