-1

I have a domain abc.com with MX record/SMTP server mx1.example.com. My IMAP/POP server (incoming server) is imap.example.com and pop3.example.com.

How does my IMAP and POP server fetch emails from mx1.example.com ? Do IMAP/POP Server use any protocols to fetch emails from mx1.example.com. How does my IMAP server knows that emails should be fetched from mx1.example.com. I am using postfix and dovecot for email service.

Please clear my these confusions.

HBruijn
  • 77,029
  • 24
  • 135
  • 201

2 Answers2

1

It's quite simple: Postfix just hands the mail over to Dovecot automatically as soon as it arrives instead of storing the mail itself.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • Thanks for reply. :-) So, how does my SMTP Server finds that IMAP or POP server ? Where is the configuration portion ? Should we configure something like on SMTP that my imap/pop server is imap.abc.com or pop3.abc.com ? Or, are there any packages installed on IMAP server for fetching it from SMTP like fetchmail, get mail ?? – Anand Shrestha Aug 24 '16 at 10:01
1

In main.cf you can describe how exactly postfix will communicate to dovecot. If postfix and dovecot are sharing the same host, you can setup communication using LMTP protocol via unix socket. This approach will have less overhead than TCP based communication.
In main.cf you should specify your domain and unix socket details

virtual_mailbox_domains = yourdomain.com
virtual_transport = lmtp:unix:private/dovecot-lmtp

In dovecot's 10-master.conf also provide socket details

service lmtp {
 unix_listener /var/spool/postfix/private/dovecot-lmtp {
  group = postfix
  mode = 0600
  user = postfix
  }
}

Permissions on socket file

srw-------  1 postfix  postfix     0B Aug 17 00:35 /var/spool/postfix/private/dovecot-lmtp  

I'm using FreeBSD, in Linux paths may be different.

user1700494
  • 1,642
  • 2
  • 12
  • 21
  • Hi, thanks for reply. I have dovecot on different server. How do I point on my SMTP server that this is my dovecot server. Like should I use, transport_maps option on main.cf ? transport_maps = hash:/etc/postfix/smtproutes and on smtproutes file: abc.com.np smtp:1.1.1.1 – Anand Shrestha Aug 25 '16 at 07:57
  • Is mail delivering to real (system) users or to virtual users? – user1700494 Aug 25 '16 at 08:08
  • For virtual users. Example my smtp server is 2.2.2.2 and my dovecot server is 1.1.1.1. – Anand Shrestha Aug 25 '16 at 08:45
  • Can you please tell me, how can we establish that link between Postfix and Dovecot ? – Anand Shrestha Aug 25 '16 at 08:52