Export AD username based on e-mail address

Hello,
I'm very new to powershell. I'm looking for a script that can export sAMAccountName based on what the users e-mail address is.
I have a *.csv file with 180 e-mailaddresses and I want powershell to ask Active Directory what the corresponding sAMAccountName is for each of these e-mail adresses. The e-mail address is present in the 'mail' attribute in Active Directory. 
Then I want to export the sAMAccountName's to another *.csv file
How would that script look like?

Hi,
This will do what you're after:
Import-Csv .\emailAddresses.csv | ForEach {
Get-ADUser -Filter "EmailAddress -eq '$($_.EmailAddress)'" | Select SamAccountName
Note that you'll need the Active Directory module available to run this.
EDIT: If you're happy with the output, you can pipe the results to CSV using this:
Import-Csv .\emailAddresses.csv | ForEach {
Get-ADUser -Filter "EmailAddress -eq '$($_.EmailAddress)'" | Select SamAccountName
} | Export-Csv .\userNames.csv -NoTypeInformation
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing)

Similar Messages

  • Apple support Communities don't let me pick a username due of e-mail address

    Hello, i have this account that i am planning to disable it. i don't want more to use it because all of my purchases it was on another account. So i tried to login in community and pick a username to joy but an error message appears that said e-mail address is already used to Apple Support Community. So i am absolutely sure that i never used the specific e-mail adress. For some reason i think it's blocked and i would like to aske thw help of some moderator to assist me. I want to pick a username with another apple id (e-mail adress) and doesn't allow me. why?

    I have the same problem. Things worked fine for a while. I was able to see the body of the email plus the attachment. Even was able to open PDFs in iBooks. Now I only see the "Preview". I clock the particular email and I get a blank page with a header... plus no ability to see the attachment. This needs to be addressed in an update.
    How did you reset your phone? Did you lose any content in the process?
    Thanks

  • Can I Delete my Current Apple ID Account then Re-Create/Re-Register a New Version of It but Use the Same Apple Username & iCloud E-Mail Address I Had Before?

    I already had an Apple ID before registering for iCloud e-mail.
    This means that my Primary Apple ID is my @gmail.com e-mail address (the one I originally registered my Apple ID with), however I'd prefer that my Primary Apple ID were my new @iCloud.com e-mail address.
    Yet, I already know that it is simply not possible to make my new @iCloud.com e-mail address my Primary Apple ID in any easy/simple sort of manner.
    My understanding is, the only possible way I could use an @iCloud e-mail address as my Primary Apple ID now is to make a brand new Apple ID account. However, I want to keep/continue using my current @iCloud e-mail address and my Apple username (JRCSaunders) -- I don't want to have to choose a new @iCloud e-mail address or Apple username.
    So basically what I'm wondering is if there is any possibility that I might be able to completely delete/erase my current Apple ID and then re-create a new Apple ID using my current/existing @iCloud.com e-mail addressas my Primary Apple ID and re-using the same Apple username I have now (JRCSaunders)?
    I'm just trying to think of a work-around so that I can make my current/existing @iCloud e-mail address my Primary Apple ID, which does not seem possible without having to create an all-new Apple ID account. But I don't want to create a new account if it means having to change any of my current addresses/names/etc. to new/different ones. So, is what I described (deleting then re-creating using the same names/addresses/info) possible?
    Thanks!

    Oops, I realized I posted this question in the iPhone section by mistake.  Is it possible to delete this message and re-post it over in the iPod Touch section?
    My apologies for this mistake.  Jd

  • HT1918 How do i change my username to another when they both have accts with itunes one is on my computer and one is on my ipad? Two different e-mail address that are both mine....so how do i make one acct for both?

    How do i change my username to another when they both have accts with itunes one is on my computer and one is on my ipad? Two different e-mail address that are both mine....so how do i make one acct for both?

    If you selected open a new Apple ID account, go back a step and enter use existing Apple ID.
    You will have to set up a separate iCloud account or your iPads will mirror each other.

  • Exporting e-mail addresses as text file

    Hi, I've done a forum search, found lots of posts but none 'solved'.
    I want to export all the e-mail addresses from Address Book as a simple .txt file

    There may be a more direct way, but one thing you can do...
    1.[Optional] Create a Smart Group with criteria - [Email] [is Set]
    2. Go to Print - set Style to List and uncheck everything except email
    3. From the Print dialog, Save As PDF
    4. Open the PDF and select/copy all the text
    5. Open TextEdit and Paste
    6. Use a Find&Replace, if desired, to remove or separate the email identifier (work, home, etc)
    If, by chance, you want just the email addresses -not the associated names- you can go through Mail instead.
    1. Drag the Group to the To: of a new message
    2. Ctrl-click the Group name and Expand Group
    3. Select them with the mouse
    4. Copy
    5. Paste into TextEdit

  • Just created a Firefox support account using my e-mail address as the username. Did not know that this would show up when I asked questions. Can I change my username? If not can I delete my account and start again.

    Basically, without thinking, I used my e-mail address as my username, and I don't want to get spammed because of my thoughtlessness. Anyway, I'd like to change my username. I picked a display name "TonyG" and thought only that would display, but both my username and my display name show when I post. If I cannot change my username, I would like to start over by deleting this account and starting a new account. Any advice out there? Many thanks, in advance.

    Since you have used your old Display name, it'll always show your email address in the forum for this question. When you post another question in the future, it should show your Display name instead.
    As I said, User Name is to be used to log into your forum account, the Display Name is what it'll be shown when you post in this forum. You can try to post a test in the forum to see if your Display Name is being shown or not.

  • Export Mail Address to GroupWise

    Hello,
    I have a customer at Santa Clara University who wants to change from a Mac to a PC go figure! He is currently using Apple Mail and wants to export his e-mail addresses to GroupWise (Novell) on the PC. Can you tell me what he would need to do in order to export his addresses? I know GroupWise is a proprietary e-mail application, but what about maybe into Entourage or Outlook? Is there even a script the customer can run?
    Can someone let me know.
    Thank you
    Phil

    I updated the script. It now creates a text file on your Desktop. Simple open "Apple Script Editor", cut & paste this into the text area and hit the Run button.
    set the_file to ((path to desktop as text) & "test.txt")
    set crlf to (ASCII character 13) & (ASCII character 10)
    try
    set dataStream to open for access file the_file with write permission
    set eof of dataStream to 0
    tell application "Address Book"
    repeat with aPerson in people
    log ("Person : " & name of aPerson)
    repeat with anEmail in emails of aPerson
    log ("eMail : " & value of anEmail)
    write ("<"" & crlf) to dataStream as text
    end repeat
    end repeat
    end tell
    close access file the_file
    on error
    try
    log ("Error")
    close access file the_file
    end try
    end try

  • I'm trying to activate icloud.  It asks me to verify my e-mail address by entering my username and password.  It keeps refusing to accept my password.  I've have changed the password twice now.  Still the same result.  What do I do?

    I'm trying to activate icloud.  It asks me to verify my e-mail address by entering my username and password.  It keeps refusing to accept my password.  I've have changed the password twice now.  Still the same result. It did however accepted my password to join Apple Support Communites just now. What do I do?

      I had the same promblem using my ipad2, I thought i was going crazy, then I noticed once when I put my user name in and checked it was right, one time it dropped the last letter of my U/N as went to hit submit so i went back put the deleted "m" back into ".com", hit enter, put in my password multiple times, tripple checked, no joy. So I hit remote on my iphone4s did the same UN/PW and it worked first time! I had the same promblem with accessing YouTube - I know I was putting the right UN/PW in but it wouldn't let me in, then miraculously one time it did... could be a letter dropping bug...

  • I am not able to send my slideshow from iphoto because I entered the wrong username (e-mail address) by accident.  I cant see how to edit it. Can anyone help me?

    I am not able to send my slide show from iPhoto because I entered the wrong user name (e-mail address) by accident and I dont see how to edit it.  Can anyone help me out?

    Try here:
    iTunes Store: My credit card's security code or zip code does not match my bank's records
    Then try contacting iTunes
    Apple - Support - iTunes - Contact Us

  • Searching BPs based on Mail address.

    Hi all,
    I want to search BPs based on the Email address.Kindly suggest me how to solve the issue.
    Regards,
    V.Sekhar.

    Hi Bruno,
    I am also facing the same problem. when in FM BAPI_BUPA_SEARCH, i pass email add. it does not get the bp but, if i pass value other than email(e.g. fax no., telephone, etc.) it shows the BP.
    Also i want to know that i only have email ID and not other info than that. So how should i search for BP. Is there any FM for this?
    Please Help.
    Full Reward Points for helpful answers also.
    Regards,
    Vinayak

  • [SOLVED]Issue with Postfix sending to external mail addresses

    I'm having a very silly issue with Postfix. I followed the wiki article at [link]https://wiki.archlinux.org/index.php/Postfix[/link], and everything seems to work properly, however I cannot send to emails outside of my domain.
    I get the error:
    550 5.1.1 <[email protected]>: Recipient address rejected: Local delivery only!
    Here is what the logs say:
    May 08 16:05:12 my.dns.stuff.org postfix/smtpd[31464]: connect from localhost.localdomain[127.0.0.1]
    May 08 16:05:12 my.dns.stuff.org postfix/smtpd[31464]: 091E011E3C: client=localhost.localdomain[127.0.0.1]
    May 08 16:05:12 my.dns.stuff.org postfix/smtpd[31464]: 091E011E3C: reject: RCPT from localhost.localdomain[127.0.0.1]: 550 5.1.1 <[email protected]>: Recipient address rejected: Local delivery only!; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<sendingdomain.com>
    May 08 16:05:12 my.dns.stuff.org postfix/smtpd[31464]: lost connection after RCPT from localhost.localdomain[127.0.0.1]
    May 08 16:05:12 my.dns.stuff.org postfix/smtpd[31464]: disconnect from localhost.localdomain[127.0.0.1]
    May 08 16:05:14 my.dns.stuff.org sudo[31476]: me : TTY=pts/0 ; PWD=/etc/postfix ; USER=root ; COMMAND=/usr/bin/journalctl
    main.cf
    # Global Postfix configuration file. This file lists only a subset
    # of all parameters. For the syntax, and for a complete parameter
    # list, see the postconf(5) manual page (command: "man 5 postconf").
    # For common configuration examples, see BASIC_CONFIGURATION_README
    # and STANDARD_CONFIGURATION_README. To find these documents, use
    # the command "postconf html_directory readme_directory", or go to
    # http://www.postfix.org/BASIC_CONFIGURATION_README.html etc.
    # For best results, change no more than 2-3 parameters at a time,
    # and test if Postfix still works after every change.
    # SOFT BOUNCE
    # The soft_bounce parameter provides a limited safety net for
    # testing. When soft_bounce is enabled, mail will remain queued that
    # would otherwise bounce. This parameter disables locally-generated
    # bounces, and prevents the SMTP server from rejecting mail permanently
    # (by changing 5xx replies into 4xx replies). However, soft_bounce
    # is no cure for address rewriting mistakes or mail routing mistakes.
    #soft_bounce = no
    # LOCAL PATHNAME INFORMATION
    # The queue_directory specifies the location of the Postfix queue.
    # This is also the root directory of Postfix daemons that run chrooted.
    # See the files in examples/chroot-setup for setting up Postfix chroot
    # environments on different UNIX systems.
    queue_directory = /var/spool/postfix
    # The command_directory parameter specifies the location of all
    # postXXX commands.
    command_directory = /usr/bin
    # The daemon_directory parameter specifies the location of all Postfix
    # daemon programs (i.e. programs listed in the master.cf file). This
    # directory must be owned by root.
    daemon_directory = /usr/lib/postfix
    # The data_directory parameter specifies the location of Postfix-writable
    # data files (caches, random numbers). This directory must be owned
    # by the mail_owner account (see below).
    data_directory = /var/lib/postfix
    # QUEUE AND PROCESS OWNERSHIP
    # The mail_owner parameter specifies the owner of the Postfix queue
    # and of most Postfix daemon processes. Specify the name of a user
    # account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS
    # AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM. In
    # particular, don't specify nobody or daemon. PLEASE USE A DEDICATED
    # USER.
    mail_owner = postfix
    # The default_privs parameter specifies the default rights used by
    # the local delivery agent for delivery to external file or command.
    # These rights are used in the absence of a recipient user context.
    # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
    #default_privs = nobody
    # INTERNET HOST AND DOMAIN NAMES
    # The myhostname parameter specifies the internet hostname of this
    # mail system. The default is to use the fully-qualified domain name
    # from gethostname(). $myhostname is used as a default value for many
    # other configuration parameters.
    #myhostname = host.domain.tld
    myhostname = mail.sendingdomain.com
    # The mydomain parameter specifies the local internet domain name.
    # The default is to use $myhostname minus the first component.
    # $mydomain is used as a default value for many other configuration
    # parameters.
    mydomain = www.sendingdomain.com
    # SENDING MAIL
    # The myorigin parameter specifies the domain that locally-posted
    # mail appears to come from. The default is to append $myhostname,
    # which is fine for small sites. If you run a domain with multiple
    # machines, you should (1) change this to $mydomain and (2) set up
    # a domain-wide alias database that aliases each user to
    # [email protected].
    # For the sake of consistency between sender and recipient addresses,
    # myorigin also specifies the default domain name that is appended
    # to recipient addresses that have no @domain part.
    #myorigin = $myhostname
    myorigin = $mydomain
    append_dot_mydomain = no
    # RECEIVING MAIL
    # The inet_interfaces parameter specifies the network interface
    # addresses that this mail system receives mail on. By default,
    # the software claims all active interfaces on the machine. The
    # parameter also controls delivery of mail to user@[ip.address].
    # See also the proxy_interfaces parameter, for network addresses that
    # are forwarded to us via a proxy or network address translator.
    # Note: you need to stop/start Postfix when this parameter changes.
    inet_interfaces = all
    #inet_interfaces = loopback-only
    #inet_interfaces = $myhostname
    #inet_interfaces = $myhostname, localhost
    # The proxy_interfaces parameter specifies the network interface
    # addresses that this mail system receives mail on by way of a
    # proxy or network address translation unit. This setting extends
    # the address list specified with the inet_interfaces parameter.
    # You must specify your proxy/NAT addresses when your system is a
    # backup MX host for other domains, otherwise mail delivery loops
    # will happen when the primary MX host is down.
    #proxy_interfaces =
    #proxy_interfaces = 1.2.3.4
    # The mydestination parameter specifies the list of domains that this
    # machine considers itself the final destination for.
    # These domains are routed to the delivery agent specified with the
    # local_transport parameter setting. By default, that is the UNIX
    # compatible delivery agent that lookups all recipients in /etc/passwd
    # and /etc/aliases or their equivalent.
    # The default is $myhostname + localhost.$mydomain. On a mail domain
    # gateway, you should also include $mydomain.
    # Do not specify the names of virtual domains - those domains are
    # specified elsewhere (see VIRTUAL_README).
    # Do not specify the names of domains that this machine is backup MX
    # host for. Specify those names via the relay_domains settings for
    # the SMTP server, or use permit_mx_backup if you are lazy (see
    # STANDARD_CONFIGURATION_README).
    # The local machine is always the final destination for mail addressed
    # to user@[the.net.work.address] of an interface that the mail system
    # receives mail on (see the inet_interfaces parameter).
    # Specify a list of host or domain names, /file/name or type:table
    # patterns, separated by commas and/or whitespace. A /file/name
    # pattern is replaced by its contents; a type:table is matched when
    # a name matches a lookup key (the right-hand side is ignored).
    # Continue long lines by starting the next line with whitespace.
    # See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
    #mydestination = $myhostname, localhost.$mydomain, localhost
    #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    #mydestination = localhost
    # mail.$mydomain, www.$mydomain, ftp.$mydomain
    # REJECTING MAIL FOR UNKNOWN LOCAL USERS
    # The local_recipient_maps parameter specifies optional lookup tables
    # with all names or addresses of users that are local with respect
    # to $mydestination, $inet_interfaces or $proxy_interfaces.
    # If this parameter is defined, then the SMTP server will reject
    # mail for unknown local users. This parameter is defined by default.
    # To turn off local recipient checking in the SMTP server, specify
    # local_recipient_maps = (i.e. empty).
    # The default setting assumes that you use the default Postfix local
    # delivery agent for local delivery. You need to update the
    # local_recipient_maps setting if:
    # - You define $mydestination domain recipients in files other than
    # /etc/passwd, /etc/aliases, or the $virtual_alias_maps files.
    # For example, you define $mydestination domain recipients in
    # the $virtual_mailbox_maps files.
    # - You redefine the local delivery agent in master.cf.
    # - You redefine the "local_transport" setting in main.cf.
    # - You use the "luser_relay", "mailbox_transport", or "fallback_transport"
    # feature of the Postfix local delivery agent (see local(8)).
    # Details are described in the LOCAL_RECIPIENT_README file.
    # Beware: if the Postfix SMTP server runs chrooted, you probably have
    # to access the passwd file via the proxymap service, in order to
    # overcome chroot restrictions. The alternative, having a copy of
    # the system passwd file in the chroot jail is just not practical.
    # The right-hand side of the lookup tables is conveniently ignored.
    # In the left-hand side, specify a bare username, an @domain.tld
    # wild-card, or specify a [email protected] address.
    #local_recipient_maps = unix:passwd.byname $alias_maps
    local_recipient_maps = proxy:unix:passwd.byname $alias_maps
    #local_recipient_maps =
    # The unknown_local_recipient_reject_code specifies the SMTP server
    # response code when a recipient domain matches $mydestination or
    # ${proxy,inet}_interfaces, while $local_recipient_maps is non-empty
    # and the recipient address or address local-part is not found.
    # The default setting is 550 (reject mail) but it is safer to start
    # with 450 (try again later) until you are certain that your
    # local_recipient_maps settings are OK.
    unknown_local_recipient_reject_code = 550
    # TRUST AND RELAY CONTROL
    # The mynetworks parameter specifies the list of "trusted" SMTP
    # clients that have more privileges than "strangers".
    # In particular, "trusted" SMTP clients are allowed to relay mail
    # through Postfix. See the smtpd_recipient_restrictions parameter
    # in postconf(5).
    # You can specify the list of "trusted" network addresses by hand
    # or you can let Postfix do it for you (which is the default).
    # By default (mynetworks_style = subnet), Postfix "trusts" SMTP
    # clients in the same IP subnetworks as the local machine.
    # On Linux, this does works correctly only with interfaces specified
    # with the "ifconfig" command.
    # Specify "mynetworks_style = class" when Postfix should "trust" SMTP
    # clients in the same IP class A/B/C networks as the local machine.
    # Don't do this with a dialup site - it would cause Postfix to "trust"
    # your entire provider's network. Instead, specify an explicit
    # mynetworks list by hand, as described below.
    # Specify "mynetworks_style = host" when Postfix should "trust"
    # only the local machine.
    #mynetworks_style = class
    #mynetworks_style = subnet
    mynetworks_style = host
    # Alternatively, you can specify the mynetworks list by hand, in
    # which case Postfix ignores the mynetworks_style setting.
    # Specify an explicit list of network/netmask patterns, where the
    # mask specifies the number of bits in the network part of a host
    # address.
    # You can also specify the absolute pathname of a pattern file instead
    # of listing the patterns here. Specify type:table for table-based lookups
    # (the value on the table right-hand side is not used).
    #mynetworks = 168.100.189.0/28, 127.0.0.0/8
    #mynetworks = $config_directory/mynetworks
    #mynetworks = hash:/etc/postfix/network_table
    # The relay_domains parameter restricts what destinations this system will
    # relay mail to. See the smtpd_recipient_restrictions description in
    # postconf(5) for detailed information.
    # By default, Postfix relays mail
    # - from "trusted" clients (IP address matches $mynetworks) to any destination,
    # - from "untrusted" clients to destinations that match $relay_domains or
    # subdomains thereof, except addresses with sender-specified routing.
    # The default relay_domains value is $mydestination.
    # In addition to the above, the Postfix SMTP server by default accepts mail
    # that Postfix is final destination for:
    # - destinations that match $inet_interfaces or $proxy_interfaces,
    # - destinations that match $mydestination
    # - destinations that match $virtual_alias_domains,
    # - destinations that match $virtual_mailbox_domains.
    # These destinations do not need to be listed in $relay_domains.
    # Specify a list of hosts or domains, /file/name patterns or type:name
    # lookup tables, separated by commas and/or whitespace. Continue
    # long lines by starting the next line with whitespace. A file name
    # is replaced by its contents; a type:name table is matched when a
    # (parent) domain appears as lookup key.
    # NOTE: Postfix will not automatically forward mail for domains that
    # list this system as their primary or backup MX host. See the
    # permit_mx_backup restriction description in postconf(5).
    relay_domains = $mydestination
    # INTERNET OR INTRANET
    # The relayhost parameter specifies the default host to send mail to
    # when no entry is matched in the optional transport(5) table. When
    # no relayhost is given, mail is routed directly to the destination.
    # On an intranet, specify the organizational domain name. If your
    # internal DNS uses no MX records, specify the name of the intranet
    # gateway host instead.
    # In the case of SMTP, specify a domain, host, host:port, [host]:port,
    # [address] or [address]:port; the form [host] turns off MX lookups.
    # If you're connected via UUCP, see also the default_transport parameter.
    #relayhost = $mydomain
    #relayhost = [gateway.my.domain]
    #relayhost = [mailserver.isp.tld]
    #relayhost = uucphost
    #relayhost = [an.ip.add.ress]
    default_transport = error: Local delivery only!
    # REJECTING UNKNOWN RELAY USERS
    # The relay_recipient_maps parameter specifies optional lookup tables
    # with all addresses in the domains that match $relay_domains.
    # If this parameter is defined, then the SMTP server will reject
    # mail for unknown relay users. This feature is off by default.
    # The right-hand side of the lookup tables is conveniently ignored.
    # In the left-hand side, specify an @domain.tld wild-card, or specify
    # a [email protected] address.
    #relay_recipient_maps = hash:/etc/postfix/relay_recipients
    # INPUT RATE CONTROL
    # The in_flow_delay configuration parameter implements mail input
    # flow control. This feature is turned on by default, although it
    # still needs further development (it's disabled on SCO UNIX due
    # to an SCO bug).
    # A Postfix process will pause for $in_flow_delay seconds before
    # accepting a new message, when the message arrival rate exceeds the
    # message delivery rate. With the default 100 SMTP server process
    # limit, this limits the mail inflow to 100 messages a second more
    # than the number of messages delivered per second.
    # Specify 0 to disable the feature. Valid delays are 0..10.
    #in_flow_delay = 1s
    # ADDRESS REWRITING
    # The ADDRESS_REWRITING_README document gives information about
    # address masquerading or other forms of address rewriting including
    # username->Firstname.Lastname mapping.
    # ADDRESS REDIRECTION (VIRTUAL DOMAIN)
    # The VIRTUAL_README document gives information about the many forms
    # of domain hosting that Postfix supports.
    # "USER HAS MOVED" BOUNCE MESSAGES
    # See the discussion in the ADDRESS_REWRITING_README document.
    # TRANSPORT MAP
    # See the discussion in the ADDRESS_REWRITING_README document.
    # ALIAS DATABASE
    # The alias_maps parameter specifies the list of alias databases used
    # by the local delivery agent. The default list is system dependent.
    # On systems with NIS, the default is to search the local alias
    # database, then the NIS alias database. See aliases(5) for syntax
    # details.
    # If you change the alias database, run "postalias /etc/aliases" (or
    # wherever your system stores the mail alias file), or simply run
    # "newaliases" to build the necessary DBM or DB file.
    # It will take a minute or so before changes become visible. Use
    # "postfix reload" to eliminate the delay.
    #alias_maps = dbm:/etc/aliases
    #alias_maps = hash:/etc/aliases
    #alias_maps = hash:/etc/aliases, nis:mail.aliases
    #alias_maps = netinfo:/aliases
    alias_maps = hash:/etc/postfix/aliases
    # The alias_database parameter specifies the alias database(s) that
    # are built with "newaliases" or "sendmail -bi". This is a separate
    # configuration parameter, because alias_maps (see above) may specify
    # tables that are not necessarily all under control by Postfix.
    #alias_database = dbm:/etc/aliases
    #alias_database = dbm:/etc/mail/aliases
    #alias_database = hash:/etc/aliases
    #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
    alias_database = $alias_maps
    # ADDRESS EXTENSIONS (e.g., user+foo)
    # The recipient_delimiter parameter specifies the separator between
    # user names and address extensions (user+foo). See canonical(5),
    # local(8), relocated(5) and virtual(5) for the effects this has on
    # aliases, canonical, virtual, relocated and .forward file lookups.
    # Basically, the software tries user+foo and .forward+foo before
    # trying user and .forward.
    #recipient_delimiter = +
    # DELIVERY TO MAILBOX
    # The home_mailbox parameter specifies the optional pathname of a
    # mailbox file relative to a user's home directory. The default
    # mailbox file is /var/spool/mail/user or /var/mail/user. Specify
    # "Maildir/" for qmail-style delivery (the / is required).
    #home_mailbox = Mailbox
    home_mailbox = Maildir/
    # The mail_spool_directory parameter specifies the directory where
    # UNIX-style mailboxes are kept. The default setting depends on the
    # system type.
    #mail_spool_directory = /var/mail
    #mail_spool_directory = /var/spool/mail
    # The mailbox_command parameter specifies the optional external
    # command to use instead of mailbox delivery. The command is run as
    # the recipient with proper HOME, SHELL and LOGNAME environment settings.
    # Exception: delivery for root is done as $default_user.
    # Other environment variables of interest: USER (recipient username),
    # EXTENSION (address extension), DOMAIN (domain part of address),
    # and LOCAL (the address localpart).
    # Unlike other Postfix configuration parameters, the mailbox_command
    # parameter is not subjected to $parameter substitutions. This is to
    # make it easier to specify shell syntax (see example below).
    # Avoid shell meta characters because they will force Postfix to run
    # an expensive shell process. Procmail alone is expensive enough.
    # IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
    # ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
    #mailbox_command = /some/where/procmail
    #mailbox_command = /some/where/procmail -a "$EXTENSION"
    # The mailbox_transport specifies the optional transport in master.cf
    # to use after processing aliases and .forward files. This parameter
    # has precedence over the mailbox_command, fallback_transport and
    # luser_relay parameters.
    # Specify a string of the form transport:nexthop, where transport is
    # the name of a mail delivery transport defined in master.cf. The
    # :nexthop part is optional. For more details see the sample transport
    # configuration file.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must update the "local_recipient_maps" setting in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    # Cyrus IMAP over LMTP. Specify ``lmtpunix cmd="lmtpd"
    # listen="/var/imap/socket/lmtp" prefork=0'' in cyrus.conf.
    #mailbox_transport = lmtp:unix:/var/imap/socket/lmtp
    # Cyrus IMAP via command line. Uncomment the "cyrus...pipe" and
    # subsequent line in master.cf.
    #mailbox_transport = cyrus
    # The fallback_transport specifies the optional transport in master.cf
    # to use for recipients that are not found in the UNIX passwd database.
    # This parameter has precedence over the luser_relay parameter.
    # Specify a string of the form transport:nexthop, where transport is
    # the name of a mail delivery transport defined in master.cf. The
    # :nexthop part is optional. For more details see the sample transport
    # configuration file.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must update the "local_recipient_maps" setting in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    #fallback_transport = lmtp:unix:/file/name
    #fallback_transport = cyrus
    #fallback_transport =
    # The luser_relay parameter specifies an optional destination address
    # for unknown recipients. By default, mail for unknown@$mydestination,
    # unknown@[$inet_interfaces] or unknown@[$proxy_interfaces] is returned
    # as undeliverable.
    # The following expansions are done on luser_relay: $user (recipient
    # username), $shell (recipient shell), $home (recipient home directory),
    # $recipient (full recipient address), $extension (recipient address
    # extension), $domain (recipient domain), $local (entire recipient
    # localpart), $recipient_delimiter. Specify ${name?value} or
    # ${name:value} to expand value only when $name does (does not) exist.
    # luser_relay works only for the default Postfix local delivery agent.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must specify "local_recipient_maps =" (i.e. empty) in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    #luser_relay = [email protected]
    #luser_relay = [email protected]
    #luser_relay = admin+$local
    # JUNK MAIL CONTROLS
    # The controls listed here are only a very small subset. The file
    # SMTPD_ACCESS_README provides an overview.
    # The header_checks parameter specifies an optional table with patterns
    # that each logical message header is matched against, including
    # headers that span multiple physical lines.
    # By default, these patterns also apply to MIME headers and to the
    # headers of attached messages. With older Postfix versions, MIME and
    # attached message headers were treated as body text.
    # For details, see "man header_checks".
    #header_checks = regexp:/etc/postfix/header_checks
    # FAST ETRN SERVICE
    # Postfix maintains per-destination logfiles with information about
    # deferred mail, so that mail can be flushed quickly with the SMTP
    # "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld".
    # See the ETRN_README document for a detailed description.
    # The fast_flush_domains parameter controls what destinations are
    # eligible for this service. By default, they are all domains that
    # this server is willing to relay mail to.
    #fast_flush_domains = $relay_domains
    # SHOW SOFTWARE VERSION OR NOT
    # The smtpd_banner parameter specifies the text that follows the 220
    # code in the SMTP server's greeting banner. Some people like to see
    # the mail version advertised. By default, Postfix shows no version.
    # You MUST specify $myhostname at the start of the text. That is an
    # RFC requirement. Postfix itself does not care.
    #smtpd_banner = $myhostname ESMTP $mail_name
    #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
    # PARALLEL DELIVERY TO THE SAME DESTINATION
    # How many parallel deliveries to the same user or domain? With local
    # delivery, it does not make sense to do massively parallel delivery
    # to the same user, because mailbox updates must happen sequentially,
    # and expensive pipelines in .forward files can cause disasters when
    # too many are run at the same time. With SMTP deliveries, 10
    # simultaneous connections to the same domain could be sufficient to
    # raise eyebrows.
    # Each message delivery transport has its XXX_destination_concurrency_limit
    # parameter. The default is $default_destination_concurrency_limit for
    # most delivery transports. For the local delivery agent the default is 2.
    #local_destination_concurrency_limit = 2
    #default_destination_concurrency_limit = 20
    # DEBUGGING CONTROL
    # The debug_peer_level parameter specifies the increment in verbose
    # logging level when an SMTP client or server host name or address
    # matches a pattern in the debug_peer_list parameter.
    debug_peer_level = 2
    # The debug_peer_list parameter specifies an optional list of domain
    # or network patterns, /file/name patterns or type:name tables. When
    # an SMTP client or server host name or address matches a pattern,
    # increase the verbose logging level by the amount specified in the
    # debug_peer_level parameter.
    #debug_peer_list = 127.0.0.1
    #debug_peer_list = some.domain
    # The debugger_command specifies the external command that is executed
    # when a Postfix daemon program is run with the -D option.
    # Use "command .. & sleep 5" so that the debugger can attach before
    # the process marches on. If you use an X-based debugger, be sure to
    # set up your XAUTHORITY environment variable before starting Postfix.
    debugger_command =
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    ddd $daemon_directory/$process_name $process_id & sleep 5
    # If you can't use X, use this to capture the call stack when a
    # daemon crashes. The result is in a file in the configuration
    # directory, and is named after the process name and the process ID.
    # debugger_command =
    # PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont;
    # echo where) | gdb $daemon_directory/$process_name $process_id 2>&1
    # >$config_directory/$process_name.$process_id.log & sleep 5
    # Another possibility is to run gdb under a detached screen session.
    # To attach to the screen sesssion, su root and run "screen -r
    # <id_string>" where <id_string> uniquely matches one of the detached
    # sessions (from "screen -list").
    # debugger_command =
    # PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; screen
    # -dmS $process_name gdb $daemon_directory/$process_name
    # $process_id & sleep 1
    # INSTALL-TIME CONFIGURATION INFORMATION
    # The following parameters are used when installing a new Postfix version.
    # sendmail_path: The full pathname of the Postfix sendmail command.
    # This is the Sendmail-compatible mail posting interface.
    sendmail_path = /usr/bin/sendmail
    # newaliases_path: The full pathname of the Postfix newaliases command.
    # This is the Sendmail-compatible command to build alias databases.
    newaliases_path = /usr/bin/newaliases
    # mailq_path: The full pathname of the Postfix mailq command. This
    # is the Sendmail-compatible mail queue listing command.
    mailq_path = /usr/bin/mailq
    # setgid_group: The group for mail submission and queue management
    # commands. This must be a group name with a numerical group ID that
    # is not shared with other accounts, not even with the Postfix account.
    setgid_group = postdrop
    # html_directory: The location of the Postfix HTML documentation.
    html_directory = no
    # manpage_directory: The location of the Postfix on-line manual pages.
    manpage_directory = /usr/share/man
    # sample_directory: The location of the Postfix sample configuration files.
    # This parameter is obsolete as of Postfix 2.1.
    sample_directory = /etc/postfix/sample
    # readme_directory: The location of the Postfix README files.
    readme_directory = /usr/share/doc/postfix
    inet_protocols = ipv4
    #virtual_mailbox_domains = sendingdomain.com
    virtual_alias_maps = hash:/etc/postfix/virtual_alias, mysql:/etc/postfix/mysql_virtual_forwards.cf
    virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmailer
    virtual_uid_maps = static:5003
    virtual_gid_maps = static:5003
    virtual_minimum_uid = 5003
    virtual_mailbox_limit = 51200000
    Any help would be appreciated. Thank you.
    Last edited by nadman10 (2014-05-14 14:36:10)

    Your main.cf seems redundant.
    For example:
    if you specify:
    virtual_alias_maps = hash:/etc/postfix/virtual_alias, mysql:/etc/postfix/mysql_virtual_forwards.cf
    you don't need this:
    alias_maps = hash:/etc/postfix/aliases
    and i think you have a lot of more options you don't need.
    This is my main.cf on my vps and everything works great (sending and receiving emails from/to most common mail server: gmail, hotmail etc etc)
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    readme_directory = no
    # TLS parameters
    smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
    smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
    smtpd_use_tls=yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    message_size_limit = 4194304
    virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
    virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
    virtual_transport = dovecot
    dovecot_destination_recipient_limit = 1
    it is very simple (no dkim, no forced tls, no mailbox limits and so on) and it can be improved but it works..
    as I suggested you just try spending some hour wiping postfix installation and giving a look to this guide

  • ITunes username chg (new e-mail), can't play purchases under prev. username

    I recently had to change my account information to a new e-mail address which, of course, had the effect of changing my login username.
    The unexpected and disturbing side effect of this change is that now, purchases made using my previous username are no longer playable on my computer, iPod or other devices.
    This represents hundreds of dollars spent on the iTunes store for songs and apps that now can no longer be played!!!
    I need a path forward to resolving this ASAP.
    Pls help!

    Good luck with Apple customer service. Not only are they clueless but you have to explain everything to them as if you were speaking to a 5 year old just to get them to understand. I had a similar problem except my account was hacked and the hacker set up an additional account based in China. I also had fraudulent charges on my credit card (a card that was registered with my itunes account initially until I changed some of my info a year ago) the charges were NOT on my itunes account however. I'm guessing they are on the new China account. Apple has been no help at all. They admitted my account was "compromised" but won't fix it for me. They tell me all of my apps were bought w/this fraudulent account...NOT true as never knew this account existed. I started having problems updating my apps just last week...none of them will download updates.
    Good luck!

  • Sendin Spool reports to an e-mail address.

    Just wondering how one would go about developing a process to look for a specific spool report and send it to a specific e-mail address.  I would place the reports and associated e-mail address in a Z table to be maintained by a user group.  I have no clue on how to read the spool and collect a specific report to be sent via e-mail.  Any help or suggestions would be greatly appreciated.
    Thanks,
    Scott

    Here is some sample code.  This program takes the spool from a previous job step.  It converts this spool to PDF and then inserts this PDF as an attachment in an E-mail.
    * Program Name: KEG Job Sched Run with PDF Output Creation: 03/22/2001
    * SAP Name    : ZESU_JOB_RUN_WITH_PDF_OUTPUT      Application: U       *
    * Author      : Thomas Jung                       Type: 1              *
    * Description :  This Program will read the spool produced
    * by the specified previous job step and converts it to
    * PDF.  This PDF-Formatted report is then output to a file.            *
    * Inputs: File name, job step                                          *
    * Outputs: File formatted in PDF with the report output.               *
    * External Routines
    * FILE_GET_NAME
    * CONVERT_ABAPSPOOLJOB_2_PDF
    * CONVERT_OTFSPOOLJOB_2_PDF
    * Z_E_OPEN_FILE_FOR_OUTPUT_BIN
    * Z_E_WRITE_TO_FILE_WITH_LENGTH
    * SO_NEW_DOCUMENT_ATT_SEND_API1
    * BAPI_USER_GET_DETAIL
    * Return Codes:
    * The program uses the standard function modules for File manipulation
    * therefore it has all the standard error routines for Files.          *
    * Ammendments:                                                         *
    *    Programmer        Date     Req. #            Action               *
    * ================  ==========  ======  ===============================*
    * Thomas Jung       03/27/2001  ------  Initial Program.               *
    report  zesu_job_run_with_pdf_output message-id zes_job.
    * DATA DICTIONARY TABLES                                               *
    tables: raldb. "Transfer Structure for Logical Databases
    tables: tbtcp.
    tables: icon,   "Icons table
            bapiadsmtp, "BAPI structure for e-mail addresses (central
            bapiadpag.
    * TYPE POOLS                                                           *
    type-pools: sbdst.
    * CONSTANTS                                                            *
    constants: logical_file_name like filename-fileintern
                  value 'ZEX_STANDARD_FILENAME',
               pdf_ext(4) type c
                  value '.pdf',
               pdf_type(3) type c
                  value 'PDF',
               internet(1) type c
                  value 'U',
               dist_list(1) type c
                  value 'C',
               kimball_domain(12) type c value '@kimball.com'.
    constants: kim_ftp(80) type c
    value
    'ftp://kww.kog.kimball.com/webtools/acrobat_reader/acroread40w95.exe'.
    constants: ext_ftp(80) type c
    value
    'http://www.adobe.com/products/acrobat/readermain.html'.
    * VARIABLES                                                            *
    data: length type i.
    data: f4_field like trdir-name.
    data: pathleng type i,
          nameleng type i,
          physleng type i.
    data jselect like btcselect.
    data: report like sy-repid.
    data: doc_chng         like sodocchgi1.
    data: tab_lines        like sy-tabix.
    * INTERNAL TABLES                                                      *
    data: begin of html_tab occurs 0.
            include structure w3html.
    data: end of html_tab.
    data: icontab(32) occurs 10 with header line.
    data: itab like abaplist occurs   0 with header line.
    data: ipdf        like tline      occurs 0 with header line.
    data: objpack          like sopcklsti1 occurs 2 with header line.
    data: objhead          like solisti1   occurs 1 with header line.
    data: objbin           like solisti1   occurs 10 with header line.
    data: objtxt           like solisti1   occurs 10 with header line.
    data: reclist          like somlreci1  occurs 5 with header line.
    * SELECTION SCREEN LAYOUT                                              *
    selection-screen begin of block one with frame title text-001.
    parameters: fileintn like filename-fileintern obligatory
                    default logical_file_name,
                filepath like rlgrap-filename lower case.
    parameters: file1    like rlgrap-filename obligatory lower case,
                physname like rlgrap-filename lower case.
    parameters: date1 as checkbox.
    parameters: time1 as checkbox.
    selection-screen end of block one.
    selection-screen begin of block two with frame title text-002.
    parameter: step like tbtcp-stepcount.
    parameter: abap radiobutton group one.
    parameter: oft  radiobutton group one.
    selection-screen end of block two.
    selection-screen begin of block three with frame title text-003.
    parameter: file  radiobutton group two.
    parameter: email radiobutton group two.
    selection-screen skip 1.
    parameter: int radiobutton group thre.
    parameter: dis radiobutton group thre.
    selection-screen skip 1.
    parameter: ext_user like somlreci1-receiver.
    selection-screen end of block three.
    * SELECTION SCREEN PROCESSING - OUTPUT                                 *
    at selection-screen output.
      perform filename_processing.
      loop at screen.
        if screen-name eq 'FILEPATH' or
           screen-name eq 'PHYSNAME'.
          screen-input = 0.
          modify screen.
        endif.
      endloop.
    * START OF SELECTION                                                   *
    start-of-selection.
      move sy-repid to report.
      perform auth_check.
      perform filename_processing.
      perform get_spool.
      perform convert_list_to_pdf.
      if file = 'X'.
        perform write_to_file.
      else.
        perform send_pdf_in_email.
      endif.
    *&      Form  filename_processing
    *       Prepair to conver to the logical file name to a physical name
    *  -->  p1        text
    *  <--  p2        text
    form filename_processing.
      perform get_filename using fileintn file1 physname.
      nameleng = strlen( file1 ).
      physleng = strlen( physname ).
      pathleng = physleng - nameleng.
      if pathleng > 0.
        filepath = physname(pathleng).
      endif.
    endform.                    " filename_processing
    *&      Form  get_filename
    *       Convert the logical file name into a physical file name
    *      -->P_FILEINTN  Input Logical File Name
    *      -->P_FILE1     Filename selected by input
    *      -->P_PHYSNAME  Output Physical File Name
    form get_filename using    p_fileintn
                               p_file1
                               p_physname.
      data: p_file2 like rlgrap-filename.
      clear p_file2.
      move p_file1 to p_file2.
      if date1 = 'X'.
        concatenate p_file2
                    sy-datum
                    into p_file2.
      endif.
      if time1 = 'X'.
        concatenate p_file2
                    sy-uzeit
                    into p_file2.
      endif.
      concatenate p_file2
                  pdf_ext
                  into p_file2.
      call function 'FILE_GET_NAME'
            exporting
              client                        = sy-mandt
              logical_filename              = p_fileintn
              operating_system              = sy-opsys
              parameter_1                   = p_file2
    *     PARAMETER_2                   = ' '
    *     PARAMETER_3                   = ' '
    *     USE_PRESENTATION_SERVER       = ' '
    *     WITH_FILE_EXTENSION           = ' '
    *     USE_BUFFER                    = ' '
            importing
    *     EMERGENCY_FLAG                =
    *     FILE_FORMAT                   =
              file_name                     = p_physname
            exceptions
              file_not_found                = 1
              others                        = 2
      if sy-subrc <> 0.
        message e001(zes_general) with sy-subrc.
      endif.
    endform.                    " get_filename
    *&      Form  write_to_file
    *       TRANSFER PDF DATA TO OUTPUT FILE
    *  -->  p1        text
    *  <--  p2        text
    form write_to_file.
      data: string_out type string.
      describe field objbin length length.
      call function 'Z_E_OPEN_FILE_FOR_OUTPUT_BIN'
           exporting
                filename1 = physname.
      loop at objbin.
        clear string_out.
        move objbin to string_out.
        call function 'Z_E_WRITE_TO_FILE_WITH_LENGTH'
             exporting
                  filename1        = physname
                  length           = length
                  please_open_file = 'NO'
                  string           = string_out.
      endloop.
    endform.                    " write_to_file
    *&      Form  convert_list_to_pdf
    *       Convert to Spool to PDF
    *  -->  p1        text
    *  <--  p2        text
    form convert_list_to_pdf.
      data: spool_id like tsp01-rqident.
      move tbtcp-listident to spool_id.
    ****Is this ABAP List Processing?
      if abap = 'X'.
        call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
          exporting
            src_spoolid                    = spool_id
    *       NO_DIALOG                      =
    *       DST_DEVICE                     =
    *       PDF_DESTINATION                =
    *     IMPORTING
    *       PDF_BYTECOUNT                  =
    *       PDF_SPOOLID                    =
    *       LIST_PAGECOUNT                 =
    *       BTC_JOBNAME                    =
    *       BTC_JOBCOUNT                   =
          tables
            pdf                            = ipdf
         exceptions
           err_no_abap_spooljob           = 1
           err_no_spooljob                = 2
           err_no_permission              = 3
           err_conv_not_possible          = 4
           err_bad_destdevice             = 5
           user_cancelled                 = 6
           err_spoolerror                 = 7
           err_temseerror                 = 8
           err_btcjob_open_failed         = 9
           err_btcjob_submit_failed       = 10
           err_btcjob_close_failed        = 11
           others                         = 12.
        if sy-subrc <> 0.
          message i016 with sy-subrc.
        endif.
      else.
    ****Or is this SAPscript?
        call function 'CONVERT_OTFSPOOLJOB_2_PDF'
          exporting
            src_spoolid                    = spool_id
    *       NO_DIALOG                      =
    *       DST_DEVICE                     =
    *       PDF_DESTINATION                =
    *     IMPORTING
    *       PDF_BYTECOUNT                  =
    *       PDF_SPOOLID                    =
    *       OTF_PAGECOUNT                  =
    *       BTC_JOBNAME                    =
    *       BTC_JOBCOUNT                   =
          tables
            pdf                            = ipdf
         exceptions
           err_no_otf_spooljob            = 1
           err_no_spooljob                = 2
           err_no_permission              = 3
           err_conv_not_possible          = 4
           err_bad_dstdevice              = 5
           user_cancelled                 = 6
           err_spoolerror                 = 7
           err_temseerror                 = 8
           err_btcjob_open_failed         = 9
           err_btcjob_submit_failed       = 10
           err_btcjob_close_failed        = 11
           others                         = 12.
        if sy-subrc <> 0.
          message i016 with sy-subrc.
        endif.
      endif.
      perform convert_pdf tables ipdf
                                 objbin.
    endform.                    " convert_list_to_pdf
    *&      Form  get_spool
    *   Read the job log to get the spool number for the specified step
    *  -->  p1        text
    *  <--  p2        text
    form get_spool.
      clear jselect.
    *jselect-jobname = '*'.
      jselect-username = '*'.
    ****Have this program get its own Job Name
      call function 'GET_JOB_RUNTIME_INFO'
           importing
    *         EVENTID                 =
    *         EVENTPARM               =
    *         EXTERNAL_PROGRAM_ACTIVE =
              jobcount                = jselect-jobcount
              jobname                 = jselect-jobname
    *         STEPCOUNT               =
           exceptions
                no_runtime_info         = 1
                others                  = 2.
    ****Read the spool number for this job step.
      clear tbtcp.
      select single listident from tbtcp
             into tbtcp-listident
             where jobname   = jselect-jobname
               and jobcount  = jselect-jobcount
               and stepcount = step.
      if tbtcp-listident = 0.
        message i009 with step.
      endif.
    endform.                    " get_spool
    *&      Form  convert_pdf
    *       Take the PDF information returned by the function module
    *       and convert it to a file readable format.  It currently is
    *       in a printable-only format.
    *      -->P_IPDF  PDF Source
    *      -->P_OBJBIN  PDF Destination
    form convert_pdf tables   t_source_tab structure ipdf
                              t_target_tab structure objbin.
      data:  l_hfeld(1600)      type c,
             l_offset           type p,
             l_tabix            like sy-tabix,
             l_max              type i,
             l_linecount_source type i,
             l_length_source    type i,
             l_length_target    type i.
    * Zeilenlänge des Quell-PDF-Files
      describe field t_source_tab length l_length_source.
    * Zeilenlänge der Ziel-Mime-Tabelle
      describe field t_target_tab length l_length_target.
    * Zeilenanzahl des Quell-PDF-Files
      describe table t_source_tab lines l_linecount_source.
    * Die maximale Zielgröße wird durch das Feld l_hfeld begrenzt.
      l_max = l_length_target + l_length_source.
    *  IF L_MAX > 1600.
    *    RAISE CONVERT_NOT_POSSIBLE.
    *  ENDIF.
      refresh t_target_tab.
      loop at t_source_tab.
        l_tabix = sy-tabix.
        move t_source_tab to l_hfeld+l_offset.
    * falls letzte zeile der quelltabelle erreicht
        if l_tabix = l_linecount_source.
          l_length_source = strlen( t_source_tab ).
        endif.
        l_offset = l_offset + l_length_source.
        while l_offset ge l_length_target.
          clear t_target_tab.
          t_target_tab = l_hfeld(l_length_target).
          append t_target_tab.
          shift l_hfeld by l_length_target places.
          l_offset = l_offset - l_length_target.
        endwhile.                          " l_offset ge p_length_target
    * falls letzte zeile der quelltabelle erreicht
        if l_tabix = l_linecount_source.
          if l_offset gt 0.
            clear t_target_tab.
            t_target_tab = l_hfeld(l_offset).
            append t_target_tab.
          endif.                           " l_offset gt 0
        endif.                             " l_tabix = l_linecount_lines
      endloop.                             " p_source_tab
    endform.                    " convert_pdf
    *&      Form  auth_check
    *       Perform Authorization Check
    *  -->  p1        text
    *  <--  p2        text
    form auth_check.
      authority-check object 'Z_ABAP_CHK'
                   id 'BUKRS' dummy
                   id 'ACTVT' dummy
                   id 'WERKS' dummy
                   id 'REPID' field report.
      if sy-subrc ne 0.
        message e024.
      endif.
    endform.                    " auth_check
    *&      Form  send_pdf_in_email
    *       Transfer the PDF file in an E-Mail
    *  -->  p1        text
    *  <--  p2        text
    form send_pdf_in_email.
      data: iaddsmtp type bapiadsmtp occurs 0 with header line.
      data: ireturn type bapiret2 occurs 0 with header line.
      concatenate text-010 jselect-jobname text-011
                  into doc_chng-obj_descr
                  separated by space.
      clear objtxt.
      objtxt = text-012.
      append objtxt.
      clear objtxt.
      objtxt = text-013.
      append objtxt.
      clear objtxt.
      concatenate text-014 jselect-jobname
                  into objtxt
                  separated by space.
      append objtxt.
      clear objtxt.
      objtxt = text-015.
      append objtxt.
      clear objtxt.
      objtxt = text-016.
      append objtxt.
      clear objtxt.
      append objtxt.
      clear objtxt.
      concatenate text-017 kim_ftp
                  into objtxt
                  separated by space.
      append objtxt.
      clear objtxt.
      concatenate text-018 ext_ftp
                into objtxt
                separated by space.
      append objtxt.
      describe table objtxt lines tab_lines.
      read table objtxt index tab_lines.
      doc_chng-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
      clear objpack-transf_bin.
      objpack-head_start = 1.
      objpack-head_num   = 0.
      objpack-body_start = 1.
      objpack-body_num   = tab_lines.
      objpack-doc_type   = 'RAW'.
      append objpack.
      describe table objbin lines tab_lines.
      concatenate jselect-jobname pdf_ext
                  into objhead.
      append objhead.
      objpack-transf_bin = 'X'.
      objpack-head_start = 1.
      objpack-head_num   = 1.
      objpack-body_start = 1.
      objpack-body_num   = tab_lines.
      objpack-doc_type   = pdf_type.
      objpack-obj_name   = jselect-jobname.
      concatenate text-019 jselect-jobname
                  into objpack-obj_descr
                  separated by space.
      objpack-doc_size   = tab_lines * 255.
      append objpack.
      if int = 'X'.
        clear iaddsmtp.
        refresh iaddsmtp.
        clear bapiadsmtp.
        call function 'BAPI_USER_GET_DETAIL'
             exporting
                  username = ext_user+0(12)
             tables
                  return   = ireturn
                  addsmtp  = iaddsmtp.
        loop at iaddsmtp where std_no = 'X'.
          clear bapiadsmtp.
          move iaddsmtp to bapiadsmtp.
        endloop.
        if bapiadsmtp-e_mail = ''.
          concatenate ext_user kimball_domain
                    into reclist-receiver.
        else.
          move bapiadsmtp-e_mail to reclist-receiver.
        endif.
        move internet to reclist-rec_type.
      else.
        reclist-receiver = ext_user.
        move dist_list to reclist-rec_type.
      endif.
      append reclist.
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        exporting
          document_data                    = doc_chng
          put_in_outbox                    = 'X'
    *   IMPORTING
    *     SENT_TO_ALL                      =
    *     NEW_OBJECT_ID                    =
        tables
          packing_list                     = objpack
          object_header                    = objhead
          contents_bin                     = objbin
          contents_txt                     = objtxt
    *     CONTENTS_HEX                     =
    *     OBJECT_PARA                      =
    *     OBJECT_PARB                      =
          receivers                        = reclist
        exceptions
         too_many_receivers               = 1
         document_not_sent                = 2
         document_type_not_exist          = 3
         operation_no_authorization       = 4
         parameter_error                  = 5
         x_error                          = 6
         enqueue_error                    = 7
         others                           = 8
      case sy-subrc.
        when 0.
          message i014 with reclist-receiver.
        when 1.
          message i015 with text-027.
        when 2.
          message i015 with text-028.
        when 3.
          message i015 with text-029.
        when 4.
          message i015 with text-030.
        when 5.
          message i015 with text-031.
        when 6.
          message i015 with text-032.
        when 7.
          message i015 with text-033.
        when 8.
          message i015 with text-036.
        when others.
          message i015 with text-036.
      endcase.
    endform.                    " send_pdf_in_email

  • How can I get the e-mail address (reply addr.) once connected to a server

    My application ask the user to enter the POP3 server host name (+ port) more the
    POP3 server userId and password .... I can get the e-mails and show the to the user ....
    Now, the user want to send a message from that "account" and what I need
    is to know the "reply address" (the "from address") to set to the outgoing message ...
    I would like to get it somehow (from the API or in anotherway) without asking the
    user to enter it ...
    So, oonce connected to the POP3 mail server (successful login) is it
    possible to get the e-mail address of that guy ??
    please let me know if you have a solution ....
    many thanks / regards / Max

    You are of course trying to get an email address in the format of [email protected] You already have "username" the trick is the somedomain.com. I don't believe that the pop3 server has anyway to tell you this. Unless your host name is "fully qualified", i.e. pop3.somedomain.com, I don't know that you can get this information. Maybe you could take the IP address and do a reverse DNS lookup? Still you wouldn't really know if that is the domain the user really wants. For example I retrieve and send my email from aaa.com, but my domain for my reply-to is bbb.com. Your goal is noble, but perhaps not practical. That is why Outlook Express requires the user to enter their email address when setting up an account. Hope this helps.

  • Can't send smartform to external mail address

    Hi, everyone.
    Now, after creating some self-defined smartforms, we want to send its
    PDF copy to
    our external mail address. From this point, I had some try.
    Reference to SAP Library, I make a testing program named 'YPDF_TEST'.
    However, one exception always exists when running and error message id
    is 'XS806' - means
    "No delivery to &, invalid recipient address"
    I filled the address with following fields.
    [ dev_mail_recipient-logsys = 'CLNT600'.
    dev_mail_recipient-objtype = 'RECIPIENT'.
    dev_mail_recipient-objkey = '[email protected]'. ]
    I just can't understand the real reason why it doesn't work.
    Through debugging, I found the error occurs when handling the following
    codes
    in function "SX_ADDRESS_TO_DEVTYPE".
    [ swc_create_object o_recipient 'RECIPIENT' recipient_id-objkey.
    swc_get_property o_recipient 'CommunicationType' m_recipient-type.
    get_property_longvalue o_recipient m_recipient-address. ]
    On the current situation, if can't come over this problem,
    we may not build the connection and don't provide information in time.
    Failed to send, I yet try another function - added the tail but on earthdidn't get it ~~~
    Would you give me some hints or advice ?
    Any help is appreciated.
    ====================
    <i>REPORT ypdf_test .
    DATA: fm_name TYPE rs38l_fnam.
    DATA: my_control_pars TYPE ssfctrlop. "for CONTROL_PARAMETERS
    DATA: my_output_info TYPE ssfcrescl. "for JOB_OUTPUT_INFO
    DATA: output_options TYPE ssfcompop.
    DATA: e_devtype TYPE rspoptype.
    DATA: gw_lcprint TYPE ziebsflc001.
    DATA: bin_file TYPE xstring,
    bin_filesize TYPE i,
    ndiv TYPE i, offset TYPE i,
    nmod TYPE i.
    DATA: BEGIN OF bin_table OCCURS 0,
    x TYPE xstring,
    END OF bin_table.
    DATA: lines LIKE tline OCCURS 0.
    DATA: dev_mail_sender LIKE swotobjid, "B20K061818
    dev_mail_recipient LIKE swotobjid.
    DATA: dev_mail_applobj_tab LIKE swotobjid OCCURS 10 WITH HEADER LINE.
    DATA: param LIKE itcpp.
    my_control_pars-no_dialog = 'X'.
    my_control_pars-getotf = 'X'.
    Get genereated function name of Smartform
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'ZDEMO_SMART_FORM_PPF'
    IMPORTING
    fm_name = fm_name
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    ENDIF.
    Get Device type
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
    i_language = sy-langu
    I_APPLICATION = 'SAPDEFAULT'
    IMPORTING
    e_devtype = e_devtype
    EXCEPTIONS
    no_language = 1
    language_not_installed = 2
    no_devtype_found = 3
    system_error = 4
    OTHERS = 5 .
    IF sy-subrc <> 0.
    ENDIF.
    output_options-tdprinter = e_devtype.
    set needed mail option
    my_control_pars-device = 'MAIL'.
    dev_mail_sender-logsys = 'CLNT600'.
    dev_mail_sender-objtype = 'RECIPIENT'.
    dev_mail_sender-objkey = 'CHI_DEV03'.
    dev_mail_recipient-logsys = 'CLNT600'.
    dev_mail_recipient-objtype = 'RECIPIENT'.
    dev_mail_recipient-objkey = '[email protected]'.
    CALL FUNCTION fm_name
    EXPORTING
    control_parameters = my_control_pars
    mail_recipient = dev_mail_recipient
    mail_sender = dev_mail_sender
    output_options = output_options
    ip_carrid = 'ID'
    ip_connid = '8290'
    ip_fldate = sy-datum
    ip_bookid = '12345678'
    ip_customid = '09876521'
    ip_luggweight = 90
    ip_wunit = 'KG'
    ip_smoker = 'X'
    IMPORTING
    job_output_info = my_output_info
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Another try ***
    *DATA: param LIKE itcpp.
    *DATA: BEGIN OF off_obj.
    INCLUDE STRUCTURE soodk.
    *DATA: END OF off_obj,
    ok TYPE c,
    msgid TYPE symsgid,
    msgno TYPE symsgno,
    msgv1 TYPE symsgv,
    msgv2 TYPE symsgv,
    msgv3 TYPE symsgv,
    msgv4 TYPE symsgv.
    *DATA: dev_mail_applobj_tab LIKE swotobjid OCCURS 10 WITH HEADER LINE.
    *CALL FUNCTION 'CONVERT_OTF_AND_MAIL'
    EXPORTING
    mailoptions = param
    mail_sender = dev_mail_sender
    mail_recipient = dev_mail_recipient
    IMPORTING
    office_objid = off_obj
    mail_ok = ok
    msgno = msgno
    msgid = msgid
    msgv1 = msgv1
    msgv2 = msgv2
    msgv3 = msgv3
    msgv4 = msgv4
    TABLES
    mail_application_object_ids = dev_mail_applobj_tab
    otf = my_output_info-otfdata.</i>

    Hi,
    You can follow a different approach. Send the output of the Smartform to the spool.
    You have a Function Module to read the spool and convert it to PDF . Then there is one more function module to attach the PDF and send it as a mail.
    You need to configure SMTP in Tcode : SCOT.
    Search the forum with emailpdfattachment
    You have umpteen postings available.
    Pls reward if useful.
    Regards,
    Laxman Nayak

Maybe you are looking for

  • Cannot delete file from trash - tried EVERYTHING

    Wow. I have an incredibly stubborn file (named :VBL followed by a bunch of non English symbols) in the trash that I cannot get rid of. I have tried all the usual methods of deleting, secure deleting, using Cocktail, and literally _EVERY SINGLE METHOD

  • Problem in creation of Multi-master

    I created master group in replication. I have decided to use multi-master replication and because of that I add another site to my first master site.But when I do that in OEM ,I encunter to a problem called that invalid compatible version .... My Ora

  • I'm running Snow Leopard and want to setup a server.

    Hello everyone! This is the situation: I have large amounts of data I want to be able to access from afar. Some friends as well. At some point we would want to share some of that data. Dropbox or similar services are not an option since space is limi

  • Work a iPad mini as screen for Mac mini?

    I Have a iPad mini 1 and I think about to buy a Mac mini, could I use the iPad as the screen for the Mac? best regards

  • Read the file line by line from upload

    Hi Guys, Need help... I creating a web application that has a upload capability. What I want to do is this... I want to upload a file (but not save it). What I'm going to do is just read the file line by line and save these data to the database. How