Giter Club home page Giter Club logo

Comments (30)

Sicos1977 avatar Sicos1977 commented on May 30, 2024

It's not that hard to make, what exactly do you need? An command line tool that scans a folder for all the *.msg files and then writes all the recipient e-mail addresses to a file? Can you give me your exact specifications?

from msgreader.

deajan avatar deajan commented on May 30, 2024

Hi,
I thought it would not be so hard to make, i actually tried to compile your project with SharpDevelop and then write the for loop and remove all the gui stuff, but then i got stuck with all the dependancies and assembly stuff i don't know about :)

Basically, i get emails from hotmail and yahoo that keep me informed that on of their users complained about a newsletter i sent them. Every email contains an RFC822 attachment with the initial mail.
As for now, i open them manually, copy paste the mail to a file and then unsubscribe them from my mailing list.

In the ideal way, i'd like to put all these mails in a folder in .msg format, and then use a tool that would extract all recipient adresses, with the possibilty to ignore some of them.
Basically it would look like

c:>magic_tool.exe --scanfolder=c:\mycomplaintmails*.msg --recipients-list=c:\email_list.exe --ignore=[email protected],[email protected]

I would use this tool myself and i guess some people at phplist would like to use that too. I'm writing some howtos for phplist right now, and the only tool i found so far that can to this has a fancy interface which i can't include in a script.

Regards,
Ozy.

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

What I can make for you is a simple commandline tool that you can use like this.

ExtractRecipients.exe "c:\somefolder" "c:\someoutputfile.txt"

And then extract all the recipient addresses that are in the *.msg or *.eml files that are in the folder.

from msgreader.

deajan avatar deajan commented on May 30, 2024

That would be absolutely great.
As for the exclude part, i can handle this with a simple batch script too :)

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

You are sure you need the recipient and not the from address? Normally the recipient is the person that receives the E-mail.

And what do you need to exclude?

from msgreader.

deajan avatar deajan commented on May 30, 2024

The recipient it is. But it's the recipient from the .msg attachment in the .msg file, sorry if i wasn't clear about this in the first place, because i begun working with the initial project you forked, which is able to dive into the attachment. The initial bug i encountered was that underscore emails didn't make it into the list.
I need to exclude arbitrary email addresses from the recipient's lists (like mine when i do some tests), in order to not blacklist myself automatically. But don't bother with the exclude stuff, i can handle this with a simple script.

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

So... extract the msg attachment first and then read the recipient from that attachment?

from msgreader.

deajan avatar deajan commented on May 30, 2024

Yes :)

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

Ok I'll make something quick and dirty... give me an hour or so

from msgreader.

deajan avatar deajan commented on May 30, 2024

Wow :) Now that's a fast dev. Mail me your paypal so i can buy you at least some coffee for the time spent.

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

Just a question... looking to you name? Are you dutch?

from msgreader.

deajan avatar deajan commented on May 30, 2024

My familiy is, so is my passport. But i grew up in Germany and now live in France.

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

Ok.. the reason why I asked because I'm dutch :-)

from msgreader.

deajan avatar deajan commented on May 30, 2024

Guessed so, i saw your your name on Code Project :)

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

I added an utilities folder to the solution. In there you will find a console application that is called EmailExtractor. This program should do what you need.

from msgreader.

deajan avatar deajan commented on May 30, 2024

Got the mail.

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

I also added comment to the code to give you an idea how you can get everything out of an msg file.

from msgreader.

deajan avatar deajan commented on May 30, 2024

Great ! Would you mind building and sending me an exe ?
As i tried to compile your project in the first place, i had a lot of dependancies issues with nuget.
My email address shall appear on the paypal receipt in some minutes.

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

The E-mail is on its way

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

If you want to fiddle around with the source and avoid the nuget dependencies than just browse to the Utilities\EmailExtractor folder and open the "EmailExtractor.csproj" file. You then should only have the emailextractor project and nothing else.

Let me know if the program does what you need.

from msgreader.

deajan avatar deajan commented on May 30, 2024

Got to test it, but output file does stays empty.
Here's my test output from the program

Found '5' files to process
Checking file 'C:\Users\user\Desktop\FC\test\complaint about message from xxxxxxxxxxxx.msg'
Found '1' attachments
Found msg file 'subject'
Recipient ''
Checking file 'C:\Users\user\Desktop\FC\test\complaint about message from xxxxxxxxxxxx.msg'
Found '1' attachments
Found msg file 'subject'
Recipient ''
Checking file 'C:\Users\user\Desktop\FC\test\complaint about message from xxxxxxxxxxxx.msg'
Found '1' attachments
Found msg file 'subject'
Recipient ''
Checking file 'C:\Users\user\Desktop\FC\test\subject.msg'
Found '2' attachments
Found msg file subject'
Recipient ''
Checking file 'C:\Users\user\Desktop\FC\test\subject.msg'
Found '0' attachments

Shall i send you one of the mails so you can see what happens ?

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

Yes please.. that should make it easier for me to debug

from msgreader.

deajan avatar deajan commented on May 30, 2024

Email sent.

from msgreader.

deajan avatar deajan commented on May 30, 2024

Tried to open the csproj from utilities. Get "Tools version "12" is unrecognized"
I guess i have to get VisualStudio Express ? What IDE are you working with ?

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

I'm using Visual Studio 2013 Ultimate. But you should be able to open the file with Visual Studio Express.

I fixed the issue. The E-mail adress is in the displayname field. Normally it should not be there. But it happens like in your situation. So I first check the Email field and if that is empty use the displayname field.

from msgreader.

deajan avatar deajan commented on May 30, 2024

Works as expected now, really thanks !
I'll fork this and add one or two basic functionnalities i'll need (for some emails that don't contain attachments, i need to extract thee sender and not the recipient's address in that case).

Anyway, another thank you is minimum that i should say.
You simply make me gain 1 hour per week with this little gem.
And i guess the community at phplist will find this usefull too.

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

Hi,

Good to hear that it works as expected.

Greetings and have a nice weekend,
Kees

from msgreader.

deajan avatar deajan commented on May 30, 2024

Just for info, i was able to compile this with SharpDevlop after installing MS build tools 2013.
Thanks again.

from msgreader.

Sicos1977 avatar Sicos1977 commented on May 30, 2024

I don't know if you need it but I added some mailing list properties to the msgreader:

  • MailingListHelp
  • MailingListSubscribe
  • MailingListUnsubscribe

With these properties you can retrieve mailing list information like so:

if (!string.IsNullOrWhiteSpace(msg.MailingListSubscripe))
Console.WriteLine("Mailing list subscribe page: '" + msg.MailingListSubscripe + "'");

You then for example can use it to see from which mailing list a message is returned.

from msgreader.

deajan avatar deajan commented on May 30, 2024

Great :) This could actually help me removing a user from a specific mailing list instead of blacklist em on all. Thanks alot.

from msgreader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.