I have MS Exchange account as my primary mail account in my default mail profile. I need to get its mail address programmatically in some VBScript.
I've got Outlook installed, so I can do it like this:
MsgBox CreateObject("Outlook.Application").GetNamespace("MAPI").CurrentUser.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x39FE001E")
But only when Outlook is running, also I've got security prompts in Outlook, so I can't use this approach.
I've found that a bunch of information about profiles and accounts is stored in registry under HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Profiles\
I've found Email value for POP3 and IMAP accounts in subkeys of 9375CFF0413111d3B88A00104B2A6676 in default profile, but none of that for Exchange account.
Where can find a value for Exchange account mail address of current user in registry?
enter link description hereThe name of your default profile is stored in
HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\DefaultProfile
Use Redemption (RDO) in stead of the standard Microsoft tools
(CDO), you'l have better tools and no security prompts.
RDOSession.Logon method, which takes several parameters, including the
MAPI profile name (pass an empty string to use the default MAPI
profile)
set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Inbox = Session.GetDefaultFolder(olFolderInbox)
for each Msg in Inbox.Items
Debug.Print(Msg.Subject)
next
Another option is to use ADSI and do an LDAP query.
See this answer.
Also see this.
Set MyUser = GetObject ("LDAP://CN=Administrator,CN=Users,DC=sunnydale,DC=muni")
For each email in MyUser.proxyAddresses
WScript.Echo email
Next
I didn't like the idea of using Redemption for that case. Its not free and requires additional movements to use. Anyway, I found an answer to my original question.
To get user primary SMTP address of the Outlook Exchage account on the end-user computer you need to search registry down the key of default mail profile (HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Profiles\<default profile name> or HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\<default profile name> for older versions of Outlook) for the value named 001f6641. This value data has binary format and contains mail address in the form like this SMPT:john#example.com, just cut the SMTP: part out an you get mail address.
The bad part that you can't make it with Outlook 2003. For that case you can search registry the same way for the value named 001e660b that contains legacyExchangeDN. Then you make an LDAP query (probably to Exchange AD by default) to find person with that legacyExchangeDN. What you need is proxyAddresses field. It has multiple values and that one that starts with SMTP: (uppercase is important), contains primary SMTP address.
Related
I'm currently testing some complicated functionality in a web app that involves multiple accounts within the app; each with its own unique email address. I have a few temp gmail accounts that I'm using for this purpose, but keep having to update email addresses in the database to something else for some accounts in order to reuse email addresses. It gets meesy very quickly.
My question is; is there a way I can setup an email server on my VPS (Ubuntu 16.04) that is able to accept all email addresses on a given domain without me having to define each one in advance? Ie; I'd like to be able to make up email addresses as I go; test1#mydomain.com, test2#mydomain.com, etc, and have the server receive AND store any incoming emails to those addresses. Emails include account verifications, notifications, etc, and I need to know what is being sent to each participant at each point in each workflow as I test.
Ideally I'd like some way to view all of these emails on the domain regardless of address. Perhaps setting up an alias using some kind of wildcard so that all incoming email go to a single address that I can configure in my email client on my dev machine.
Consider rewriting envelope recipient x#subdomain.example.net to handler+x#example.net
AFAIR sendmail, postfix and exim support such rewrites. AFAIR all three support passing +detail as parameter to procmail script (to ~handler/.procmailrc as $1).
WARNING: test handling message to multiple special recipients.
Post which specific SMTP/MTA server do you use if you want more hints.
Gmail also supports plussed addresses BUT you get reliable hint about original recipient only for message to single special/plussed recipient.
After a lot of research and messing about with different configurations, I found the best solution for me was PostFix with Dovecot.
I was able to set up virtual mailboxes in PostFix with virtual_mailbox_maps pointing to a file that contained this; #mydomain.com mydomain.com/catchall/
This allows mail to any email address within the domain to go to one mailbox. The mydomain.com/catchall/ is a location on the server where the mailbox is located. By convention, the domain is used in the path. Useful if you are hosting email on multiple domains. Dovecot supports variables in the config which allows you to point it to the correct mailbox.
I also found that the PostFix main.cf file must have mydestination = localhost for this configuration to work.
the following posts helped me getting this up and running;
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-postfix-e-mail-server-with-dovecot
https://www.digitalocean.com/community/tutorials/how-to-install-and-setup-postfix-on-ubuntu-14-04
I have just implemented wso2is 5.3 and I am looking at setting up the password and username recovery options.
Wso2is is set up with our Active Directory domain as the primary user store. In AD, the 'mail' attribute holds the user's primary email address, and 'otherMailbox' contains additional, external email addresses for the user.
I would like to use the email recovery, but we can't use the primary email, since the password for that account is the password they are trying to reset. We need to have the recovery process use one of the addresses in 'otherMail'.
I can't find anywhere in the documentation where you can define any option for what email is used for the recovery process.
Is the primary email the only one supported for password recovery? How can I tell the password and username recovery process to use a different email?
Thanks
Don
The answer, it turns out, is to change the claim mapping for the email address claim in WSO2 to point to the otherMailbox attribute in AD. It properly deals with the multi-valued email address list and for the purposes of password recovery, it sends the notification to all of the listed email addresses.
We then created another claim called Campus Email and pointed it at the mail attribute in AD.
There doesn't seem to be any negative issue with having 'our' email not be the 'primary' email.
Don
I have a Script that enabled Lync users from a CSV and puts the SIP address and users name into a text. Now i am using their Exchange email address as the SIP, problem is some users have a primary address from outside the company that Lync cant use, but they do have a company email as their secondary, what i am trying to do is set a command that checks the email addresses for a user and can select the appropriate company email address if there is a different primary. Maybe what i am trying to do is than what Lync can do or maybe i am going about this wrong. Any insight would be awesome.
I have a question about sending a mail with mozilla thunderbird. I have several email-addresses and i want thunderbird to choose a certain account when i send an email to a certain recipient.
For example I have two accounts: mail#myaddress.com and mail#anotheraddress.com
If I send an email thunderbird uses per default mail#myaddress.com. So far so good. Sometimes I have to send an email to companies, where I have to use mail#anotheraddress.com as sender address. If I forget to switch the account theses companies get mails from the wrong mail address. Is there a way to connect a recipient emailaddress to an certain account?
You can compose email using command line:
"preselectid" : an identifier for the "From" identity to choose from the menu*
note that you cannot directly specify an e-mail address but need to find the identity key
for example, "preselectid=id2" would select the identity #2
Reference:http://kb.mozillazine.org/Command_line_arguments_%28Thunderbird%29
I am specifying "FROM" address usinf setFrom() method, But i still receive mails having "FROM" address of SMTP authentication mail id. and want to set the "FROM" address dynamically. which keeps changing. What is the RFC282 standard to achieve this.
The solution from google is this
Gmail lets you send messages with another of your email addresses listed as the sender instead of your Gmail address. This feature helps you manage multiple accounts from the Gmail interface; it works only if you already own the email account linked to the alternate address
Select the Accounts and Import tab (or Accounts tab, if you're using Google Apps).
Under Send mail as, click Add another email address.
In the 'Email address' field, enter your name and alternate email address.
Choose one of two options:
Use Gmail's servers to send your mail (this is easier to set up)
Use your other email provider's SMTP servers (we recommend this option for professional mail accounts or domains). Note for Google Apps users: Depending on your domain2 type, this feature may be disabled by default. Talk to your administrator if you have any questions.
If you choose to use Gmail's servers:
Click Next Step >> and then click Send Verification. Gmail will send a verification message to your other email address to confirm that you own it.
Open your other account and either click the link in the message Gmail sent or enter the confirmation code in the Accounts section of your Gmail settings.
For more info, follow the below link
https://support.google.com/mail/bin/answer.py?hl=en&answer=22370.
The overhead involved is that any new from address needs a alias to be set in Gamil authentication mail account. Its not suits for enterprise salable app.
Other solution is You can install a mail server (hmailServer). This server allows you to set the custom from address
If any body knows other solutions, please suggest me.
It's up to your mail server. Often mail servers will prevent you from using any From address other than your actual login name. This helps prevent spam. Depending on your mail server, there may be ways to convince it that you should be allowed to use other From addresses.
These are two different things that you are talking about:
The id that you are mentioning is part of smtp handshaking protocol which usually is mapped to "Return-path" field in mime-header.
Whereas the id that comes in "FROM" field which actually is displayed in mail-list is been appended by the mail server when u compose the mail.
So if you can modify the mime header then make sure that "FROM:" field contains the id that yuou want to set not the smtp authentication id.
btw its rfc822
Have worked for rediffmail technical team in order to develop and enhance smtp, pop and imap protocols
Its depends on your mail server and configuration setting