Does PMG Fetchmail support IMAP IDLE?

Why would you want to use IDLE ?
Multiple external accounts (GMX, WEB.de, etc.) shall be collected and it would be nice if mails would "immediately" be seen by PMG instead of waiting for the next polling cycle.
Is there any better approach for "immediately" getting mails from external mail accounts?
 
Is there any better approach for "immediately" getting mails from external mail accounts?
I'd say use SMTP and configure a redirect on your gmx/web.de.... accounts to an address in your domain

IMAP/POP are mostly async protocols.
 
My intention is to run a mailserver on my local server for private mails. My network is only connected via a dynamic IP address to the Internet, so running a "real" mailserver is difficult or almost impossible.
Because of this reason the plan is to collect mails from "real" mail accounts at mail providers, filtering them via PMG and forwarding them to my internal mailserver. For sending mails the path will be from the mailserver via PMG as smarthost to accounts at my mail providers. So the internal server has no direct SMTP connections to the outside, because no real mailserver would trust my local server.
As similar system is running here at the moment and the most annoying thing is the delay of a few minutes when receiving the new mails because of the POP polling cycle. Therefore, my idea was to use IMAP instead of POP ans especially the IMAP IDLE feature to immediately get mails "pushed" to my PMG instance.

Do you have any ideas on a possible solution via PMG?
 
IMAP IDLE is not supported, but this is email, so I think 1 minute delay is OK.
You would need to decrease fetchmail interval from default (which is 5 minutes).
Use/etc/pmg/templates/fetchmailrc.tt (copied from /var/lib/pmg/templates).
Then edit: set daemon 30 so interval is 30 seconds.
 
@thomas-hn I'm doing something similar to this with mailcow dockerized (email server) and getmail (also runs under docker).

Effectively, mailcow has an option to poll for email from external accounts. It does this using imap but at fixed intervals. This works well for initially syncing up an account but not for ongoing use unless you're ok with delays.

Getmail is a python script running along side mailcow. It maintains an IMAP IDLE connection to a specified account's INBOX, retrieving any new mail as it arrives. To keep things simple, retrieved email is then either deleted on the remote host, or moved to a specified folder. That is, getmail is dumb in the sense of keeping track of new/existing email. If the account is not empty it gets everything then moves/deletes it.

I use it to sync 6 or 7 accounts from a backup mx server. Seems to be working well.

https://github.com/christianbur/docker_projects/tree/master/getmail

Perhaps this or something similar can be implemented in your use case.

------------------

I initially implemented something similar to Stoiko's solution in #5. However, those redirects ended up at the same server because the domain name was the same. That is, it wasn't following mx record priority but rather delivering to itself.

There is an option to change this behavior (backup mail exchanger?), but doing so would defeat the purpose of having those emails available if/when the primary mx is down.

1690321672429.png
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!