Hello, I know, there are many articles on this, but for me they miss the simplest things. 1)I just want to setup a dovecot server on some linux machine that holds email for local accounts in Maildirformat and provides them to user-mail-software like evolution locally. 2)I want postfix to send mail locally to dovecot. 3)I want to use fetchmail to pick up mail from my internet provider via pop3 and use postfix to distribute it locally. No mention of sending out mail so far. Except for 3) I don’t want to be bothered by SSL, PAM, LTS … it’s all local.
I pretty much have 1) running. I can connect to dovecot and access my localy stored mail via IMAP.
But I can’t get the communication between postfix and dovecot to work. Do I need virtual-domain, virtual-users to be able to send to dovecot or just local stuff in my use-case. Do I use lda or lmtp? How does the mapping from local mail-addresses to user-accounts (and thus mail-dirs) work. Does postfix do this or dovecot? Currently postfix apparently sends the full email like karl@fritz.box to dovecot and dovecot refuses.
I am kind of lost.
Wolfgang
P.S.: I had all of this running in the past. Postfix put the mail in /var/spool/mail/… and dovecot used that as INBOX. Apprently dovecot cannot read mbox-INBOX files anymore if it is configured to store as maildir. It’s one or the other now.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya @wolfgangbuesser,
It seems like you’re on the right track. I’ll try to address your questions and provide you with a simple guide to achieve your desired setup.
You mentioned that you already have Dovecot running and can access your locally stored email via IMAP. That’s great! Let’s move on to the next step.
To make Postfix send mail locally to Dovecot, you need to configure Postfix to use Dovecot’s LMTP (Local Mail Transfer Protocol) service. LMTP is more efficient than LDA (Local Delivery Agent) and is the recommended method for Dovecot. Here’s a simple configuration to achieve this:
/etc/postfix/main.cf file and add the following lines:- mailbox_transport = lmtp:unix:private/dovecot-lmtp
/etc/dovecot/dovecot.conf or /etc/dovecot/conf.d/10-mail.conf, and set the mail location:- mail_location = maildir:~/Maildir
/etc/dovecot/conf.d/10-lmtp.conf:- service lmtp {
- unix_listener /var/spool/postfix/private/dovecot-lmtp {
- mode = 0600
- user = postfix
- group = postfix
- }
-
- protocol lmtp {
- postmaster_address = postmaster@yourdomain.com
- hostname = yourdomain.com
- }
- }
~/.fetchmailrc:- poll your.provider.com protocol POP3
- user "your_username@provider.com" password "your_password"
- is "local_username" here
- fetchall
- no ssl
Replace the placeholders with the appropriate values for your provider and local username. Then, run fetchmail in the background:
fetchmail -d 300
This will make fetchmail run as a daemon, checking for new mail every 5 minutes (300 seconds).
With these configurations, you should be able to achieve the setup you described. Let me know if you have any questions or need further assistance.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.