0

I need to deliver incoming mail from my local MTA into a (remote) IMAP mailbox. Is there a tool which can do that?

I cannot deliver the mail via SMTP because the remote system's spam filters etc. are too restrictive and don't reliably allow "simple" mail forwarding.

The local MTA is exim4. That's unlikely to change but I'm open to suggestions (it's my personal server). I do not have any access to the remote system, other than the IMAP account of course.

I know about offlineimap and similar programs; however, my goal is to not store the mail locally.

2
  • Can you install some software on the local/remote hosts?
    – Kondybas
    Nov 20, 2017 at 18:33
  • Yes. locally. (Updated question to clarify.) Nov 20, 2017 at 21:47

1 Answer 1

0

May be the most straightforward approach is to use ssh as local delivery agent.

You have to modify the router for local delivery that way:

begin routers
. . . . . 
local:
    driver      = accept
    domains     = +local_domains
    transport   = remote_delivery
. . . . . 

and transport:

begin transports
. . . . . 
remote_delivery:
    driver      = pipe
    command     = /path/to/ssh -i /path/rsa_key [email protected] \
                  deliver -d \$local_part@\$domain -f \$sender_address
. . . . . 

Each time local MTA want to deliver the message locally, remote_delivery transport will be activated. ssh will establish the keyfile-authorized connection to the remote host, then invoke the deliver utility and then pass the message to its stdin. And the deliver utility will do all the rest.

7
  • Unfortunately delivery via IMAP is mandatory. I don't have ssh to the remote host. Nov 20, 2017 at 21:46
  • Do you have any permission to manipulate email at all?
    – Kondybas
    Nov 20, 2017 at 22:56
  • Other than using IMAP to upload a new email to the remote: no. (I already updated the question to clarify that.) Nov 21, 2017 at 6:17
  • Delivery isn't performed via IMAP. Delivery is the process in between of SMTP and IMAP. Most of MTAs and POP/IMAP servers include some LDA functionality but that functionality does not related to the IMAP at all. If you want to perform local delivery on some host you need enough rights to launch utilities on this host.
    – Kondybas
    Nov 21, 2017 at 9:29
  • Delivery is the process that gets the message from your local SMTP agent and stores it in a mailbox. It's perfectly possible to read a RFC822 message from stdin and upload it to some remote inbox via IMAP. The only problem seems to be is that nobody has written a tool that does this yet. Nov 21, 2017 at 12:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .