Results 1 to 10 of 10
  1. #1
    Star Lounger MarkAtHome's Avatar
    Join Date
    Feb 2001
    Location
    New Jersey, USA
    Posts
    85
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Get sender e-mail addresses from Outlook folder?

    Hi – does anyone know how to retrieve a list of sender’s addresses from an Outlook folder and write them to a file?

    My current, main email address has been in use since around 1993, so I get a bit of spam. I have the spam program turned off on my email server, so that I can test spam filters used by Outlook.

    If I can get the email addresses from my spam/quarantined/whatever_it_might_be_called folder, without going to each email, one at a time, I can then get them into a rule that permanently deletes the emails when they arrive. I would probably want to do this on a regularly basis…

    Thanks!

  2. #2
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,593
    Thanks
    5
    Thanked 1,059 Times in 928 Posts
    Why not use Outlook's Autoarchive? You can set the parameters to delete messages after a certain time period on the spam folder. Then set Autoarchive to run every day.

    Joe

  3. #3
    Star Lounger MarkAtHome's Avatar
    Join Date
    Feb 2001
    Location
    New Jersey, USA
    Posts
    85
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by JoeP517 View Post
    Why not use Outlook's Autoarchive? You can set the parameters to delete messages after a certain time period on the spam folder. Then set Autoarchive to run every day.
    Hi Joe -- I am not sure you understood what I was asking, but thanks for the thought! :-)

  4. #4
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,593
    Thanks
    5
    Thanked 1,059 Times in 928 Posts
    Perhaps I did not. I thought you are looking for a method to automatically permanently delete spam emails. If the spam filter catches the email and moves it to the spam folder you can use Autoarchive to permanently delete the items in the spam folder on a schedule you set. There is much easier than trying to harvest sender addresses, create rules and then have to maintain them. If a spam email happens to get past the filter into your inbox you can easily add the sender to the blocked address list by using the "junk" entry in the context menu for the email.

    Joe

  5. #5
    Star Lounger MarkAtHome's Avatar
    Join Date
    Feb 2001
    Location
    New Jersey, USA
    Posts
    85
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by JoeP517 View Post
    Perhaps I did not. I thought you are looking for a method to automatically permanently delete spam emails. If the spam filter catches the email and moves it to the spam folder you can use Autoarchive to permanently delete the items in the spam folder on a schedule you set. There is much easier than trying to harvest sender addresses, create rules and then have to maintain them. If a spam email happens to get past the filter into your inbox you can easily add the sender to the blocked address list by using the "junk" entry in the context menu for the email.
    Hi Joe -- That is not something I want automated.

    I need only to delete emails from specific addresses or domains. I regularly discover emails marked as spams that are not, so I am doing that manually.

    As the addresses and/or subjects are added to my rules, there will be less and less spam if I keep it up.

    My request is very specific and if you can help in providing that specific solution, thanks.

  6. #6
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,593
    Thanks
    5
    Thanked 1,059 Times in 928 Posts
    I have my junk folder set to permanently delete junk mail that is older than 3 days. Normally I review the junk folder several times each day. However, in case I get really busy and forget that gives me plenty of time to review the junk folder for good email. I have Autoarchive set to run every day. The deletion and autoarchive run times are easily configured. That works for me.

    I realize your request is very specific. Unless you never get messages from new senders I think you'll find that rules maintenance will become very tedious. Besides spammers change the "from" address & domain frequently to get around rules and make detection more difficult. That is trivial to do programatically. Plus, there is a limit in Outlook as to the size of the rules. It used to be 32KB. I'm not sure what it is in newer versions of Outlook. What Outlook versions do you run?

    If you insist on going ahead with rules creation you can try a program such as Shark email extractor.

    Joe

  7. #7
    Star Lounger MarkAtHome's Avatar
    Join Date
    Feb 2001
    Location
    New Jersey, USA
    Posts
    85
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by JoeP517 View Post
    I have my junk folder set to permanently delete junk mail that is older than 3 days. Normally I review the junk folder several times each day. However, in case I get really busy and forget that gives me plenty of time to review the junk folder for good email. I have Autoarchive set to run every day. The deletion and autoarchive run times are easily configured. That works for me.

    I realize your request is very specific. Unless you never get messages from new senders I think you'll find that rules maintenance will become very tedious. Besides spammers change the "from" address & domain frequently to get around rules and make detection more difficult. That is trivial to do programatically. Plus, there is a limit in Outlook as to the size of the rules. It used to be 32KB. I'm not sure what it is in newer versions of Outlook. What Outlook versions do you run?

    If you insist on going ahead with rules creation you can try a program such as Shark email extractor.

    Joe
    Hi Joe -- I am using Outlook 2010 x86 under Windows 7 Ultimate SP1 x64.

    I appreciate your suggestions, and will let you know how I make out.

    Thanks.

  8. #8
    2 Star Lounger
    Join Date
    Dec 2009
    Location
    Surrey, UK
    Posts
    163
    Thanks
    7
    Thanked 40 Times in 35 Posts
    Are you up to writing some code? The following works in Outlook 2000 (I know, its old). I have never written any code for Outlook 2010, so it may all be completely changed.
    ================
    Sub getads()
    'sub by MNG 28/4/11: extract sender email addresses for all mail in current folder
    'works in Outlook 2000, need to set certain references
    Dim myreply As MailItem, m As MailItem, seln As MAPIFolder, i As Integer
    Dim MAPIm As MAPI.Message
    Dim strEntryID As String, strStoreID As String, s As String
    Static objSession As MAPI.Session, loggedin As Boolean 'remember these between calls

    'MAPI stuff:

    If Not loggedin Then 'if this is first time since Outlook opened
    Set objSession = CreateObject("MAPI.Session") ' start CDO session
    objSession.Logon , , False, False ' logon, whatever that means ???
    loggedin = True ' set flag
    End If
    Set seln = Application.ActiveExplorer.CurrentFolder 'get current folder
    Open "d:\address.txt" For Output As #1
    For i = 1 To seln.Items.Count 'for each item (msg) in folder
    Set m = seln.Items(i) ' get the message
    strEntryID = m.EntryID ' get EntryID and StoreID for message
    strStoreID = m.Parent.StoreID
    Set MAPIm = objSession.GetMessage(strEntryID, strStoreID) 'set MAPI message
    s = MAPIm.Sender.Address ' get senders name
    Print #1, s ' add to TO list
    Next 'next item
    Close
    End Sub
    ================


    (spaces seem to get swallowed). Its tiny, but there's a lot going on there (I don't know how you get into the macro editor, assuming there is one; the MAPI stuff is tricky, and almost certainly unnecessary with 2011 vn, Outlook 2003 understands 'm.SenderEmailAddress' but 2000 does not).

    Of course, the spam will probably hde the actual sending address, but I suppose you are happy blocking all from whatever address it claims to have?
    Last edited by mngerhold; 2011-04-28 at 16:39.

  9. #9
    Star Lounger MarkAtHome's Avatar
    Join Date
    Feb 2001
    Location
    New Jersey, USA
    Posts
    85
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mngerhold View Post
    Are you up to writing some code? The following works in Outlook 2000 (I know, its old). I have never written any code for Outlook 2010, so it may all be completely changed.
    ================
    Sub getads()
    'sub by MNG 28/4/11: extract sender email addresses for all mail in current folder
    'works in Outlook 2000, need to set certain references
    Dim myreply As MailItem, m As MailItem, seln As MAPIFolder, i As Integer
    Dim MAPIm As MAPI.Message
    Dim strEntryID As String, strStoreID As String, s As String
    Static objSession As MAPI.Session, loggedin As Boolean 'remember these between calls

    'MAPI stuff:
    If Not loggedin Then 'if this is first time since Outlook opened
    Set objSession = CreateObject("MAPI.Session") ' start CDO session
    objSession.Logon , , False, False ' logon, whatever that means ???
    loggedin = True ' set flag
    End If
    Set seln = Application.ActiveExplorer.CurrentFolder 'get current folder
    Open "d:\address.txt" For Output As #1
    For i = 1 To seln.Items.Count 'for each item (msg) in folder
    Set m = seln.Items(i) ' get the message
    strEntryID = m.EntryID ' get EntryID and StoreID for message
    strStoreID = m.Parent.StoreID
    Set MAPIm = objSession.GetMessage(strEntryID, strStoreID) 'set MAPI message
    s = MAPIm.Sender.Address ' get senders name
    Print #1, s ' add to TO list
    Next 'next item
    Close
    End Sub
    ================

    (spaces seem to get swallowed). Its tiny, but there's a lot going on there (I don't know how you get into the macro editor, assuming there is one; the MAPI stuff is tricky, and almost certainly unnecessary with 2011 vn, Outlook 2003 understands 'm.SenderEmailAddress' but 2000 does not).

    Of course, the spam will probably hde the actual sending address, but I suppose you are happy blocking all from whatever address it claims to have?
    Looks great. Thanks, mngerhold. I'll have my other chronologically challenged friend take a look at it for me...

  10. #10
    Lounger Splash's Avatar
    Join Date
    Aug 2002
    Location
    Sth Coast, New South Wales, Australia
    Posts
    47
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by JoeP517 View Post
    Unless you never get messages from new senders I think you'll find that rules maintenance will become very tedious. Besides spammers change the "from" address & domain frequently to get around rules and make detection more difficult.
    Joe is spot on. You will almost never get a 2nd spam from the same address. You may get annoying emails from genuine senders (who may not offer a way to unsubscribe) repeatedly but what most of us think of as phishing or spam emails are very cunning and won't be repeated. You mention blocking domains too but that is also problematic as getting a spam from a certain domain e.g. hotmail yahoo gmail might ban ALL emails from those domains including legit ones

    I suggest you try a junk email blocker for Outlook. Can't recommend one as I converted to Gmail years ago and it's spam filtering is scary accurate. I use the web interface but gmail can be used in conjunction with Outlook on your desktop either in POP3 (download to PC) or IMAP ('live' in the cloud) formats. Gmail can also go out to other existing address you have, collect the email from those accounts and put into your gmail account skimming out the spam on the way. It is amazing what it does for free
    NOBLEJOKER
    Sth Coast NSW Australia
    My Tech Help Site www.techhelpsite.com
    My Computer Club www.mulligrubs.miltonulladulla.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •