A
A
alex_dredd2012-01-13 15:04:54
Email
alex_dredd, 2012-01-13 15:04:54

Auto Save Attachments from Mail [Solved]?

There are:
- a mail server with access to it via POP3
- a Windows server (Windows 2003).
It is necessary that
- the screw server goes to the server via pop3 every N time, picks up new letters, saves attachments from these letters to the folder we need (the text of the letter itself is not needed).
- this was not done using Outlook or another full-fledged client. For this task, I don’t see the point of keeping the mailer constantly open. The ideal option is a powershell script
- letters on the server, preferably, remained unread, because they will be processed by another soft shell.
PS Google. Google gives out billions of options for automating this process in Outlook, which is not very good.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
alex_dredd, 2012-01-19
@alex_dredd

Solution found. Of course, not exactly what I wanted, but still.
www.gearmage.com/maildownloader.html

A
ayc, 2012-01-13
@ayc

Eserv v4 (a mail server for Windows) has such tools - there is PopPull for collecting mail and a built-in script for extracting attachments, there was a ready-made example on the forum. If installing a whole server for such a task is too bold, then you can take the pop3recv.exe program (console mail collection agent) and Erobot or MContent (this is all from Eserv too) from the old Eserv v2 kit to unpick the received letters. They are all console-based, so they are easily called from shell scripts and schedulers. If something does not work out, write to the Eserv forum, they will definitely help you.

T
t_q_l, 2013-12-21
@t_q_l

Comrades, has something changed in 2 years? There were no other solutions?

H
Hootie, 2014-03-25
@Hootie

I used Thunderbird + AttachmentExtractor for this purpose

S
sandyanf, 2020-08-26
@sandyanf

There is a solution in PowerShell. Detailed documentation with examples here: https://deaksoftware.com.au/articles/using_pop3_in... Download
the library here: OpenPop.dll
Checked, it works on a 2003 server.

S
Sergey, 2021-03-24
@Sykoku

The solution with OpenPop works, but there are a number of nuances:
1. When extracting a letter / attachments, the time zone is not taken into account
2. PowerShell 5.1 or higher is required to extract it from the server state
3. Letters are viewed in reverse order (LIFO - newer ones first)
4. After a while, for absolutely no clear reason, the contentStream.copyTo directive error began to appear . I had to change it to contentStream.WriteTo . The error recurred after a few days or occurred immediately on variations of Win 7x32, Win 7x64, Win 10x64. The only thing is that all machines worked under Hyper-V.
Peculiarities.
Standard PowerShell Win7 - 2.0. When loading OpenPop (and the task is scheduled with an interval of 5 minutes), the entire library was displayed on the screen in the 16th form. After the transition to 5.1, these miracles disappeared, but others appeared. For example, the name of the transferred file is passed to the cmd file in its normal form, but when you try to run it or write it to a file (standard stream, >>), we get extra quotes-terminators and an incomprehensible encoding.
In my case, the MySQL database was still installed and attachments, after extracting, unpacking and converting for viewing in the WEB, were entered into it. The only driver that worked right away was v2.
Net system size after installing all packages (WAMP, DocTo, GhostScript, M$ Word, M$ Excel, sK1 Project Uniconvertor):
Win 7x32 - 8 GB, Win 7x64 - 20 GB, Win 10x32 - 40 GB
There was an attempt to start the system on Ubuntu 16, but it did not take off.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question