S
S
smartup2015-04-28 23:08:59
linux
smartup, 2015-04-28 23:08:59

What is the easiest way to collect mail from several mailboxes via imap in CentOS 6, so that later you can send some letters to yourself?

Gentlemen, the situation is this: you need to regularly collect mail from several dozen mailboxes (gmail.com, yandex.ru, mail.ru ...) using imap and forward only some of the letters (based on the Cyrillic subject of the letter) further to your own mailbox.
Until now, my acquaintance with mail on CentOS was limited to installing postfix, allowing sending from local scripts, and rarely smoking logs on the subject of "is there spam coming from my server?" You see, nothing else was required from the server: there was enough mail for Google Apps. But now it turned out that he did not agree to collect mail from dozens of accounts. Therefore, I will be grateful if you poke into the most concise solution.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
smartup, 2015-05-06
@smartup

As a result, the mail was collected using getmail (the package is in epel), because fetchmail famously marks all downloaded messages as read and it was not possible to wean it from this. However, getmail also has inconvenient features: in order for it to work with several mailboxes at once, you have to specify several configuration files through the parameters, but this was decided by the bash wrapper.
Processed with procmail as suggested by Rsa97

S
Sergey, 2015-04-28
@butteff

I once solved a similar problem in php, at one of the interviews they gave me as a test to write my own interface to gmail, pulling mail from it through imap in php.
Actually, I won’t suggest the most concise solution, but you can go to github and search for "imap @languagename", there will be many convenient solutions and methods that you can use. Here is an example for php.
Those. in any language convenient and known to you, using ready-made opensource solutions, you can collect mail, analyze it and send it to the right place. I would do so.

R
Rsa97, 2015-04-29
@Rsa97

Collecting mail - fetchmail
Analysis - procmail or self-written script

A
AlexLIn, 2015-04-29
@AlexLIn

I use https://www.mailarchiva.com/
Collection, archive, encryption.
You can set up filters etc.
There is also an api

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question