Notification report

Dears
From change notification(QM02)
From menu NOTIFICATION>PRINT>NOTIFICATION>5999 REJECTION REPORT
Company logo is IDES HOLDING AG at the header level
and in bottom level address is also different
how it is possible to bring our own logo and address
Thnaks in advance
Faisal

Dear
My abaper is in offshore, so i need to give some specification on this issue
can you help on giving some details like from which table it is coming
any tips
Faisal

Similar Messages

  • Notification report for user

    Hi,
    I have a program which creates the rebate agreement in ECC ( ACTUALLY agreement is created in CRM and my program gets all details from CRM through RFC and creates rebate in ECC) and displays messages in background job(SM37).
    Users are asking for a notification with details whether agreement is created or not?
    How can i achieve this?
    Please suggest.
    Thanks
    Ashu

    In your program use function module SO_OBJECT_SEND to send the e-mail to users with details.

  • Mail notification

    i want to develop following report......
    mail notification Report which displays the vendor    consignment details of various vendors and the mails are sent to the relevant vendors.
    for mail notification what i should do in my abap program.
    sap version is 4.7
    I mean hoe can i sent mail to the relevent vendors
    Please help me ....it's bit urgent.
    Thanks and Regards,
    Veena.

    If you are on Release 6.40+ you might also want to check out SAP's Business Communication Services, the successor to the Business Communication Interface (BCI):
    http://help.sap.com/saphelp_sm32/helpdata/en/aa/29673a9011fc7be10000000a11402f/frameset.htm
    Jonathan

  • Issue at 8D report

    Hi
    8D Analysis report for Customer complaints defect. when I create 8D report for Customer notification Report is Picking values from Notification - Referance, Defect description, and Defect cause but not the other fields( others are empty)
    Actually i done this before ( another client ) it was working perfect but with this client i have this issue
    Can anybody tell me How to populate values in these fields Ex: Immediate tasks, Corrective tasks, Ident of delivered mat, caeck success of corrective tasks and Comment. is there any system issue which causes this problem.
    thanks
    Santha

    Hi,
    Thanks for the reply.
    I have checked the steps as advise, but it doesn`t work, Still have same issue.( Line 4,5,6,7& 8 are not getting populated)
    I have one Question, Does this need DMS base level configuration? for 8D report .
    regards
    Santha

  • Email notification for MeetingPlace not being received

    Client has MeetingPlace 7.1.1 installed. Outlook email notification for MeetingPlace stopped working.
    Problem symptom:  When users try to schedule a meeting from web server page, both scheduler and invitee do not receive email notifcaiton in their email account.  But email notification for MeetingPlace works when users schedule meeting from MeetingPlace for Outlook Plug-in regardlessly.
    I've run a test with client, meeting creation is successful. But as soon as user finishs creation meeting, email notification is "Queued for delivery" in Email Notification Report in MeetingPlace App Admin page. I checked all possible settings in MeetingPlace Administration page, nothing looks wrong - correct email address account and type in user profile; SMTP server is properly configured and passes tha test; SMTP server is up and runnin. 
    I'm stumped after deep research online, did not go anywhere. Can someone point out where could possible go wrong and how to fix this issue??
    Fei

    Email notification works differently depending on where the scheduling is done. When done from Outlook your Outlook client sends the request directly to Exchange. When scheduling from the web the invite is held in a mailbox on the Application Server and periodically the system tries to send the email to its mailbox on Exchange.  Since the issues is with meetings scheduled via the web interface there is an issue with MP talking to Exchange.  I assume the users scheduling from the web have Outlook selected in their profile. This is the first place to check. Next I would look at the Outlook settings in MP. Make sure the MP mailbox is still in Exchange and that the user name and password is correct for the Exchange mailbox. This is usually where the issue is. Also make sure that SSL has not become a requirement to talk with Exchange.
    Let me know if you have any questions.
    John

  • Quality Notification

    Hi sap gurus,
    In standard Notification report, Defective quantity, Reference quantity and plant is not printing. How can i get plant wise notification report.Can anybody suggest me how to do this.
    Krishna

    Hi,
    Are you refering to reports QM10 / QM11. Both of them will print plant and reference qty.
    To get plant wise notification, add plant as a selection from the dynamic selection screen.
    Cheers !

  • Extended notification and deadline monitoring

    We are using extended notification to deliver new and changed workitem by email.  Now we want to update some workflow approval tasks to add deadline notification.  In SWU3 workflow customizing, we had setup "Schedule Background Job for Deadline Monitoring" to run job RSWFSLSDLEX (previous version is SWWDHEX). 
    My question: if there is some outstanding workflow task meet the deadline, will the notification email sent out by job RSWFSLSDLEX or extended notification report SWN_SELSEN?  Thanks in advance.
    Regards,
    Donald

    Hi,
    The deadline monitoring job only creates additional workitems if a deadline is met, the sending of an email job retrieves workitems and sends them as email.
    Kind regards, Rob Dielemans

  • Using Output types in Custom Reports

    Hello,
    I have got a requirement to set up two new Outputs which would be used by two different Custom Reports such as Shortage Allocation and Late Shipment notification report,Both these Outputs Both output types need to be linked to the same access sequence.
    New logic would be incorporated through ABAP in these Custom reports where output records from the tables listed above can be read and based on any valid records found within these table create e-mail output for all addresses listed within that output record.
    So far I have come across Output types only used in Transactions(Sales orders/Deliver/Shipment/Billing),Would require your inputs as to how to go about in configuring Output types to be used in Custom programs.
    What would be a required settings which are needed to be done?
    Both thee Custom reports pertain to diferent Applications like shortage reports is a Sales Application whereas Late Shipment notification report is a Transportation related Application,Does these Output types need to configured for one Application(V1) or differently for Multiple Applications(One Output for V1 and other for V7)?
    Appreciate your inputs on this.
    Thanks and Regards
    Mohammed Roshan

    Hi Vemuru Santosh Kumar,
    The Custom Progams are Shortage Allocation Report and Late Shipmnt Notification report,
    These Reports have an Option of Entering Individual Email addresses of Reciepients to whom these reports are needed to be sent,Instead of maintaining thes Email addresses maually and saving through Variants,The Business requires two new Output types created for these programs,which would have the same accesses through which output records would be maintained.
    These output condition records maintained in each access would be read by Custom logic maintained in the above custom programs and these reports would be sent to Emial addresses maintained in the Output condition records.
    Would likeyour inputs as to how to go about in configuring these Outputs?
    Thanks and Regards
    Mohammed Roshan

  • Mismatch between inicident classification list and notification

    Hi,
    we customized incident classification list in order to have three levels.
    Incident classification field template has this visible effect:
    When end user receive notification that field reports only last level:
    How can I get CLASSIFICATION notification reports all above item instead of only last one ?
    FYI below how Incident Classification list was built:
    Grazie mille Alex

    Hi,
    What you see in the console is just a presentation of chain of the classifications that includes all of the parent classifications.
    For me the good way is to use classification like this :
    End user ict services - ocs - Collaboration ....
    End user ict services - ocs - xxxxx
    End user ict services - ocs - yyyyyy
    instead of :
    End user itc service
                                ocs
                                      Collaboration ....
                                      xxxxxxxxxxx
                                      yyyyyyyyyyyy
    Remy BOVI

  • ZRS: Send report mail

    Hello,
    I 'm trying to send a report by e-mail. I have configured the SMTP setting on Configuration - Event and Messaging - SMTP Settings.
    Also I have configured on Configuration - Reporting Services - Email notification settings with a valid sender and receipt addreses.
    I logging on the Zenworks Report Server, select the report and click Send to - E-mail. I leave checked "used default settings" and Submit but NO e-mail is sent. I don't see any error, simply the e-mail message never appears.
    I have tried to uncheck "used default settings" and specify all the addresses needed but the result is the same, nothings happens, no errors....
    Can anyone tell me if I'm doing something wrong, or how I can configure the e-mail notification report option??
    Thank you

    Hello,
    more info, I continued doing tests and the only way that it works is if I schedule the execution of a specific report and send it by e-mail and specify manually all the information (uncheck used default settings).
    If I do the same but leave checked "used default settings" I get an error SMTP 501 - Syntax error. I have configured the SMTP setting on Configuration - Event and Messaging - SMTP Settings with my smtp server and default port 25. Also I have configured on Configuration - Reporting Services - Email notification settings with a valid sender and receipt addreses.
    Can someone tell me what I'm doing wrong or if someone is using this funcionality tell me how you configure it ?
    Thank you

  • Notification Status restrication

    Hi all,
            In my notification report it is displaying notification no, status, that related key figures. I have problem displaying status.
    Problem:
    Requirment is that particular notifcation cloed means no need to diplay in report.
    my problm is particular notification no have both status like: WORKINPROCESS, CLOSED means its showing in report. when i exclude the CLOSED status still that notification no displaying with status of WORKINPROCESS.
    Kindly guide me how to slove this problem. once notifiation closed no need to displaying in report.
    Note: If giving full load it working fine, delta load only not working like that client telling i not sure on that. Please if you need any more input let me know.
    Thanks & Regards,
    R, Saravanan

    HI Saravanan,
    I believe you are reporting from the cube , and hence will it hold all the status changes for the notification during the delta load ,
    there are two options you can follow ,
    Enhance the infoobject Notification with the status field , make it as a navigational attribute , and map it accordingly with the source field , this can always hold the current status of the notification, and use this status field(navigational attribute) for restriction in the query ,
    Or if you have DSO in the dataflow before the Cube , The DSO will always have the Current status of the Object even in delta load , In this case you can report this from DSO
    Hope this helps
    Regards,
    Sathya

  • 8D Report creation

    Folks,
    My clients end customer is Auto Industry and they demand 8D Analysis report for Cretcal defect. when I create 8D report for Customer notification Report is Picking values from Notification - Referance, Defect description, and Defect cause but other fields are empty!
    Can anybodu tell me How to populate values in these fields Ex: Immediate tasks, Corrective tasks, Ident of delivered mat, caeck success of corrective tasks and Comment.
    Thanks and Best regards
    Jay

    Hi
    There are some good help available in SDN  like
    For 8D report
    http://help.sap.com/saphelp_47x200/helpdata/en/a0/c1636cd81711d1953800a0c930e04c/frameset.htm
    8D Summary Report
    How to generate 8D Report
    In QCC0--->Quality Notifcation >Notification Processing>Additional Notification function>Define Action box>Select the notification type->click on activity>click on 8D report & check the
    Function module used inside isit:   QM06_FM_TASK_CREATE_8DREPORT
    Also check the FM's
    QM06_FM_TASK_CRT_8DREPORT_PDF
    QM06_FM_TASK_REQ_8DREPORT_PDF
    QM06_FM_TASK_REQUEST_8DREPORT
    QM06_REQ_8D_REPORT_FOA_PDF
    QM06_REQ_8D_REPORT_STEP2_PDF
    QM06_REQUEST_8D_REPORT_FOA
    QM06_REQUEST_8D_REPORT_STEP2
    This will help you
    Regards
    Sujit
    Regards
    Sujit

  • Issue with spamassassin, now mail not working

    Hi ! I installed spamtrainer almost two months ago. Been feeding the [email protected] for several weeks now , 700 emails each day at least .
    There was very little improvement if none at all. Tried to add "@local_domains_maps = (1)" to amavisd.conf last night thinking it might be the problem , though no virtual domain exist. This was one of the issue on the default Amavisd config. The other one is adding the symbolic link which I already done.
    Computer froze while adding the parameter "@local_domains_maps = (1)", so I manually turn off the Power Mac, then mail stopped altogether. The mails are filing up but the clients couldn't send or receive since this incidence .
    FF is the maincf. and amavis.conf
    All help are greatly appreciated.
    mail:/Users/sysadmin root# postconf -n
    alias_maps = hash:/etc/aliases,hash:/var/mailman/data/aliases
    always_bcc =
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    content_filter = smtp-amavis:[127.0.0.1]:10024
    daemon_directory = /usr/libexec/postfix
    debug_peer_level = 2
    enable_server_options = yes
    html_directory = no
    inet_interfaces = all
    local_recipient_maps = proxy:unix:passwd.byname $alias_maps
    luser_relay =
    mail_owner = postfix
    mailbox_size_limit = 0
    mailbox_transport = cyrus
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    maps_rbl_domains =
    message_size_limit = 31457280
    mydestination = $myhostname,localhost.$mydomain,localhost,mail.cpplaw.com,cpplaw.com
    mydomain = cpplaw.com
    mydomain_fallback = localhost
    myhostname = mail.cpplaw.com
    mynetworks = 127.0.0.1/32,192.168.1.0/24,127.0.0.1
    mynetworks_style = host
    newaliases_path = /usr/bin/newaliases
    owner_request_special = no
    queue_directory = /private/var/spool/postfix
    readme_directory = /usr/share/doc/postfix
    recipient_delimiter = +
    relayhost =
    sample_directory = /usr/share/doc/postfix/examples
    sendmail_path = /usr/sbin/sendmail
    setgid_group = postdrop
    smtpd_client_restrictions = permit_mynetworks permit
    smtpd_tls_key_file =
    unknown_local_recipient_reject_code = 550
    virtual_mailbox_domains =
    virtual_transport = virtual
    mail:/Users/sysadmin root# postconf -n
    alias_maps = hash:/etc/aliases,hash:/var/mailman/data/aliases
    always_bcc =
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    content_filter = smtp-amavis:[127.0.0.1]:10024
    daemon_directory = /usr/libexec/postfix
    debug_peer_level = 2
    enable_server_options = yes
    html_directory = no
    inet_interfaces = all
    local_recipient_maps = proxy:unix:passwd.byname $alias_maps
    luser_relay =
    mail_owner = postfix
    mailbox_size_limit = 0
    mailbox_transport = cyrus
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    maps_rbl_domains =
    message_size_limit = 31457280
    mydestination = $myhostname,localhost.$mydomain,localhost,mail.cpplaw.com,cpplaw.com
    mydomain = cpplaw.com
    mydomain_fallback = localhost
    myhostname = mail.cpplaw.com
    mynetworks = 127.0.0.1/32,192.168.1.0/24,127.0.0.1
    mynetworks_style = host
    newaliases_path = /usr/bin/newaliases
    owner_request_special = no
    queue_directory = /private/var/spool/postfix
    readme_directory = /usr/share/doc/postfix
    recipient_delimiter = +
    relayhost =
    sample_directory = /usr/share/doc/postfix/examples
    sendmail_path = /usr/sbin/sendmail
    setgid_group = postdrop
    smtpd_client_restrictions = permit_mynetworks permit
    smtpd_tls_key_file =
    unknown_local_recipient_reject_code = 550
    virtual_mailbox_domains =
    virtual_transport = virtual
    mail:/Users/sysadmin root#
    _______________________Amavisd.cof_________________________
    use strict;
    # Configuration file for amavisd-new
    # This software is licensed under the GNU General Public License (GPL).
    # See comments at the start of amavisd-new for the whole license text.
    #Sections:
    # Section I - Essential daemon and MTA settings
    # Section II - MTA specific
    # Section III - Logging
    # Section IV - Notifications/DSN, BOUNCE/REJECT/DROP/PASS destiny, quarantine
    # Section V - Per-recipient and per-sender handling, whitelisting, etc.
    # Section VI - Resource limits
    # Section VII - External programs, virus scanners, SpamAssassin
    # Section VIII - Debugging
    #GENERAL NOTES:
    # This file is a normal Perl code, interpreted by Perl itself.
    # - make sure this file (or directory where it resides) is NOT WRITABLE
    # by mere mortals, otherwise it represents a severe security risk!
    # - for values which are interpreted as booleans, it is recommended
    # to use 1 for true, and 0 or undef or '' for false.
    # THIS IS DIFFERENT FROM OLDER AMAVIS VERSIONS where "no" also meant false,
    # now it means true, like any nonempty string does!
    # - Perl syntax applies. Most notably: strings in "" may include variables
    # (which start with $ or @); to include characters @ and $ in double
    # quoted strings, precede them by a backslash; in single-quoted strings
    # the $ and @ lose their special meaning, so it is usually easier to use
    # single quoted strings. Still, in both cases a backslash need to be doubled
    # - variables with names starting with a '@' are lists, the values assigned
    # to them should be lists as well, e.g. ('one@foo', $mydomain, "three");
    # note the comma-separation and parenthesis. If strings in the list
    # do not contain spaces nor variables, a Perl operator qw() may be used
    # as a shorthand to split its argument on whitespace and produce a list
    # of strings, e.g. qw( one@foo example.com three ); Note that the argument
    # to qw is quoted implicitly and no variable interpretation is done within
    # (no '$' variable evaluations). The #-initiated comments can not be used
    # within the string. In other words, $ and # lose their special meaning
    # withing a qw argument, just like within '...' strings.
    # - all e-mail addresses in this file and as used internally by the daemon
    # are in their raw (rfc2821-unquoted and nonbracketed) form, i.e.
    # Bob "Funny" [email protected], not: "Bob \"Funny\" Dude"@example.com
    # and not <"@example.com>; also: '' and not ''.
    # Section I - Essential daemon and MTA settings
    # $MYHOME serves as a quick default for some other configuration settings.
    # More refined control is available with each individual setting further down.
    # $MYHOME is not used directly by the program. No trailing slash!
    #$MYHOME = '/var/lib/amavis'; # (default is '/var/amavis')
    # : $mydomain serves as a quick default for some other configuration settings.
    # : More refined control is available with each individual setting further down.
    # : $mydomain is never used directly by the program.
    $mydomain = 'cpplaw.com'; aol.com'; # (no useful default)
    # Set the user and group to which the daemon will change if started as root
    # (otherwise just keep the UID unchanged, and these settings have no effect):
    $daemon_user = 'clamav'; # (no default; customary: vscan or amavis)
    $daemon_group = 'clamav'; # (no default; customary: vscan or amavis)
    # Runtime working directory (cwd), and a place where
    # temporary directories for unpacking mail are created.
    # (no trailing slash, may be a scratch file system)
    $TEMPBASE = $MYHOME; # (must be set if other config vars use is)
    #$TEMPBASE = "$MYHOME/tmp"; # prefer to keep home dir /var/amavis clean?
    # $helpers_home sets environment variable HOME, and is passed as option
    # 'home_dir_for_helpers' to Mail::SpamAssassin::new. It should be a directory
    # on a normal persistent file system, not a scratch or temporary file system
    #$helpers_home = $MYHOME; # (defaults to $MYHOME)
    #$daemon_chroot_dir = $MYHOME; # (default is undef, meaning: do not chroot)
    #$pid_file = "$MYHOME/amavisd.pid"; # (default is "$MYHOME/amavisd.pid")
    #$lock_file = "$MYHOME/amavisd.lock"; # (default is "$MYHOME/amavisd.lock")
    # set environment variables if you want (no defaults):
    $ENV{TMPDIR} = $TEMPBASE; # wise, but usually not necessary
    # MTA SETTINGS, UNCOMMENT AS APPROPRIATE,
    # both $forward_method and $notify_method default to 'smtp:127.0.0.1:10025'
    # POSTFIX, or SENDMAIL in dual-MTA setup, or EXIM V4
    # (set host and port number as required; host can be specified
    # as IP address or DNS name (A or CNAME, but MX is ignored)
    #$forward_method = 'smtp:127.0.0.1:10025'; # where to forward checked mail
    #$notify_method = $forward_method; # where to submit notifications
    # NOTE: The defaults (above) are good for Postfix or dual-sendmail. You MUST
    # uncomment the approprate settings below if using other setups!
    # SENDMAIL MILTER, using amavis-milter.c helper program:
    #$forward_method = undef; # no explicit forwarding, sendmail does it by itself
    # milter; option -odd is needed to avoid deadlocks
    #$notify_method = 'pipe:flags=q argv=/usr/sbin/sendmail -Ac -i -odd -f ${sender} -- ${recipient}';
    # just a thought: can we use use -Am instead of -odd ?
    # SENDMAIL (old non-milter setup, as relay):
    #$forward_method = 'pipe:flags=q argv=/usr/sbin/sendmail -C/etc/sendmail.orig.cf -i -f ${sender} -- ${recipient}';
    #$notify_method = $forward_method;
    # SENDMAIL (old non-milter setup, amavis.c calls local delivery agent):
    #$forward_method = undef; # no explicit forwarding, amavis.c will call LDA
    #$notify_method = 'pipe:flags=q argv=/usr/sbin/sendmail -Ac -i -f ${sender} -- ${recipient}';
    # EXIM v3 (not recommended with v4 or later, which can use SMTP setup instead):
    #$forward_method = 'pipe:flags=q argv=/usr/sbin/exim -oMr scanned-ok -i -f ${sender} -- ${recipient}';
    #$notify_method = $forward_method;
    # prefer to collect mail for forwarding as BSMTP files?
    #$forward_method = "bsmtp:$MYHOME/out-%i-%n.bsmtp";
    #$notify_method = $forward_method;
    # Net::Server pre-forking settings
    # You may want $max_servers to match the width of your MTA pipe
    # feeding amavisd, e.g. with Postfix the 'Max procs' field in the
    # master.cf file, like the '2' in the: smtp-amavis unix - - n - 2 smtp
    $max_servers = 2; # number of pre-forked children (default 2)
    $max_requests = 10; # retire a child after that many accepts (default 10)
    $child_timeout=5*60; # abort child if it does not complete each task in n sec
    # (default: 8*60 seconds)
    # Check also the settings of @av_scanners at the end if you want to use
    # virus scanners. If not, you may want to delete the whole long assignment
    # to the variable @av_scanners, which will also remove the virus checking
    # code (e.g. if you only want to do spam scanning).
    # Here is a QUICK WAY to completely DISABLE some sections of code
    # that WE DO NOT WANT (it won't even be compiled-in).
    # For more refined controls leave the following two lines commented out,
    # and see further down what these two lookup lists really mean.
    #@bypass_virus_checks_acl = qw( . ); # uncomment to DISABLE anti-virus code
    #@bypass_spam_checks_acl = qw( . ); # uncomment to DISABLE anti-spam code
    # Any setting can be changed with a new assignment, so make sure
    # you do not unintentionally override these settings further down!
    # Lookup list of local domains (see README.lookups for syntax details)
    # NOTE:
    # For backwards compatibility the variable names @local_domains (old) and
    # @local_domains_acl (new) are synonyms. For consistency with other lookups
    # the name @local_domains_acl is now preferred. It also makes it more
    # obviously distinct from the new %local_domains hash lookup table.
    # local_domains* lookup tables are used in deciding whether a recipient
    # is local or not, or in other words, if the message is outgoing or not.
    # This affects inserting spam-related headers for local recipients,
    # limiting recipient virus notifications (if enabled) to local recipients,
    # in deciding if address extension may be appended, and in SQL lookups
    # for non-fqdn addresses. Set it up correctly if you need features
    # that rely on this setting (or just leave empty otherwise).
    # With Postfix (2.0) a quick reminder on what local domains normally are:
    # a union of domains spacified in: $mydestination, $virtual_alias_domains,
    # $virtual_mailbox_domains, and $relay_domains.
    @local_domains_acl = ( ".$mydomain" ); # $mydomain and its subdomains
    # @local_domains_acl = qw(); # default is empty, no recipient treated as local
    # @local_domains_acl = qw( .example.com );
    # @local_domains_acl = qw( .example.com !host.sub.example.net .sub.example.net );
    # @local_domains_acl = ( ".$mydomain", '.example.com', 'sub.example.net' );
    # or alternatively(A), using a Perl hash lookup table, which may be assigned
    # directly, or read from a file, one domain per line; comments and empty lines
    # are ignored, a dot before a domain name implies its subdomains:
    #read_hash(\%local_domains, '/var/amavis/local_domains');
    #or alternatively(B), using a list of regular expressions:
    # $local_domains_re = new_RE( qr'[@.]example\.com$'i );
    # see README.lookups for syntax and semantics
    # Section II - MTA specific (defaults should be ok)
    # if $relayhost_is_client is true, IP address in $notify_method and
    # $forward_method is dynamically overridden with SMTP client peer address
    # if available, which makes possible for several hosts to share one daemon
    #$relayhost_is_client = 1; # (defaults to false)
    #$insert_received_line = 1; # behave like MTA: insert 'Received:' header
    # (does not apply to sendmail/milter)
    # (default is true)
    # AMAVIS-CLIENT PROTOCOL INPUT SETTINGS (e.g. with sendmail milter)
    # (used with amavis helper clients like amavis-milter.c and amavis.c,
    # NOT needed for Postfix and Exim)
    $unix_socketname = "$MYHOME/amavisd.sock"; # amavis helper protocol socket
    #$unix_socketname = undef; # disable listening on a unix socket
    # (default is undef, i.e. disabled)
    # (usual setting is $MYHOME/amavisd.sock)
    # Do we receive quoted or raw addresses from the helper program?
    # (does not apply to SMTP; defaults to true)
    #$gets_addr_in_quoted_form = 1; # "Bob \"Funny\" Dude"@example.com
    #$gets_addr_in_quoted_form = 0; # Bob "Funny" [email protected]
    # SMTP SERVER (INPUT) PROTOCOL SETTINGS (e.g. with Postfix, Exim v4, ...)
    # (used when MTA is configured to pass mail to amavisd via SMTP or LMTP)
    $inet_socket_port = 10024; # accept SMTP on this local TCP port
    # (default is undef, i.e. disabled)
    # multiple ports may be provided: $inet_socket_port = [10024, 10026, 10028];
    # SMTP SERVER (INPUT) access control
    # - do not allow free access to the amavisd SMTP port !!!
    # when MTA is at the same host, use the following (one or the other or both):
    #$inet_socket_bind = '127.0.0.1'; # limit socket bind to loopback interface
    # (default is '127.0.0.1')
    @inet_acl = qw( 127.0.0.1 ); # allow SMTP access only from localhost IP
    # (default is qw( 127.0.0.1 ) )
    # when MTA (one or more) is on a different host, use the following:
    #@inet_acl = qw(127/8 10.1.0.1 10.1.0.2); # adjust the list as appropriate
    #$inet_socket_bind = undef; # bind to all IP interfaces
    # Example1:
    # @inet_acl = qw( 127/8 10/8 172.16/12 192.168/16 );
    # permit only SMTP access from loopback and rfc1918 private address space
    # Example2:
    # @inet_acl = qw( !192.168.1.12 172.16.3.3 !172.16.3/255.255.255.0
    # 127.0.0.1 10/8 172.16/12 192.168/16 );
    # matches loopback and rfc1918 private address space except host 192.168.1.12
    # and net 172.16.3/24 (but host 172.16.3.3 within 172.16.3/24 still matches)
    # Example3:
    # @inet_acl = qw( 127/8
    # !172.16.3.0 !172.16.3.127 172.16.3.0/25
    # !172.16.3.128 !172.16.3.255 172.16.3.128/25 );
    # matches loopback and both halves of the 172.16.3/24 C-class,
    # split into two subnets, except all four broadcast addresses
    # for these subnets
    # See README.lookups for details on specifying access control lists.
    # Section III - Logging
    # true (e.g. 1) => syslog; false (e.g. 0) => logging to file
    $DO_SYSLOG = 0; # (defaults to false)
    #$SYSLOG_LEVEL = 'user.info'; # (defaults to 'mail.info')
    # Log file (if not using syslog)
    $LOGFILE = "/var/log/amavis.log"; # (defaults to empty, no log)
    #NOTE: levels are not strictly observed and are somewhat arbitrary
    # 0: startup/exit/failure messages, viruses detected
    # 1: args passed from client, some more interesting messages
    # 2: virus scanner output, timing
    # 3: server, client
    # 4: decompose parts
    # 5: more debug details
    $log_level = 4; # (defaults to 0)
    # Customizeable template for the most interesting log file entry (e.g. with
    # $log_level=0) (take care to properly quote Perl special characters like '\')
    # For a list of available macros see README.customize .
    # only log infected messages (useful with log level 0):
    # $log_templ = '[? %#V |[? %#F ||banned filename ([%F|,])]|infected ([%V|,])]#
    # [? %#V |[? %#F ||, from=<%o>, to=[<%R>|,][? %i ||, quarantine %i]]#
    # |, from=<%o>, to=[<%R>|,][? %i ||, quarantine %i]]';
    # log both infected and noninfected messages (default):
    $log_templ = '[? %#V |[? %#F |[?%#D|Not-Delivered|Passed]|BANNED name/type (%F)]|INFECTED (%V)], #
    <%o> -> [<%R>|,][? %i ||, quarantine %i], Message-ID: %m, Hits: %c';
    # Section IV - Notifications/DSN, BOUNCE/REJECT/DROP/PASS destiny, quarantine
    # Select notifications text encoding when Unicode-aware Perl is converting
    # text from internal character representation to external encoding (charset
    # in MIME terminology)
    # to be used in RFC 2047-encoded header field bodies, e.g. in Subject:
    #$hdr_encoding = 'iso-8859-1'; # (default: 'iso-8859-1')
    # to be used in notification body text: its encoding and Content-type.charset
    #$bdy_encoding = 'iso-8859-1'; # (default: 'iso-8859-1')
    # Default template texts for notifications may be overruled by directly
    # assigning new text to template variables, or by reading template text
    # from files. A second argument may be specified in a call to read_text(),
    # specifying character encoding layer to be used when reading from the
    # external file, e.g. 'utf8', 'iso-8859-1', or often just $bdy_encoding.
    # Text will be converted to internal character representation by Perl 5.8.0
    # or later; second argument is ignored otherwise. See PerlIO::encoding,
    # Encode::PerlIO and perluniintro man pages.
    # $notify_sender_templ = read_text('/var/amavis/notify_sender.txt');
    # $notify_virus_sender_templ= read_text('/var/amavis/notify_virus_sender.txt');
    # $notify_virus_admin_templ = read_text('/var/amavis/notify_virus_admin.txt');
    # $notify_virus_recips_templ= read_text('/var/amavis/notify_virus_recips.txt');
    # $notify_spam_sender_templ = read_text('/var/amavis/notify_spam_sender.txt');
    # $notify_spam_admin_templ = read_text('/var/amavis/notify_spam_admin.txt');
    # If notification template files are collectively available in some directory,
    # use read_l10n_templates which calls read_text for each known template.
    # read_l10n_templates('/etc/amavis/en_US');
    # Here is an overall picture (sequence of events) of how pieces fit together
    # (only virus controls are shown, spam controls work the same way):
    # bypass_virus_checks set for all recipients? ==> PASS
    # no viruses? ==> PASS
    # log virus if $log_templ is nonempty
    # quarantine if $virus_quarantine_to is nonempty
    # notify admin if $virus_admin (lookup) nonempty
    # notify recips if $warnvirusrecip and (recipient is local or $warn_offsite)
    # add address extensions for local recipients (when enabled)
    # send (non-)delivery notifications
    # to sender if DSN needed (BOUNCE) or ($warnvirussender and D_PASS)
    # virus_lovers or final_destiny==D_PASS ==> PASS
    # DISCARD (2xx) or REJECT (5xx) (depending on final_*_destiny)
    # Equivalent flow diagram applies for spam checks.
    # If a virus is detected, spam checking is skipped entirely.
    # The following symbolic constants can be used in *destiny settings:
    # D_PASS mail will pass to recipients, regardless of bad contents;
    # D_DISCARD mail will not be delivered to its recipients, sender will NOT be
    # notified. Effectively we lose mail (but will be quarantined
    # unless disabled). Not a decent thing to do for a mailer.
    # D_BOUNCE mail will not be delivered to its recipients, a non-delivery
    # notification (bounce) will be sent to the sender by amavisd-new;
    # Exception: bounce (DSN) will not be sent if a virus name matches
    # $viruses_that_fake_sender_re, or to messages from mailing lists
    # (Precedence: bulk|list|junk);
    # D_REJECT mail will not be delivered to its recipients, sender should
    # preferably get a reject, e.g. SMTP permanent reject response
    # (e.g. with milter), or non-delivery notification from MTA
    # (e.g. Postfix). If this is not possible (e.g. different recipients
    # have different tolerances to bad mail contents and not using LMTP)
    # amavisd-new sends a bounce by itself (same as D_BOUNCE).
    # Notes:
    # D_REJECT and D_BOUNCE are similar, the difference is in who is responsible
    # for informing the sender about non-delivery, and how informative
    # the notification can be (amavisd-new knows more than MTA);
    # With D_REJECT, MTA may reject original SMTP, or send DSN (delivery status
    # notification, colloquially called 'bounce') - depending on MTA;
    # Best suited for sendmail milter, especially for spam.
    # With D_BOUNCE, amavisd-new (not MTA) sends DSN (can better explain the
    # reason for mail non-delivery, but unable to reject the original
    # SMTP session). Best suited to reporting viruses, and for Postfix
    # and other dual-MTA setups, which can't reject original client SMTP
    # session, as the mail has already been enqueued.
    $final_virus_destiny = D_BOUNCE; # (defaults to D_BOUNCE)
    $final_banned_destiny = D_BOUNCE; # (defaults to D_BOUNCE)
    $final_spam_destiny = D_PASS; # (defaults to D_REJECT)
    $final_bad_header_destiny = D_PASS; # (defaults to D_PASS), D_BOUNCE suggested
    # Alternatives to consider for spam:
    # - use D_PASS if clients will do filtering based on inserted mail headers;
    # - use D_DISCARD, if kill_level is set safely high;
    # - use D_BOUNCE instead of D_REJECT if not using milter;
    # There are no sensible alternatives to D_BOUNCE for viruses, but consider:
    # - use D_PASS (or virus_lovers) and $warnvirussender=1 to deliver viruses;
    # - use D_REJECT instead of D_BOUNCE if using milter and under heavy
    # virus storm;
    # Don't bother to set both D_DISCARD and $warn*sender=1, it will get mapped
    # to D_BOUNCE.
    # The separation of *_destiny values into D_BOUNCE, D_REJECT, D_DISCARD
    # and D_PASS made settings $warnvirussender and $warnspamsender only still
    # useful with D_PASS.
    # The following $warn*sender settings are ONLY used when mail is
    # actually passed to recipients ($final_*_destiny=D_PASS, or *_lovers*).
    # Bounces or rejects produce non-delivery status notification anyway.
    # Notify virus sender?
    #$warnvirussender = 1; # (defaults to false (undef))
    # Notify spam sender?
    #$warnspamsender = 1; # (defaults to false (undef))
    # Notify sender of banned files?
    #$warnbannedsender = 1; # (defaults to false (undef))
    # Notify sender of syntactically invalid header containing non-ASCII characters?
    #$warnbadhsender = 1; # (defaults to false (undef))
    # Notify virus (or banned files) RECIPIENT?
    # (not very useful, but some policies demand it)
    #$warnvirusrecip = 1; # (defaults to false (undef))
    #$warnbannedrecip = 1; # (defaults to false (undef))
    # Notify also non-local virus/banned recipients if $warn*recip is true?
    # (including those not matching local_domains*)
    #$warn_offsite = 1; # (defaults to false (undef), i.e. only notify locals)
    # Treat envelope sender address as unreliable and don't send sender
    # notification / bounces if name(s) of detected virus(es) match the list.
    # Note that virus names are supplied by external virus scanner(s) and are
    # not standardized, so virus names may need to be adjusted.
    # See README.lookups for syntax.
    $viruses_that_fake_sender_re = new_RE(
    qr'nimda|hybris|klez|bugbear|yaha|braid|sobig|fizzer|palyh|peido|holar'i );
    # where to send ADMIN VIRUS NOTIFICATIONS (should be a fully qualified address)
    # - the administrator address may be a simple fixed e-mail address (a scalar),
    # or may depend on the SENDER address (e.g. its domain), in which case
    # a ref to a hash table can be specified (specify lower-cased keys,
    # dot is a catchall, see README.lookups).
    # Empty or undef lookup disables virus admin notifications.
    $virus_admin = '[email protected]';
    # $virus_admin = undef; # do not send virus admin notifications (default)
    # $virus_admin = {'not.example.com' => '', '.' => '[email protected]'};
    # $virus_admin = '[email protected]';
    # equivalent to $virus_admin, but for spam admin notifications:
    #$spam_admin = '[email protected]';# $spam_admin = undef; # do not send spam admin notifications (default)
    # $spam_admin = {'not.example.com' => '', '.' => '[email protected]'};
    #advanced example, using a hash lookup table:
    # - $virus_admin = {
    # '[email protected]' => '[email protected]',
    # '.sub1.example.com' => '[email protected]',
    # '.sub2.example.com' => '', # don't send admin notifications
    # 'a.sub3.example.com' => '[email protected]',
    # '.sub3.example.com' => '[email protected]',
    # '.example.com' => '[email protected]', # catchall for our virus senders
    # '.' => '[email protected]', # catchall for the rest
    # whom notification reports are sent from (ENVELOPE SENDER);
    # may be a null reverse path, or a fully qualified address:
    # (admin and recip sender addresses default to $mailfrom
    # for compatibility, which in turn defaults to undef (empty) )
    # If using strings in double quotes, don't forget to quote @, i.e. \@
    $mailfrom_notify_admin = "virusalert\@$mydomain";
    $mailfrom_notify_recip = "virusalert\@$mydomain";
    $mailfrom_notify_spamadmin = "spam.police\@$mydomain";
    # 'From' HEADER FIELD for sender and admin notifications.
    # This should be a replyable address, see rfc1894. Not to be confused
    # with $mailfrom_notify_sender, which is the envelope address and
    # should be empty (null reverse path) according to rfc2821.
    # $hdrfrom_notify_sender = "amavisd-new <postmaster\@$mydomain>";
    # $hdrfrom_notify_sender = 'amavisd-new <[email protected]>';
    # (defaults to: "amavisd-new <postmaster\@$myhostname>")
    # $hdrfrom_notify_admin = $mailfrom_notify_admin;
    # (defaults to: $mailfrom_notify_admin)
    # $hdrfrom_notify_spamadmin = $mailfrom_notify_spamadmin;
    # (defaults to: $mailfrom_notify_spamadmin)
    # whom quarantined messages appear to be sent from (envelope sender)
    $mailfrom_to_quarantine = undef; # original sender if undef, or set explicitly
    # (default is undef)
    # Location to put infected mail into: (applies to 'local:' quarantine method)
    # empty for not quarantining, may be a file (mailbox),
    # or a directory (no trailing slash)
    # (the default value is undef, meaning no quarantine)
    $QUARANTINEDIR = '/var/virusmails';
    #$virus_quarantine_method = "local:virus-%i-%n"; # default
    #$spam_quarantine_method = "local:spam-%b-%i-%n"; # default
    #use the new 'bsmtp:' method as an alternative to the default 'local:'
    #$virus_quarantine_method = "bsmtp:$QUARANTINEDIR/virus-%i-%n.bsmtp";
    #$spam_quarantine_method = "bsmtp:$QUARANTINEDIR/spam-%b-%i-%n.bsmtp";
    # When using the 'local:' quarantine method (default), the following applies:
    # A finer control of quarantining is available through variable
    # $virus_quarantine_to/$spam_quarantine_to. It may be a simple scalar string,
    # or a ref to a hash lookup table, or a regexp lookup table object,
    # which makes possible to set up per-recipient quarantine addresses.
    # The value of scalar $virus_quarantine_to/$spam_quarantine_to (or a
    # per-recipient lookup result from the hash table %$virus_quarantine_to)
    # is/are interpreted as follows:
    # VARIANT 1:
    # empty or undef disables quarantine;
    # VARIANT 2:
    # a string NOT containg an '@';
    # amavisd will behave as a local delivery agent (LDA) and will quarantine
    # viruses to local files according to hash %local_delivery_aliases (pseudo
    # aliases map) - see subroutine mail_to_local_mailbox() for details.
    # Some of the predefined aliases are 'virus-quarantine' and 'spam-quarantine'.
    # Setting $virus_quarantine_to ($spam_quarantine_to) to this string will:
    # * if $QUARANTINEDIR is a directory, each quarantined virus will go
    # to a separate file in the $QUARANTINEDIR directory (traditional
    # amavis style, similar to maildir mailbox format);
    # * otherwise $QUARANTINEDIR is treated as a file name of a Unix-style
    # mailbox. All quarantined messages will be appended to this file.
    # Amavisd child process must obtain an exclusive lock on the file during
    # delivery, so this may be less efficient than using individual files
    # or forwarding to MTA, and it may not work across NFS or other non-local
    # file systems (but may be handy for pickup of quarantined files via IMAP
    # for example);
    # VARIANT 3:
    # any email address (must contain '@').
    # The e-mail messages to be quarantined will be handed to MTA
    # for delivery to the specified address. If a recipient address local to MTA
    # is desired, you may leave the domain part empty, e.g. 'infected@', but the
    # '@' character must nevertheless be included to distinguish it from variant 2.
    # This method enables more refined delivery control made available by MTA
    # (e.g. its aliases file, other local delivery agents, dealing with
    # privileges and file locking when delivering to user's mailbox, nonlocal
    # delivery and forwarding, fan-out lists). Make sure the mail-to-be-quarantined
    # will not be handed back to amavisd for checking, as this will cause a loop
    # (hopefully broken at some stage)! If this can be assured, notifications
    # will benefit too from not being unecessarily virus-scanned.
    # By default this is safe to do with Postfix and Exim v4 and dual-sendmail
    # setup, but probably not safe with sendmail milter interface without
    # precaution.
    # (the default value is undef, meaning no quarantine)
    #$virus_quarantine_to = '[email protected]'; # traditional local quarantine
    #$virus_quarantine_to = 'infected@'; # forward to MTA for delivery
    #$virus_quarantine_to = "virus-quarantine\@$mydomain"; # similar
    #$virus_quarantine_to = '[email protected]'; # similar
    #$virus_quarantine_to = undef; # no quarantine
    #$virus_quarantine_to = new_RE( # per-recip multiple quarantines
    # [qr'^user@example\.com$'i => 'infected@'],
    # [qr'^(.*)@example\.com$'i => 'virus-${1}@example.com'],
    # [qr'^(.*)(@[^@])?$'i => 'virus-${1}${2}'],
    # [qr/.*/ => 'virus-quarantine'] );
    # similar for spam
    # (the default value is undef, meaning no quarantine)
    #$spam_quarantine_to = '[email protected]';
    #$spam_quarantine_to = "spam-quarantine\@$mydomain";
    #$spam_quarantine_to = new_RE( # per-recip multiple quarantines
    # [qr'^(.*)@example\.com$'i => 'spam-${1}@example.com'],
    # [qr/.*/ => 'spam-quarantine'] );
    # In addition to per-recip quarantine, a by-sender lookup is possible. It is
    # similar to $spam_quarantine_to, but the lookup key is the sender address:
    #$spam_quarantine_bysender_to = undef; # dflt: no by-sender spam quarantine
    # Add X-Virus-Scanned header field to mail?
    $X_HEADER_TAG = 'X-Virus-Scanned'; # (default: undef)
    # Leave empty to add no header field # (default: undef)
    $X_HEADER_LINE = "by amavisd-new at $mydomain";
    $remove_existing_x_scanned_headers = 0; # leave existing X-Virus-Scanned alone
    #$remove_existing_x_scanned_headers= 1; # remove existing headers
    # (defaults to false)
    $remove_existing_spam_headers = 0; # leave existing X-Spam* headers alone
    #$remove_existing_spam_headers = 1; # remove existing spam headers if
    # spam scanning is enabled (default)
    # set $bypass_decode_parts to true if you only do spam scanning, or if you
    # have a good virus scanner that can deal with compression and recursively
    # unpacking archives by itself, and save amavisd the trouble.
    # Disabling decoding also causes banned_files checking to only see
    # MIME names and MIME content types, not the content classification types
    # as provided by the file(1) utility.
    # It is a double-edged sword, make sure you know what you are doing!
    #$bypass_decode_parts = 1; # (defaults to false)
    # don't trust this file type or corresponding unpacker for this file type,
    # keep both the original and the unpacked file
    # (lookup key is what file(1) utility returned):
    $keep_decoded_original_re = new_RE(
    qr'^(ASCII|text|uuencoded|xxencoded|binhex)'i,
    # Checking for banned MIME types and names. If any mail part matches,
    # the whole mail is rejected, much like the way viruses are handled.
    # A list in object $banned_filename_re can be defined to provide a list
    # of Perl regular expressions to be matched against each part's:
    # * Content-Type value (both declared and effective mime-type),
    # including the possible security risk content types
    # message/partial and message/external-body, as specified by rfc2046;
    # * declared (recommended) file names as specified by MIME subfields
    # Content-Disposition.filename and Content-Type.name, both in their
    # raw (encoded) form and in rfc2047-decoded form if applicable;
    # * file content type as guessed by 'file(1)' utility, both the raw result
    # from file(1), as well as short type name, classified into names such as
    # .asc, .txt, .html, .doc, .jpg, .pdf, .zip, .exe, ..., which is always
    # beginning with a dot - see subroutine determine_file_types().
    # This step is done only if $bypass_decode_parts is not true.
    # * leave $banned_filename_re undefined to disable these checks
    # (giving an empty list to new_RE() will also always return false)
    $banned_filename_re = new_RE(
    qr'\.[a-zA-Z][a-zA-Z0-9]{0,3}\.(vbs|pif|scr|bat|com|exe|dll)$'i, # double extension
    # qr'.\.(exe|vbs|pif|scr|bat|com)$'i, # banned extension - basic
    # qr'.\.(ade|adp|bas|bat|chm|cmd|com|cpl|crt|exe|hlp|hta|inf|ins|isp|js|
    # jse|lnk|mdb|mde|msc|msi|msp|mst|pcd|pif|reg|scr|sct|shs|shb|vb|
    # vbe|vbs|wsc|wsf|wsh)$'ix, # banned extension - long
    # qr'^\.(exe|zip|lha|tnef)$'i, # banned file(1) types
    # qr'^application/x-msdownload$'i, # banned MIME types
    # qr'^message/partial$'i, qr'^message/external-body$'i, # rfc2046
    # See http://support.microsoft.com/default.aspx?scid=kb;EN-US;q262631
    # and http://www.cknow.com/vtutor/vtextensions.htm
    # A little trick: a pattern qr'\.exe$' matches both a short type name '.exe',
    # as well as any file name which happens to end with .exe. If only matching
    # a file name is desired, but not the short name, a pattern qr'.\.exe$'i
    # or similar may be used, which requires that at least one character preceeds
    # the '.exe', and so it will never match short file types, which always start
    # with a dot.
    # Section V - Per-recipient and per-sender handling, whitelisting, etc.
    # %virus_lovers, @virus_lovers_acl and $virus_lovers_re lookup tables:
    # (these should be considered policy options, they do not disable checks,
    # see bypas*checks for that!)
    # Exclude certain RECIPIENTS from virus filtering by adding their lower-cased
    # envelope e-mail address (or domain only) to the hash %virus_lovers, or to
    # the access list @virus_lovers_acl - see README.lookups and examples.
    # Make sure the appropriate form (e.g. external/internal) of address
    # is used in case of virtual domains, or when mapping external to internal
    # addresses, etc. - this is MTA-specific.
    # Notifications would still be generated however (see the overall
    # picture above), and infected mail (if passed) gets additional header:
    # X-AMaViS-Alert: INFECTED, message contains virus: ...
    # (header not inserted with milter interface!)
    # NOTE (milter interface only): in case of multiple recipients,
    # it is only possible to drop or accept the message in its entirety - for all
    # recipients. If all of them are virus lovers, we'll accept mail, but if
    # at least one recipient is not a virus lover, we'll discard the message.
    # %bypass_virus_checks, @bypass_virus_checks_acl and $bypass_virus_checks_re
    # lookup tables:
    # (this is mainly a time-saving option, unlike virus_lovers* !)
    # Similar in concept to %virus_lovers, a hash %bypass_virus_checks,
    # access list @bypass_virus_checks_acl and regexp list $bypass_virus_checks_re
    # are used to skip entirely the decoding, unpacking and virus checking,
    # but only if ALL recipients match the lookup.
    # %bypass_virus_checks/@bypass_virus_checks_acl/$bypass_virus_checks_re
    # do NOT GUARANTEE the message will NOT be checked for viruses - this may
    # still happen when there is more than one recipient for a message, and
    # not all of them match these lookup tables. To guarantee virus delivery,
    # a recipient must also match %virus_lovers/@virus_lovers_acl lookups
    # (but see milter limitations above),
    # NOTE: it would not be clever to base virus checks on SENDER address,
    # since there are no guarantees that it is genuine. Many viruses
    # and spam messages fake sender address. To achieve selective filtering
    # based on the source of the mail (e.g. IP address, MTA port number, ...),
    # use mechanisms provided by MTA if available.
    # Similar to lookup tables controlling virus checking, there exist
    # spam scanning, banned names/types, and headers_checks control counterparts:
    # %spam_lovers, @spam_lovers_acl, $spam_lovers_re
    # %banned_files_lovers, @banned_files_lovers_acl, $banned_files_lovers_re
    # %bad_header_lovers, @bad_header_lovers_acl, $bad_header_lovers_re
    # and:
    # %bypass_spam_checks/@bypass_spam_checks_acl/$bypass_spam_checks_re
    # %bypass_banned_checks/@bypass_banned_checks_acl/$bypass_banned_checks_re
    # %bypass_header_checks/@bypass_header_checks_acl/$bypass_header_checks_re
    # See README.lookups for details about the syntax.
    # The following example disables spam checking altogether,
    # since it matches any recipient e-mail address (any address
    # is a subdomain of the top-level root DNS domain):
    # @bypass_spam_checks_acl = qw( . );
    # @bypass_header_checks_acl = qw( [email protected] );
    # @bad_header_lovers_acl = qw( [email protected] );
    # See README.lookups for further detail, and examples below.
    # $virus_lovers{lc("postmaster\@$mydomain")} = 1;
    # $virus_lovers{lc('[email protected]')} = 1;
    # $virus_lovers{lc('[email protected]')} = 1;
    # $virus_lovers{lc('some.user@')} = 1; # this recipient, regardless of domain
    # $virus_lovers{lc('[email protected]')} = 0; # never, even if domain matches
    # $virus_lovers{lc('example.com')} = 1; # this domain, but not its subdomains
    # $virus_lovers{lc('.example.com')}= 1; # this domain, including its subdomains
    #or:
    # @virus_lovers_acl = qw( [email protected] !lab.xxx.com .xxx.com yyy.org );
    # $bypass_virus_checks{lc('[email protected]')} = 1;
    # @bypass_virus_checks_acl = qw( some.ddd !butnot.example.com .example.com );
    # @virus_lovers_acl = qw( [email protected] );
    # $virus_lovers_re = new_RE( qr'(helpdesk|postmaster)@example\.com$'i );
    # $spam_lovers{lc("postmaster\@$mydomain")} = 1;
    # $spam_lovers{lc('[email protected]')} = 1;
    # $spam_lovers{lc('[email protected]')} = 1;
    # @spam_lovers_acl = qw( !.example.com );
    # $spam_lovers_re = new_RE( qr'^user@example\.com$'i );
    # don't run spam check for these RECIPIENT domains:
    # @bypass_spam_checks_acl = qw( d1.com .d2.com a.d3.com );
    # or the other way around (bypass check for all BUT these):
    # @bypass_spam_checks_acl = qw( !d1.com !.d2.com !a.d3.com . );
    # a practical application: don't check outgoing mail for spam:
    # @bypass_spam_checks_acl = ( "!.$mydomain", "." );
    # (a downside of which is that such mail will not count as ham in SA bayes db)
    # Where to find SQL server(s) and database to support SQL lookups?
    # A list of triples: (dsn,user,passw). (dsn = data source name)
    # Specify more than one for multiple (backup) SQL servers.
    # See 'man DBI', 'man DBD::mysql', 'DBD::Pg', ... for details.
    # @lookup_sql_dsn =
    # ( ['DBI:mysql:mail:host1', 'some-username1', 'some-password1'],
    # ['DBI:mysql:mail:host2', 'some-username2', 'some-password2'] );
    # ('mail' in the example is the database name, choose what you like)
    # With PostgreSQL the dsn (first element of the triple) may look like:
    # 'DBI:Pg:host=host1;dbname=mail'
    # The SQL select clause to fetch per-recipient policy settings.
    # The %k will be replaced by a comma-separated list of query addresses
    # (e.g. full address, domain only, catchall). Use ORDER, if there
    # is a chance that multiple records will match - the first match wins.
    # If field names are not unique (e.g. 'id'), the later field overwrites the
    # earlier in a hash returned by lookup, which is why we use '*,users.id'.
    # No need to uncomment the following assignment if the default is ok.
    # $sql_select_policy = 'SELECT *,users.id FROM users,policy'.
    # ' WHERE (users.policy_id=policy.id) AND (users.email IN (%k))'.
    # ' ORDER BY users.priority DESC';
    # The SQL select clause to check sender in per-recipient whitelist/blacklist
    # The first SELECT argument '?' will be users.id from recipient SQL lookup,
    # the %k will be sender addresses (e.g. full address, domain only, catchall).
    # The default value is:
    # $sql_select_white_black_list = 'SELECT wb FROM wblist,mailaddr'.
    # ' WHERE (rid=?) AND (sid=mailaddr.id) AND (mailaddr.email IN (%k))'.
    # ' ORDER BY mailaddr.priority DESC';
    # To disable SQL white/black list, set to undef (otherwise comment-out
    # the following statement, leaving it at the default value):
    $sql_select_white_black_list = undef; # undef disables SQL white/blacklisting
    # If you decide to pass viruses (or spam) to certain recipients using the
    # above lookup tables or using $final_virus_destiny=1, you can set
    # the variable $addr_extension_virus ($addr_extension_spam) to some
    # string, and the recipient address will have this string appended
    # as an address extension to the local-part of the address. This extension
    # can be used by final local delivery agent to place such mail in different
    # folders. Leave these two variables undefined or empty strings to prevent
    # appending address extensions. Setting has no effect on recipient which will
    # not be receiving viruses/spam. Recipients who do not match lookup tables
    # local_domains* are not affected.
    # LDAs usually default to stripping away address extension if no special
    # handling is specified, so having this option enabled normally does no harm,
    # provided the $recipients_delimiter matches the setting on the final
    # MTA's LDA.
    # $addr_extension_virus = 'virus'; # (default is undef, same as empty)
    # $addr_extension_spam = 'spam'; # (default is undef, same as empty)
    # $addr_extension_banned = 'banned'; # (default is undef, same as empty)
    # Delimiter between local part of the recipient address and address extension
    # (which can optionally be added, see variables $addr_extension_virus and
    # $addr_extension_spam). E.g. recipient address <[email protected]> gets changed
    # to <[email protected]>.
    # Delimiter should match equivalent (final) MTA delimiter setting.
    # (e.g. for Postfix add 'recipient_delimiter = +' to main.cf)
    # Setting it to an empty string or to undef disables this feature
    # regardless of $addr_extension_virus and $addr_extension_spam settings.
    $recipient_delimiter = '+'; # (default is '+')
    # true: replace extension; false: append extension
    # $replace_existing_extension = 1; # (default is false)
    # Affects matching of localpart of e-mail addresses (left of '@')
    # in lookups: true = case sensitive, false = case insensitive
    $localpart_is_case_sensitive = 0; # (default is false)
    # ENVELOPE SENDER WHITELISTING / BLACKLISTING - GLOBAL (RECIPIENT-INDEPENDENT)
    # WHITELISTING: use ENVELOPE SENDER lookups to ENSURE DELIVERY from whitelisted
    # senders even if the message is recognized as spam. Effectively, for the
    # specified senders, message RECIPIENTS temporarily become 'spam_lovers', with
    # further processing being the same as otherwise specified for spam lovers.
    # It does not turn off inserting spam-related headers, if they are enabled.
    # BLACKLISTING: messages from specified SENDERS are DECLARED SPAM.
    # Effectively, for messages from blacklisted senders, spam level
    # is artificially pushed high, and the normal spam processing applies,
    # resulting in 'X-Spam-Flag: YES', high 'X-Spam-Level' bar and other usual
    # reactions to spam, including possible rejection. If the message nevertheless
    # still passes (e.g. for spam loving recipients), it is tagged as BLACKLISTED
    # in the 'X-Spam-Status' header field, but the reported spam value and
    # set of tests in this report header field (if available from SpamAssassin,
    # which may have not been called) is not adjusted.
    # A sender may be both white- and blacklisted at the same time,
    # settings are independent. For example, being both white- and blacklisted,
    # message is delivered to recipients, but is tagged as spam.
    # If ALL recipients of the message either white- or blacklist the sender,
    # spam scanning (calling the SpamAssassin) is bypassed, saving on time.
    # The following variables (lookup tables) are available, with the semantics
    # and syntax as specified in README.lookups:
    # %whitelist_sender, @whitelist_sender_acl, $whitelist_sender_re
    # %blacklist_sender, @blacklist_sender_acl, $blacklist_sender_re
    # SOME EXAMPLES:
    #ACL:
    # @whitelist_sender_acl = qw( .example.com );
    # @whitelist_sender_acl = ( ".$mydomain" ); # $mydomain and its subdomains
    # NOTE: This is not a reliable way of turning off spam checks for
    # locally-originating mail, as sender address can easily be faked.
    # To reliably avoid spam-scanning outgoing mail,
    # use @bypass_spam_checks_acl .
    #RE:
    # $whitelist_sender_re = new_RE(
    # qr'^postmaster@.*\bexample\.com$'i,
    # qr'^owner-[^@]*@'i, qr'-request@'i,
    # qr'\.example\.com$'i );
    $blacklist_sender_re = new_RE(
    qr'^(bulkmail|offers|cheapbenefits|earnmoney|foryou|greatcasino)@'i,
    qr'^(investments|lose_weight_today|market.alert|money2you|MyGreenCard)@'i,
    qr'^(new\.tld\.registry|opt-out|opt-in|optin|saveonlsmoking2002k)@'i,
    qr'^(specialoffer|specialoffers|stockalert|stopsnoring|wantsome)@'i,
    qr'^(workathome|yesitsfree|your_friend|greatoffers)@'i,
    qr'^(inkjetplanet|marketopt|MakeMoney)\d*@'i,
    #HASH lookup variant:
    # NOTE: Perl operator qw splits its argument string by whitespace
    # and produces a list. This means that addresses can not contain
    # whitespace, and there is no provision for comments within the string.
    # You can use the normal Perl list syntax if you have special requirements,
    # e.g. map {...} ('one user@bla', '.second.com'), or use read_hash to read
    # addresses from a file.
    # a hash lookup table can be read from a file,
    # one address per line, comments and empty lines are permitted:
    # read_hash(\%whitelist_sender, '/var/amavis/whitelist_sender');
    # ... or set directly:
    # $whitelist_sender{''} = 1; # don't spam-check MTA bounces
    map { $whitelist_sender{lc($_)}=1 } (qw(
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    returns.groups.yahoo.com
    # ENVELOPE SENDER WHITELISTING / BLACKLISTING - PER-RECIPIENT
    # The same semantics as for global white/blacklisting applies, but this
    # time each recipient (or its domain, or subdomain, ...) can be given
    # an individual lookup table for matching senders. The per-recipient lookups
    # override the global lookups, which serve as a fallback default.
    # Specify a two-level lookup table: the key for the outer table is recipient,
    # and the result should be an inner lookup table (hash or ACL or RE),
    # where the key used will be the sender.
    #$per_recip_blacklist_sender_lookup_tables = {
    # '[email protected]'=>new_RE(qr'^(inkjetplanet|marketopt|MakeMoney)\d*@'i),
    # '[email protected]'=>[qw( [email protected],org .d2.example,org )],
    #$per_recip_whitelist_sender_lookup_tables = {
    # '[email protected]' => [qw( [email protected] .other.example.org )],
    # '.my1.example.com' => [qw( !foe.other.example,org .other.example,org )],
    # '.my2.example.com' => read_hash('/var/amavis/my2-wl.dat'),
    # 'abuse@' => { 'postmaster@'=>1,
    # '[email protected]'=>1, '[email protected]'=>1 },
    # Section VI - Resource limits
    # Sanity limit to the number of allowed recipients per SMTP transaction
    # $smtpd_recipient_limit = 1000; # (default is 1000)
    # Resource limitations to protect against mail bombs (e.g. 42.zip)
    # Maximum recursion level for extraction/decoding (0 or undef disables limit)
    $MAXLEVELS = 14; # (default is undef, no limit)
    # Maximum number of extracted files (0 or undef disables the limit)
    $MAXFILES = 1500; # (default is undef, no limit)
    # For the cumulative total of all decoded mail parts we set max storage size
    # to defend against mail bombs. Even though parts may be deleted (replaced
    # by decoded text) during decoding, the size they occupied is _not_ returned
    # to the quota pool.
    # Parameters to storage quota formula for unpacking/decoding/decompressing
    # Formula:
    # quota = max($MIN_EXPANSION_QUOTA,
    # $mail_size*$MIN_EXPANSION_FACTOR,
    # min($MAX_EXPANSION_QUOTA, $mail_size*$MAX_EXPANSION_FACTOR))
    # In plain words (later condition overrules previous ones):
    # allow MAX_EXPANSION_FACTOR times initial mail size,
    # but not more than MAX_EXPANSION_QUOTA,
    # but not less than MIN_EXPANSION_FACTOR times initial mail size,
    # but never less than MIN_EXPANSION_QUOTA
    $MIN_EXPANSION_QUOTA = 100*1024; # bytes (default undef, not enforced)
    $MAX_EXPANSION_QUOTA = 300*1024*1024; # bytes (default undef, not enforced)
    $MIN_EXPANSION_FACTOR = 5; # times original mail size (must be specified)
    $MAX_EXPANSION_FACTOR = 500; # times original mail size (must be specified)
    # Section VII - External programs, virus scanners
    # Specify a path string, which is a colon-separated string of directories
    # (no trailing slashes!) to be assigned to the environment variable PATH
    # and to serve for locating external programs below.
    # NOTE: if $daemon_chroot_dir is nonempty, the directories will be
    # relative to the chroot directory specified;
    $path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin';
    # Specify one string or a search list of strings (first match wins).
    # The string (or: each string in a list) may be an absolute path,
    # or just a program name, to be located via $path;
    # Empty string or undef (=default) disables the use of that external program.
    # Optionally command arguments may be specified - only the first substring
    # up to the whitespace is used for file searching.
    $file = 'file'; # file(1) utility; use 3.41 or later to avoid vulnerability
    $gzip = 'gzip';
    $bzip2 = 'bzip2';
    $lzop = 'lzop';
    $uncompress = ['uncompress', 'gzip -d', 'zcat'];
    $unfreeze = ['unfreeze', 'freeze -d', 'melt', 'fcat'];
    $arc = ['nomarch', 'arc'];
    $unarj = ['arj', 'unarj']; # both can extract, same options
    $unrar = ['rar', 'unrar']; # both can extract, same options
    $zoo = 'zoo';
    $lha = 'lha';
    $cpio = 'cpio';
    # SpamAssassin settings
    # $sa_local_tests_only is passed to Mail::SpamAssassin::new as a value
    # of the option local_tests_only. See Mail::SpamAssassin man page.
    # If set to 1, no tests that require internet access will be performed.
    $sa_local_tests_only = 1; # (default: false)
    #$sa_auto_whitelist = 1; # turn on AWL (default: false)
    $sa_mail_body_size_limit = 64*1024; # don't waste time on SA if mail is larger
    # (less than 1% of spam is > 64k)
    # default: undef, no limitations
    # default values, can be overridden by more specific lookups, e.g. SQL
    $sa_tag_level_deflt = -999; # add spam info headers if at, or above that level
    $sa_tag2_level_deflt = 3.0; # add 'spam detected' headers at that level
    $sa_kill_level_deflt = 22.0;
    #$sa_kill_level_deflt = $sa_tag2_level_deflt; # triggers spam evasive actions
    # at or above that level: bounce/reject/drop,
    # quarantine, and adding mail address extension
    # The $sa_tag_level_deflt, $sa_tag2_level_deflt and $sa_kill_level_deflt
    # may also be hashrefs to hash lookup tables, to make static per-recipient
    # settings possible without having to resort to SQL or LDAP lookups.
    # a quick reference:
    # tag_level controls adding the X-Spam-Status and X-Spam-Level headers,
    # tag2_level controls adding 'X-Spam-Flag: YES', and editing Subject,
    # kill_level controls 'evasive actions' (reject, quarantine, extensions);
    # it only makes sense to maintain the relationship:
    # tag_level <= tag2_level <= kill_level
    # string to prepend to Subject header field when message exceeds tag2 level
    $sa_spam_subject_tag = '*** JUNK MAIL ***'; # (defaults to undef, disables)
    # (only seen when spam is not to be rejected
    # and recipient is in local_domains*)
    $sa_spam_modifies_subj = 1; # may be a ref to a lookup table, default is true
    # Example: modify Subject for all local recipients except [email protected]
    #$sa_spam_modifies_subj = [qw( [email protected] . )];
    # @av_scanners is a list of n-tuples, where fields semantics is:
    # 1. av scanner plain name, to be used in log and reports;
    # 2. scanner program name; this string will be submitted to subroutine
    # find_external_programs(), which will try to find the full program
    # path name; if program is not found, this scanner is disabled.
    # Besides a simple string (full program path name or just the basename
    # to be looked for in PATH), this may be an array ref of alternative
    # program names or full paths - the first match in the list will be used;
    # As a special case for more complex scanners, this field may be
    # a subroutine reference, and the whole n-tuple is passed to it as args.
    # 3. command arguments to be given to the scanner program;
    # a substring {} will be replaced by the directory name to be scanned,
    # i.e. "$tempdir/parts"
    # 4. an array ref of av scanner exit status values, or a regexp (to be
    # matched against scanner output), indicating NO VIRUSES found;
    # 5. an array ref of av scanner exit status values, or a regexp (to be
    # matched against scanner output), indicating VIRUSES WERE FOUND;
    # Note: the virus match prevails over a 'not found' match, so it is safe
    # even if 4. matches for viruses too;
    # 6. a regexp (to be matched against scanner output), returning a list
    # of virus names found.
    # 7. and 8.: (optional) subroutines to be executed before and after scanner
    # (e.g. to set environment or current directory);
    # see examples for these at KasperskyLab AVP and Sophos sweep.
    # NOTES:
    # - NOT DEFINING @av_scanners (e.g. setting it to empty list, or deleting the
    # whole assignment) TURNS OFF LOADING AND COMPILING OF THE ANTIVIRUS CODE
    # (which can be handy if all you want to do is spam scanning);
    # - the order matters: although _all_ available entries from the list are
    # always tried regardless of their verdict, scanners are run in the order
    # specified: the report from the first one detecting a virus will be used
    # (providing virus names and scanner output); REARRANGE THE ORDER TO WILL;
    # - it doesn't hurt to keep an unused command line scanner entry in the list
    # if the program can not be found; the path search is only performed once
    # during the program startup;
    # CORROLARY: to disable a scanner that _does_ exist on your system,
    # comment out its entry or use undef or '' as its program name/path
    # (second parameter). An example where this is almost a must: disable
    # Sophos 'sweep' if you have its daemonized version Sophie or SAVI-Perl
    # (same for Trophie/vscan, and clamd/clamscan), or if another unrelated
    # program happens to have a name matching one of the entries ('sweep'
    # again comes to mind);
    # - it DOES HURT to keep unwanted entries which use INTERNAL SUBROUTINES
    # for interfacing (where the second parameter starts with \&).
    # Keeping such entry and not having a corresponding virus scanner daemon
    # causes an unnecessary connection attempt (which eventually times out,
    # but it wastes precious time). For this reason the daemonized entries
    # are commented in the distribution - just remove the '#' where needed.
    @av_scanners = (
    # ### http://www.vanja.com/tools/sophie/
    # ['Sophie',
    # \&ask_daemon, ["{}/\n", '/var/run/sophie'],
    # qr/(?x)^ 0+ ( : | [\000\r\n]* $)/, qr/(?x)^ 1 ( : | [\000\r\n]* $)/,
    # qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/ ],
    # ### http://www.csupomona.edu/~henson/www/projects/SAVI-Perl/
    # ['Sophos SAVI', \&sophos_savi ],
    # ### http://clamav.elektrapro.com/
    # ['Clam Antivirus-clamd',
    # \&ask_daemon, ["CONTSCAN {}\n", '/var/amavis/clamd'],
    # qr/\bOK$/, qr/\bFOUND$/,
    # qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
    # # NOTE: run clamd under the same user as amavisd,
    # # match the socket name in clamav.conf to the socket name in this entry
    # ### http://www.openantivirus.org/
    # ['OpenAntiVirus ScannerDaemon (OAV)',
    # \&ask_daemon, ["SCAN {}\n", '127.0.0.1:8127'],
    # qr/^OK/, qr/^FOUND: /, qr/^FOUND: (.+)/ ],
    # ### http://www.vanja.com/tools/trophie/
    # ['Trophie',
    # \&ask_daemon, ["{}/\n", '/var/run/trophie'],
    # qr/(?x)^ 0+ ( : | [\000\r\n]* $)/, qr/(?x)^ 1 ( : | [\000\r\n]* $)/,
    # qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/ ],
    # ### http://www.f-prot.com/
    # ['FRISK F-Prot Daemon',
    # \&ask_daemon,
    # ["GET {}/*?-dumb%20-archive HTTP/1.0\r\n\r\n",
    # ['127.0.0.1:10200','127.0.0.1:10201','127.0.0.1:10202',
    # '127.0.0.1:10203','127.0.0.1:10204'] ],
    # qr/(?i)<summary[^>]*>clean<\/summary>/,
    # qr/(?i)<summary[^>]*>infected<\/summary>/,
    # qr/(?i)<name>(.+)<\/name>/ ],
    ['KasperskyLab AntiViral Toolkit Pro (AVP)', ['avp','kavscanner'],
    "-* -P -B -Y -O- {}", [0,3,8], [2,4], # any use for -A -K ?
    qr/infected: (.+)/,
    sub {chdir('/opt/AVP') or die "Can't chdir to AVP: $!"},
    sub {chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!"},
    ['KasperskyLab AVPDaemonClient',
    [ '/opt/AVP/kavdaemon', 'kavdaemon',
    '/opt/AVP/AvpDaemonClient', 'AvpDaemonClient',
    '/opt/AVP/AvpTeamDream', 'AvpTeamDream',
    '/opt/AVP/avpdc', 'avpdc' ],
    '{}', [0,8], [3,4,5,6], qr/infected: ([^\r\n]+)/ ],
    # change the startup-script in /etc/init.d/kavd to:
    # DPARMS="-I0 -Y -* /var/amavis"
    # adjusting /var/amavis above to match your $TEMPBASE.
    # NOTE: cd /opt/AVP/DaemonClients; configure; cd Sample; make
    # cp AvpDaemonClient /opt/AVP/
    ### http://www.hbedv.com/ or http://www.centralcommand.com/
    ['H+BEDV AntiVir or CentralCommand Vexira Antivirus',
    ['antivir','vexira'],
    '--allfiles -noboot -nombr -rs -s -z {}', [0], qr/ALERT:|VIRUS:/,
    qr/(?x)^\s* (?: ALERT: \s* (?: \[ | [^']* ' ) |
    (?i) VIRUS:\ .*?\ virus\ '?) ( [^\]\s']+ )/ ],
    # NOTE: remove the -z if you only have a demo version
    ### http://www.commandsoftware.com/
    ['Command AntiVirus for Linux', 'csav',
    '-all -archive -packed {}', [50], [51,52,53],
    qr/Infection: (.+)/ ],
    ### http://www.symantec.com/
    ['Symantec CarrierScan via Symantec CommandLineScanner',
    ['cscmdline','savsecls'],
    '-a scan -i 1 -v -s 127.0.0.1:7777 {}',
    qr/Files Infected: 0/, qr/^Infected: /,
    qr/Info:\s+(.+)/ ],
    ### http://drweb.imshop.de/
    ['DrWeb Antivirus for Linux/FreeBSD/Solaris', 'drweb',
    '-al -ar -fm -go -ha -ml -ot -sd -up {}',
    [0], [1], sub {('no-name')} ],
    ### http://www.f-secure.com/products/anti-virus/
    ['F-Secure Antivirus', 'fsav',
    '--dumb --archive {}', [0], [3,8],
    qr/(?:infection|Infected): (.+)/ ],
    ['CAI InoculateIT', 'inocucmd',
    '-sec -nex {}', [0], [100],
    qr/was infected by virus (.+)/ ],
    ['MkS_Vir for Linux (beta)', ['mks32','mks'],
    '-s {}/*', [0], [1,2],
    qr/--[ \t]*(.+)/ ],
    ['MkS_Vir daemon',
    'mksscan', '-s -q {}', [0], [1..7],
    qr/^... (\S+)/ ],
    ### http://www.nod32.com/
    ['ESET Software NOD32', 'nod32',
    '-all -subdir+ {}', [0], [1,2],
    qr/^.+? - (.+?)\s*(?:backdoor|joke|trojan|virus|worm)/ ],
    ### http://www.nod32.com/
    ['ESET Software NOD32 - Client/Server Version', 'nod32cli',
    '-a -r -d recurse --heur standard {}', [0], [10,11],
    qr/^\S+\s+infected:\s+(.+)/ ],
    ### http://www.norman.com/products_nvc.shtml
    ['Norman Virus Control v5 / Linux', 'nvccmd',
    '-c -l:0 -s -u {}', [0], [1],
    qr/(?i).* virus in .* -> \'(.+)\'/ ],
    ### http://www.pandasoftware.com/
    ['Panda Antivirus for Linux', ['pavcl','pavc'],
    '-aut -aex -heu -cmp -nor -nso -eng {}',
    qr/Number of files infected\.*: 0(?!\d)/,
    qr/Number of files infected\.*: 0*[1-9]/,
    qr/Found virus :\s*(\S+)/ ],
    # Check your RAV license terms before fiddling with the following two lines!
    # ['GeCAD RAV AntiVirus 8', 'ravav',
    # '--all --archive --mail {}', [1], [2,3,4,

    You are welcome. I'm glad you got it back up.
    (1) You say you did the symbolic link. I will assume this is set correctly; it's very important that it is.
    (2) I don't know what you mean by "Been feeding the [email protected] for several weeks now, 700 emails each day at least." After the initial training period, SpamAssassin doesn't learn from mail it has already processed correctly. At this point, you only need to teach SpamAssassin when it is wrong. [email protected] should only be getting spam that is being passed as clean. Likewise, [email protected] should only be getting legitimate mail that is being flagged as junk. You are redirecting mail to both [email protected] and [email protected] ... right? SpamAssassin needs both.
    (3) Next, as I said before, you need to implement those "Frontline spam defense for Mac OS X Server." Once you have that done and issue "postfix reload" you can look at your SMTP log in Server Admin and watch as Postfix blocks one piece of junk mail after another. It's kind of cool.
    (4) Add some SARE rules:
    Visit http://www.rulesemporium.com/rules.htm and download the following rules:
    70sareadult.cf
    70saregenlsubj0.cf
    70sareheader0.cf
    70sarehtml0.cf
    70sareobfu0.cf
    70sareoem.cf
    70sarespoof.cf
    70sarestocks.cf
    70sareunsub.cf
    72sare_redirectpost
    Visit http://www.rulesemporium.com/other-rules.htm and download the following rules:
    backhair.cf
    bogus-virus-warnings.cf
    chickenpox.cf
    weeds.cf
    Copy these rules to /etc/mail/spamassassin/
    Then stop and restart mail services.
    There are other things you can do, and you'll find differing opinions about such things. In general, I think implementing the "Frontline spam defense for Mac OS X Server" and adding the SARE rules will help a lot. Good luck!

  • Reg sending mail attachment

    Hi,
    im working on sending report output as mail attachment in pdf format..
    but im not getting the required output,,,i.e., even after entering email addresses in the selection screen....im not getting any mail to the respective mail-ids..
    im pasting the code..pls fix the problem..
    pls let me know wat we have to do in SCOT transaction after executing the program....pls respond ..pls ..
    TABLES : t001,                                         "COMPANY CODE
             knb1,                                         "CUSTOMER MASTER(COMPANY CODE)
             cdhdr,                                        "CHANGE DOCUMENT HEADER
             knkk,                                         "CUSTOMER MASTER CREDIT MANAGEMENT: CONTROL AREA DATA
             kna1,                                         "GENERAL DATA IN CUSTOMER MASTER
             adrc,                                         "ADDRESSES (BUSINESS ADDRESS SERVICES)
             t001s,                                        "ACCOUNTING CLERKS
             adrt,                                         "COMMUNICATION DATA TEXT (BUSINESS ADDRESS SERVICES)
             adr6.                                         "E-MAIL ADDRESSES (BUSINESS ADDRESS SERVICES)
    TABLES: itcpo,                                         "SAPscript output interface
            itcpp.                                         "SAPscript output parameters
    TYPES:   BEGIN OF y_t001,
                      bukrs TYPE bukrs,
                      kkber TYPE kkber,
                      adrnr TYPE adrnr,
             END OF y_t001.
    TYPES:   BEGIN OF y_cust,
                      p_objectid TYPE cdobjectv,
             END OF y_cust.
    TYPES:   BEGIN OF y_knkk,
                      kunnr TYPE kunnr,
                      kkber TYPE kkber,
                      dtrev TYPE dtrev_cm,
                      nxtrv TYPE nxtrv_cm,
                      klimk TYPE klimk,
                      dbwae TYPE dbwae_cm,
             END OF y_knkk.
    TYPES:   BEGIN OF y_customer,
                      kunnr TYPE kunnr,
                      adrnr TYPE adrnr,
             END OF y_customer.
    TYPES:   BEGIN OF y_custo ,
                      kunnr TYPE  kunnr,
                      name  TYPE  name1_gp,
                      kkber TYPE kkber,
             END OF y_custo.
    TYPES:   BEGIN OF y_knkk1,
                      kunnr LIKE knkk-kunnr,
                      dtrev LIKE knkk-dtrev,
                      nxtrv LIKE knkk-nxtrv,
                      klimk LIKE knkk-klimk,
             END OF y_knkk1.
    TYPES:   BEGIN OF y_report_display,
                      kunnr TYPE kunnr,
                      name  TYPE name1_gp,
                      dtrev TYPE dtrev_cm,
                      nxtrv TYPE nxtrv_cm,
                      klimk TYPE klimk,
                      dbwae TYPE dbwae_cm,
             END OF y_report_display.
    TYPES:   BEGIN OF y_adrt,
                      addrnumber TYPE adrnr,
                      comm_type  TYPE ad_comm,
                      remark     TYPE ad_remark2,
                      persnumber TYPE ad_persnum,
                      date_from  TYPE ad_date_fr,
                      consnumber TYPE ad_consnum,
                      smtp_addr  TYPE ad_smtpadr,
              END OF y_adrt.
    *TYPES : BEGIN OF y_adr6,
                     addrnumber TYPE ad_addrnum,
                     persnumber TYPE ad_persnum,
                     date_from  TYPE ad_date_fr,
                     consnumber TYPE ad_consnum,
                     smtp_addr  TYPE ad_smtpadr,
           END OF y_adr6.
    *TYPES:   BEGIN OF y_addr,
                     addrnumber TYPE adrnr,
                     name1  TYPE ad_name1,
                     postcode TYPE ad_pstcd1,
                     city1    TYPE ad_city1,
                     street   TYPE ad_street,
                     housenum TYPE ad_hsnm1,
                     telnum   TYPE ad_tlnmbr1,
                     faxnum   TYPE ad_fxnmbr1,
            END OF y_addr.
    TYPES:   BEGIN OF y_custnam,
                      adrnr TYPE adrnr,
                      name2 TYPE ad_name1,
             END OF y_custnam.
    TYPES:   BEGIN OF y_kna1,
                      kunnr TYPE kunnr,
                      adrnr TYPE adrnr,
                      name1 TYPE name1,
                     END OF y_kna1.
    TYPES:   BEGIN OF y_knb1,
                      kunnr TYPE kunnr,
                      bukrs TYPE bukrs,
                      busab TYPE busab,
             END OF y_knb1.
    TYPES:   BEGIN OF y_clv,
                      dtrev TYPE dtrev_cm,
                      nxtrv TYPE nxtrv_cm,
                      klimk TYPE klimk,
             END OF y_clv.
    TYPES:    BEGIN OF y_ccname,
                       sname TYPE t001s-sname,
              END OF y_ccname.
    *TYPES DECLARATION FOR DESIGING SCRIPT
    TYPES : BEGIN OF y_adrc,
               addrnumber LIKE adrc-addrnumber,
               name1 LIKE adrc-name1,
               post_code1 LIKE adrc-post_code1,
               city1 LIKE adrc-city1,
               street LIKE adrc-street,
               house_num1 LIKE adrc-house_num1,
               tel_number LIKE adrc-tel_number,
               nation LIKE adrc-nation ,
               fax_number LIKE adrc-fax_number,
               country LIKE adrc-country,
               END OF y_adrc.
    *TO GET C1 (CUSTOMER NAME IN RUSSIAN
    TYPES : BEGIN OF y_adrc1,
            addrnumber LIKE adrc-addrnumber,
            name1 LIKE adrc-name1,
            nation LIKE adrc-nation,
            END OF y_adrc1.
    *TO GET C7
    TYPES :BEGIN OF y_t001s,
            bukrs LIKE t001s-bukrs,    "Company Code
            busab LIKE t001s-busab,
            sname LIKE t001s-sname,
            END OF y_t001s.
    CONSTANTS:
    c_printer         LIKE itcpp-tddevice VALUE 'PRINTER',
    c_true(1)         TYPE c VALUE 'X',
    c_1(1)            TYPE n VALUE '1',
    c_pdf_format(3)   TYPE c VALUE 'PDF',
    c_u               LIKE soos1-recesc   VALUE 'U',
    c_recipient_name  LIKE soos1-recnam   VALUE 'U-',
    c_english         LIKE sy-langu       VALUE 'E',
    c_f               LIKE sood1-objsns   VALUE 'F',
    c_int(3)          TYPE c VALUE 'INT',
    c_main(4)         TYPE c VALUE 'ITEM',
    c_main_window(4)  TYPE c VALUE 'MAIN',
    c_header(6)       TYPE c VALUE 'HEADER',
    c_minus_sign(1)   TYPE c VALUE '-',
    c_document_type   LIKE sood-objtp     VALUE 'EXT',
    c_space(1)        TYPE c VALUE ' '.
    DATA t_result LIKE itcpp.
    DATA :w_t001      TYPE t001,
          w_custo     TYPE y_custo,
          w_knkk      TYPE y_knkk,
          w_cust      TYPE y_cust,
          w_customer  TYPE y_customer,
          w_report_display TYPE y_report_display,
         w_addr      TYPE y_addr,
          w_custnam   TYPE y_custnam,
          w_adrt      TYPE y_adrt,
         w_adr6      TYPE y_adr6,
          w_kna1      TYPE y_kna1,
          w_knb1      TYPE y_knb1,
          w_clv       TYPE y_clv,
          w_ccname    TYPE y_ccname.
    DATA:    w_error_found(1)       TYPE c,
             w_key_date_text(30)    TYPE c,
             w_total(10)            TYPE p DECIMALS 2,
             w_htddevice            LIKE itcpp-tddevice.
    DATA: E_PROFILE LIKE SOPRD.
    DATA:   t_t001            TYPE STANDARD TABLE OF y_t001,
            t_custo           TYPE STANDARD TABLE OF y_custo,
          t_knkk            TYPE STANDARD TABLE OF y_knkk,
            t_cust            TYPE STANDARD TABLE OF y_cust,
            t_customer        TYPE STANDARD TABLE OF y_customer,
            t_report_display  TYPE STANDARD TABLE OF y_report_display,
           t_addr            TYPE STANDARD TABLE OF y_addr,
            t_custnam         TYPE STANDARD TABLE OF y_custnam,
            t_adrt            TYPE STANDARD TABLE OF y_adrt,
           t_adr6            TYPE STANDARD TABLE OF y_adr6,
            t_kna1            TYPE STANDARD TABLE OF y_kna1,
            t_knb1            TYPE STANDARD TABLE OF y_knb1,
            t_clv             TYPE STANDARD TABLE OF y_clv,
            t_ccname          TYPE STANDARD TABLE OF y_ccname.
    DATA : number LIKE spell,
           amount(1000) TYPE c.
    For storing error log
    DATA: BEGIN OF t_error OCCURS 0,
            kunnr LIKE kna1-kunnr,
            comm(30) TYPE c,
          END OF t_error.
    For storing customer's email address
    DATA: BEGIN OF t_email OCCURS 0,
            smtp_addr LIKE adr6-smtp_addr,
          END OF t_email.
    To be used in the function to send a layout via email
    DATA: t_otfdata LIKE itcoo OCCURS 0 WITH HEADER LINE,
          t_htline  LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA DECLARATIONS FOR DESIGING SCRIPT
    DATA : it_t001 TYPE STANDARD TABLE OF y_t001,
           wa_t001 TYPE y_t001.
    DATA : it_adrc TYPE STANDARD TABLE OF y_adrc,
            wa_adrc type  y_adrc.
    DATA : it_adrc1 TYPE STANDARD TABLE OF y_adrc1,
           wa_adrc1 TYPE y_adrc1.
    DATA : it_knb1 TYPE STANDARD TABLE OF y_knb1,
           wa_knb1 TYPE y_knb1.
    DATA : it_kna1 TYPE STANDARD TABLE OF y_kna1,
           wa_kna1 TYPE y_kna1.
    DATA : it_knkk TYPE STANDARD TABLE OF y_knkk,
           wa_knkk TYPE y_knkk.
    DATA : it_knkk1 TYPE STANDARD TABLE OF y_knkk1,
           wa_knkk1 TYPE y_knkk1.
    DATA : it_t001s TYPE STANDARD TABLE OF y_t001s,
           wa_t001s TYPE y_t001s.
    *DATA STATEMENTS FOR EMAIL ADDRESSES
    DATA : it_adrt TYPE TABLE OF y_adrt,
           wa_adrt TYPE y_adrt,
           wa_email LIKE t_email.
    *DATA : it_adr6 TYPE TABLE OF y_adr6,
          wa_adr6 TYPE y_adr6,
    DATA : counter TYPE i,
           counter1 TYPE i,
           c5 LIKE spell.
    SELECTION-SCREEN BEGIN OF BLOCK clcn WITH FRAME TITLE text-200.
    SELECTION-SCREEN SKIP.
    PARAMETERS:     p_bukrs LIKE t001-bukrs OBLIGATORY,                    "COMPANY CODE
                    p_kkber LIKE t001-kkber OBLIGATORY.                    "CREDIT CONTROL AREA
    SELECT-OPTIONS: s_kunnr FOR knb1-kunnr OBLIGATORY,                     "CUSTOMER NUMBER
                    s_datum FOR sy-datum OBLIGATORY DEFAULT sy-datum.      "DATE OF CREDIT LIMIT UPDATE
    SELECTION-SCREEN SKIP.
    PARAMETERS : p_simul AS CHECKBOX DEFAULT 'X'.                          "RUN IN SIMULATION MODE
    SELECTION-SCREEN SKIP.
    PARAMETERS : p_lemail LIKE adr6-smtp_addr.                             " EMAIL
    SELECTION-SCREEN END OF BLOCK clcn.
    AT SELECTION-SCREEN.
      PERFORM f0100_validate_bukrs.  "*  For Company Code.
      PERFORM f0200_validate_kkber.  "* For Credit Control Area.
      PERFORM f0300_validate_kunnr.  "* For Customer Number
      PERFORM f0400_validate_datum.  "* For Date of Credit Limit Update
      PERFORM f0500_validate_simul.  "* For simulation mode and e-mail address
    *======================================================================
    START-OF-SELECTION.
      PERFORM f1000_get_customer.          "** COLLECT INFO FOR REPORT DISPLAY
      IF p_simul is initial AND NOT P_lemail IS INITIAL.
        PERFORM F1000_CHECK_GATEWAY_CONNECTION.
      ENDIF.
      IF p_simul IS INITIAL AND  NOT p_lemail IS INITIAL.
        PERFORM f3000_process_data_script USING t_report_display.
      ENDIF.
    END-OF-SELECTION.
      IF NOT p_simul IS INITIAL.
        PERFORM f2000_display_customer USING t_report_display.
      ENDIF.
    FORM f0100_validate_bukrs.
      DATA : w_bukrs TYPE bukrs.
    VALIDATION OF P_BUKRS
      SELECT SINGLE bukrs
                    FROM t001
                    INTO w_bukrs
                    WHERE bukrs EQ p_bukrs.
      IF sy-subrc NE 0.
        MESSAGE e999(zf) WITH 'Invalid Company Code' p_bukrs.   "(E01).
    *AUTHORIZATION CHECK
        AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
                            ID 'BUKRS' FIELD p_bukrs
                            ID 'ACTVT' FIELD '03'.
        IF sy-subrc NE 0.
          MESSAGE e999(zf)  WITH 'No Authorization for company code' p_bukrs."(e06).
        ENDIF.
      ENDIF.
    ENDFORM.                    " F0100_VALIDATE_BUKRS
    *Eject
    *&      Form  F0200_VALIDATE_KKBER
         *-> CREDIT CONTROL AREA AUTHORITY CHECK
    FOR CREDIT CONTROL AREA.
    FORM f0200_validate_kkber.
      DATA : w_kkber LIKE t001-kkber.
      SELECT SINGLE kkber
              FROM t001
              INTO w_kkber
              WHERE bukrs EQ p_bukrs
                AND   kkber EQ p_kkber.
      IF sy-subrc NE 0.
        MESSAGE e999(zf) WITH
       'Credit Control Area' p_kkber 'not defined for Company Code' p_bukrs."(e02).
       MESSAGE e999 WITH text-e02 p_kkber .
      ENDIF.
    ENDFORM.                    "F0200_VALIDATE_KKBER
    *&      Form  F0300_VALIDATE_KUNNR
         *-> CUSTOMER NUMBER AUTHORITY CHECK
    FORM f0300_validate_kunnr.
    VALIDATION OF S_KUNNR
      DATA : w_kunnr TYPE kunnr,
             w_bukrs TYPE bukrs.
      IF s_kunnr IS INITIAL .
        MESSAGE e999 WITH 'Enter Customer Number'(e04).
        SUBMIT (sy-cprog) VIA SELECTION-SCREEN.
      ENDIF.
      LOOP AT s_kunnr.
        CLEAR : w_kunnr,
                w_bukrs.
        IF NOT s_kunnr-low IS INITIAL.
          SELECT SINGLE kunnr bukrs
          FROM knb1 INTO (w_kunnr ,w_bukrs)
          WHERE kunnr EQ s_kunnr-low
          AND bukrs EQ p_bukrs.
          IF sy-subrc NE 0.
            MESSAGE e999(zf)  WITH 'Customer S_KUNNR-LOW not defined in company code' p_bukrs."(e03).
          ENDIF.
        ENDIF. "if not s_kunnr-low is initial.
        IF NOT s_kunnr-high IS INITIAL.
          CLEAR : w_kunnr,
                  w_bukrs.
          SELECT SINGLE kunnr bukrs
          FROM knb1 INTO (w_kunnr , w_bukrs)
          WHERE kunnr EQ s_kunnr-high
          AND bukrs EQ p_bukrs.
          IF sy-subrc NE 0.
            MESSAGE e999(zf)  WITH 'Customer S_KUNNR-HIGH not defined in company code' p_bukrs."(e03).
          ENDIF.
        ENDIF. "if not s_kunnr-high is initial.
      ENDLOOP. " loop at s_kunnr
    ENDFORM.                    " F0200_VALIDATE_KUNNR
    *&      Form  F0400_VALIDATE_DATUM
         *-> DATE OF CREDIT LIMIT UPDATE
    FORM f0400_validate_datum.
      IF s_kunnr IS INITIAL AND s_datum IS INITIAL.
        MESSAGE e999 WITH 'Enter either Date of CL update or Customer number.'(e04).
      ENDIF.
    ENDFORM.                    "F0400_VALIDATE_DATUM
    *&      Form  F1000_GET_CUSTOMER
          text
    -->  p1        text
    <--  p2        text
    FORM f1000_get_customer .
      DATA : w_kunnr LIKE knkk-kunnr,
               w_kkber LIKE knkk-kkber.
      IF s_datum IS NOT INITIAL.
        SELECT objectid
               FROM cdhdr
               INTO TABLE t_cust
               WHERE  objectclas IN ('KLIM','DTREV','NXTRV')
               AND  change_ind IN ('U','I')
               AND udate IN s_datum.
              WHERE ( objectclas EQ 'KLIM' OR objectclas EQ 'DTREV' OR  objectclas EQ 'NXTRV')
              AND  ( change_ind EQ 'U' OR change_ind EQ 'I')
              AND udate IN s_datum .
      ENDIF.
      IF sy-subrc NE 0.
        MESSAGE s999 WITH 'There is no data for selected period'(e07).
      ELSE.
        MOVE t_cust TO t_customer.
      ENDIF.
      SORT t_customer BY kunnr.
      IF NOT t_customer[] IS INITIAL.
        SELECT kunnr
               kkber
               dtrev
               nxtrv
               klimk
               dbwae
               FROM knkk
               INTO TABLE t_knkk
               FOR ALL ENTRIES IN t_customer
               WHERE kunnr = t_customer-kunnr
               AND   kkber = p_kkber.
      ELSE.
        MESSAGE e999 WITH text-e07.
      ENDIF.
      IF sy-subrc NE 0.
      ENDIF.
      SORT t_knkk BY kunnr kkber.
      IF NOT t_knkk[] IS INITIAL.
        SELECT   kunnr
                 name1
        FROM kna1
        INTO TABLE t_custo
        FOR ALL ENTRIES IN t_knkk
        WHERE kunnr = t_knkk-kunnr.
      ENDIF.
      IF sy-subrc = 0.
      ENDIF.
      SORT t_custo BY kunnr kkber.
      LOOP AT t_custo INTO w_custo.
        CLEAR w_knkk.
        READ TABLE t_knkk INTO w_knkk WITH KEY kunnr = w_custo-kunnr
                                      BINARY SEARCH.
        IF sy-subrc = 0.
          w_report_display-kunnr = w_custo-kunnr.
          w_report_display-name  = w_custo-name.
          w_report_display-dtrev = w_knkk-dtrev.
          w_report_display-nxtrv = w_knkk-nxtrv.
          w_report_display-klimk = w_knkk-klimk.
          w_report_display-dbwae = w_knkk-dbwae.
          APPEND w_report_display TO t_report_display .
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " F1000_GET_CUSTOMER
    *&      Form  F2000_DISPLAY_CUSTOMER
          text
         -->P_T_REPORT_DISPLAY  text
    FORM f2000_display_customer  USING    p_t_report_display.
      DATA: no  TYPE n  VALUE 1.
      DATA: t_data TYPE STANDARD TABLE OF y_report_display.
      t_data = p_t_report_display.
      DATA : w_data LIKE LINE OF t_data .
      ULINE (118).
      WRITE:/ sy-vline,
              8 'CREDIT LIMIT CHANGE NOTIFICATION REPORT ON',
              sy-datum , 118 sy-vline.
      ULINE (118).
      WRITE:/ sy-vline,'NO'(008) ,
            10 sy-vline, 11 'CUSTOMER NUMBER',
            28 sy-vline, 29 'CUSTOMER NAME', 43 sy-vline,
            44 'CREDIT LIMIT VALID', 63 sy-vline ,
            64 'CREDIT LIMIT AMOUNT', 85 sy-vline, 86 'CURRENCY',
            95 sy-vline , 96 'Notification Status',118 sy-vline.
      ULINE (118).
      WRITE:/ sy-vline,43 sy-vline, 44 'FROM', 53 sy-vline,
      56 'TILL', 63 sy-vline, 118 sy-vline .
      ULINE (118).
      LOOP AT t_data INTO w_data.
        WRITE:/ sy-vline, no,
              10 sy-vline, 11 w_data-kunnr ,
              28 sy-vline, 29 w_data-name, 43 sy-vline, 44 w_data-dtrev,
              53 sy-vline, 56 w_data-nxtrv ,63 sy-vline ,64 w_data-klimk,
              85 sy-vline, 86 w_data-dbwae,
              95 sy-vline , 118 sy-vline.
        no = no + 1.
        ULINE (118).
      ENDLOOP.
    ENDFORM.                    " F2000_DISPLAY_CUSTOMER
    *&      Form  F3000_PROCESS_DATA_SCRIPT
          text
         -->P_T_REPORT_DISPLAY  text
    FORM f3000_process_data_script  USING    p_t_report_display.
      DATA: t_data TYPE STANDARD TABLE OF y_report_display.
      t_data = p_t_report_display.
      DATA : w_data LIKE LINE OF t_data .
      DATA: temp_is_negative(1) TYPE c,
               temp_text(20)       TYPE c,
               temp_sname          LIKE t001s-sname,
               temp_email          LIKE adr6-smtp_addr.
      DATA : number LIKE spell,
             amount(255) TYPE c.
      PERFORM f3100_initialize_settings.
      LOOP AT t_data INTO w_data.
        AT NEW kunnr.
          CLEAR w_error_found.
          IF p_simul IS INITIAL AND  NOT p_lemail IS INITIAL.
            PERFORM f3300_open_form.
           data:  wa_t001 like line of t001
            DATA : begin of wa_t001,
                   adrnr like t001-adrnr,
                   end of wa_t001.
            SELECT SINGLE
                   adrnr FROM t001 INTO wa_t001
                   WHERE bukrs = p_bukrs.
          DATA: BEGIN OF wa_adrc,
                 addrnumber LIKE adrc-addrnumber,
                 name1 LIKE adrc-name1,
                 post_code1 LIKE adrc-post_code1,
                 city1 LIKE adrc-city1,
                 street LIKE adrc-street,
                 house_num1 LIKE adrc-house_num1,
                 tel_number LIKE adrc-tel_number,
                 nation LIKE adrc-nation ,
                 fax_number LIKE adrc-fax_number,
                 country LIKE adrc-country,
               END OF wa_adrc.
       SELECT SINGLE
                addrnumber
                name1
                post_code1
                city1
                street
                house_num1
                tel_number
                nation
                fax_number
                country
                FROM adrc
                INTO corresponding fields of wa_adrc
                WHERE addrnumber EQ wa_t001-adrnr  AND
                      nation EQ ' '.
            PERFORM f3700_write_form.
            DATA: wa_kna1 LIKE LINE OF t_kna1,
                  wa_adrcc LIKE LINE OF it_adrc.
            SELECT SINGLE
                   kunnr
                   adrnr FROM kna1
                   INTO  wa_kna1
                   WHERE kunnr = w_data-kunnr.
            IF sy-subrc EQ 0.
              SELECT SINGLE
                     addrnumber
                     name1
                     FROM adrc
                     INTO wa_adrcc
                     WHERE addrnumber = wa_kna1-adrnr
                     AND nation = ' '.
            ENDIF.
            PERFORM f3701_write_form.
            DATA : wa_knkk LIKE LINE OF t_knkk.
            DATA : counter TYPE i,
                   counter1 TYPE i.
            IF sy-subrc EQ 0.
          SELECT SINGLE KUNNR
                 DTREV
                 NXTRV
                 KLIMK  FROM KNKK INTO WA_KNKK WHERE
                 KUNNR EQ W_DATA-KUNNR.
            ENDIF.
            CALL FUNCTION 'SPELL_AMOUNT'
             EXPORTING
               amount          = w_knkk-klimk
       CURRENCY        = ' '
       FILLER          = ' '
               language        = sy-langu
             IMPORTING
               in_words        = number.
            IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
            amount = number-word.
            PERFORM f3702_write_form.
            DATA: wa_knb1 LIKE LINE OF t_knb1.
            IF sy-subrc EQ 0.
              SELECT SINGLE
                     busab
                     FROM   knb1
                     INTO   wa_knb1
                     WHERE  kunnr = w_data-kunnr
                     AND    bukrs = p_bukrs.
            ENDIF.
            DATA : wa_t001s LIKE LINE OF it_t001s.
            IF sy-subrc EQ 0.
              SELECT SINGLE bukrs
                 busab
                 sname
                 FROM t001s
                 INTO wa_t001s
                 WHERE bukrs = wa_knb1-bukrs
                 AND busab = wa_knb1-busab.
            ENDIF.
            PERFORM f3703_write_form.
            PERFORM f3704_write_form.
            IF counter1 < counter.
              PERFORM f3705_write_form.
            ENDIF.
            PERFORM f3706_close_form.
          ENDIF.
        ENDAT.
        IF w_error_found EQ c_true.
        ENDIF.
        AT END OF kunnr.
    PERFORM F3400_WRITE_FORM USING C_TOTAL C_MAIN_WINDOW.
         PERFORM F3500_CLOSE_FORM.
          IF p_simul IS INITIAL AND  NOT p_lemail IS INITIAL.       "Email setting
            PERFORM f3200_get_email_addr USING w_data-kunnr.
            PERFORM f3600_send_data_via_email USING w_data-kunnr.
          ENDIF.
        ENDAT.
      ENDLOOP.
      WRITE:/ ' E-Mail is sent to the customer'.
    ENDFORM.                    " F3000_PROCESS_DATA_SCRIPT
    *&      Form  F3100_INITIALIZE_SETTINGS
          text
    -->  p1        text
    <--  p2        text
    FORM f3100_initialize_settings .
      SELECT SINGLE spld
            INTO itcpo-tddest
            FROM usr01
            WHERE bname EQ sy-uname.
      IF sy-subrc NE 0.
        itcpo-tddest = 'LOCAL'.
      ENDIF.
      w_htddevice      = c_printer.
      itcpo-tddest = ''.
      itcpo-tdrdidev = ''.
      itcpo-tdsenddate = sy-datum.
      itcpo-tdsendtime = sy-uzeit.
      itcpo-tdschedule = 'IMM'.
      itcpo-tdimmed = ' '.
    itcpo-tdnewid    = c_true.            "PRINT: New spool request
      itcpo-tdlifetime = c_1.               "PRINT: Spool retention period
      itcpo-tdgetotf   = c_true.
      IF p_simul IS INITIAL AND  NOT p_lemail IS INITIAL.       "Email setting
        itcpo-tdgetotf     = c_true.
      ENDIF.
    ENDFORM.                    " F3100_INITIALIZE_SETTINGS
    *&      Form  f0500_validate_simul
          text
    -->  p1        text
    <--  p2        text
    FORM f0500_validate_simul .
      IF p_simul IS INITIAL AND p_lemail IS INITIAL.       "Email setting
       MESSAGE e999(zf) WITH 'Enter Email address'.            "(e05).
      ENDIF.
    ENDFORM.                    " f0500_validate_simul
    *&      Form  F3600_SEND_DATA_VIA_EMAIL
          text
         -->P_W_DATA_KUNNR  text
    FORM f3600_send_data_via_email  USING p_w_data_kunnr.
      DATA:   fle1(2)       TYPE p,
              fle2(2)       TYPE p,
              off1          TYPE p,
              hltlines      TYPE i,
              temp_filesize TYPE i,
              hfeld(500)    TYPE c,
              header(50)   TYPE c,
              htabix        LIKE sy-tabix,
              x_sent_to_all LIKE sonv-flag.
      DATA: BEGIN OF x_objcont OCCURS 0.
              INCLUDE STRUCTURE soli.
              INCLUDE STRUCTURE SOLISTI1.
      DATA: END OF x_objcont.
      DATA: BEGIN OF x_object_hd_change.
              INCLUDE STRUCTURE sood1.
      DATA: END OF x_object_hd_change.
      DATA: BEGIN OF x_receivers OCCURS 0.
              INCLUDE STRUCTURE soos1.
             INCLUDE STRUCTURE SOMLRECI1.
      DATA: END OF x_receivers.
      DATA: BEGIN OF x_objhead OCCURS 1.
              INCLUDE STRUCTURE soli.
      DATA: END OF x_objhead.
    **Data: begin of objpack occurs 0.
             include structure SOPCKLSTI1.
    **Data: end of objpack.
    **Data: begin of email_data occurs 0.
             include structure SODOCCHGI1.
    **Data: end of email_data.
    Converts the layout set to PDF format
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = c_pdf_format
        IMPORTING
          bin_filesize          = temp_filesize
        TABLES
          otf                   = t_otfdata
          lines                 = t_htline
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          OTHERS                = 4.
      IF sy-subrc NE 0.
        w_error_found = c_true.
        t_error-kunnr = p_w_data_kunnr.
        t_error-comm  = 'Error in conversion to PDF format.'(e08).
        APPEND t_error.
        CLEAR t_error.
        EXIT.
      ENDIF.
    Convert the PDF file into an internal table which to be used in the
    function that will send a PDF file to a email address
      DESCRIBE TABLE t_htline LINES hltlines.
    DESCRIBE FIELD T_HTLINE LENGTH FLE1 IN BYTE MODE.
      DESCRIBE FIELD t_htline LENGTH fle1
                                  IN CHARACTER MODE.
    DESCRIBE FIELD X_OBJCONT LENGTH FLE2 IN BYTE MODE.
      DESCRIBE FIELD x_objcont LENGTH fle2
                                   IN CHARACTER MODE.
      CLEAR x_objcont.
      REFRESH x_objcont.
      LOOP AT t_htline.
        htabix = sy-tabix.
        MOVE t_htline TO hfeld+off1.
        IF htabix = hltlines.
          fle1 = STRLEN( t_htline ).
        ENDIF.
        off1 = off1 + fle1.
        IF off1 GE fle2.
          CLEAR x_objcont.
          x_objcont = hfeld(fle2).
          APPEND x_objcont.
          SHIFT hfeld BY fle2 PLACES.
          off1 = off1 - fle2.
        ENDIF.
        IF htabix = hltlines.
          IF off1 GT 0.
            CLEAR x_objcont.
            x_objcont = hfeld(off1).
            APPEND x_objcont.
          ENDIF.
        ENDIF.
      ENDLOOP.
    LOOP AT t_email.
       x_receivers-receiver = t_email-smtp_addr.
       x_receivers-rec_type = c_u.
       APPEND x_receivers.
    ENDLOOP.
    x_receivers-receiver = p_lemail.
    x_receivers-rec_type = c_u.
    APPEND x_receivers.
    DESCRIBE TABLE x_objcont LINES sy-tfill.
    READ TABLE x_objcont INDEX sy-tfill.
    email_data-doc_size = ( sy-tfill - 1 ) * 255 + STRLEN( x_objcont ).
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = sy-tfill.
    objpack-doc_type = 'RAW'.
    APPEND objpack.
    email_data-obj_descr = 'Notification'.
    APPEND email_data.
    IF x_receivers[] IS NOT INITIAL.
       CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
         EXPORTING
           document_data = email_data
           put_in_outbox = 'X'
           commit_work   = 'X' "used from rel. 6.10
         TABLES
           packing_list  = objpack
           object_header = email_fname
           contents_bin  = email_text
           contents_txt  = x_objcont
           receivers     = x_receivers.
    endif.
      CLEAR x_objhead.
      REFRESH x_objhead.
      CLEAR x_object_hd_change.
      x_object_hd_change-objnam = 'EMAIL'(t04).
      header = 'Procter & Gamble'(t05).
      x_object_hd_change-objdes = header.                         "Title
      x_object_hd_change-objla = c_english.                       "Language
      x_object_hd_change-objsns = c_f.
      x_object_hd_change-objlen = temp_filesize.
      x_object_hd_change-file_ext = c_pdf_format.
    Transfer the email address to an internal table which will be used
    in the function that will send a PDF file to a email address
      CLEAR x_receivers.
      REFRESH x_receivers.
      LOOP AT t_email.
        x_receivers-sndex = c_true.
        x_receivers-sndpri = c_1.
        x_receivers-recesc = c_u.
        x_receivers-recnam = c_recipient_name.
    Populate the email address of the customer
        x_receivers-recextnam = t_email-smtp_addr.
        x_receivers-recesc = c_english.
        x_receivers-sndart = c_int.
        APPEND x_receivers.
      ENDLOOP.
      x_receivers-sndex = c_true.
      x_receivers-sndpri = c_1.
      x_receivers-recesc = c_u.
      x_receivers-recnam = c_recipient_name.
    Populate the Local mail address
      x_receivers-recextnam = p_lemail.
      x_receivers-recesc = c_english.
      x_receivers-sndart = c_int.
      APPEND x_receivers.
    Calling a SAP function to send out email with attachment of PDF file
      CALL FUNCTION 'SO_OBJECT_SEND'
        EXPORTING
          object_hd_change           = x_object_hd_change
          object_type                = c_document_type
          outbox_flag                = c_true
        IMPORTING
          sent_to_all                = x_sent_to_all
        TABLES
          objcont                    = x_objcont
          objhead                    = x_objhead
          receivers                  = x_receivers
        EXCEPTIONS
          active_user_not_exist      = 1
          communication_failure      = 2
          component_not_available    = 3
          folder_not_exist           = 4
          folder_no_authorization    = 5
          forwarder_not_exist        = 6
          note_not_exist             = 7
          object_not_exist           = 8
          object_not_sent            = 9
          object_no_authorization    = 10
          object_type_not_exist      = 11
          operation_no_authorization = 12
          owner_not_exist            = 13
          parameter_error            = 14
          substitute_not_active      = 15
          substitute_not_defined     = 16
          system_failure             = 17
          too_much_receivers         = 18
          user_not_exist             = 19
          x_error                    = 20
          OTHERS                     = 21.
      IF sy-subrc NE 0.
        w_error_found = c_true.
        t_error-kunnr = p_w_data_kunnr.
        t_error-comm  = 'Error in sending email.'(e09).
        APPEND t_error.
        CLEAR t_error.
      ELSEIF sy-subrc EQ 0.
        COMMIT WORK.
    *Transmit Mail
        SUBMIT rsconn01 WITH mode = c_int
        WITH output = c_space
        AND RETURN.
      ENDIF.
    ENDFORM.                    " F3600_SEND_DATA_VIA_EMAIL
    *&      Form  F3200_GET_EMAIL_ADDR
          text
         -->P_T_REPORT_DISPLAY  text
    FORM f3200_get_email_addr USING p_w_data_kunnr.
      REFRESH t_customer.
      REFRESH t_adrt.
      REFRESH t_email.
      DATA: t_data TYPE STANDARD TABLE OF y_report_display.
    t_data = p_t_report_display.
      DATA : w_data LIKE LINE OF t_data .

    Sending mail with attachment
    This program will allowed you to send email with attachment.
    First, specify the attachment file from your local hardisk and execute.
    Next, specify the sender email address and click the send button.
    report y_cr17_mail.
    data method1 like sy-ucomm.
    data g_user like soudnamei1.
    data g_user_data like soudatai1.
    data g_owner like soud-usrnam.
    data g_receipients like soos1 occurs 0 with header line.
    data g_document like sood4 .
    data g_header like sood2.
    data g_folmam like sofm2.
    data g_objcnt like soli occurs 0 with header line.
    data g_objhead like soli occurs 0 with header line.
    data g_objpara like selc occurs 0 with header line.
    data g_objparb like soop1 occurs 0 with header line.
    data g_attachments like sood5 occurs 0 with header line.
    data g_references like soxrl occurs 0 with header line.
    data g_authority like sofa-usracc.
    data g_ref_document like sood4.
    data g_new_parent like soodk.
    data: begin of g_files occurs 10 ,
    text(4096) type c,
    end of g_files.
    data : fold_number(12) type c,
    fold_yr(2) type c,
    fold_type(3) type c.
    parameters ws_file(4096) type c default 'c:\debugger.txt'.
    Can me any file fromyour pc ....either xls or word or ppt etc ...
    g_user-sapname = sy-uname.
    call function 'SO_USER_READ_API1'
    exporting
    user = g_user
    PREPARE_FOR_FOLDER_ACCESS = ' '
    importing
    user_data = g_user_data
    EXCEPTIONS
    USER_NOT_EXIST = 1
    PARAMETER_ERROR = 2
    X_ERROR = 3
    OTHERS = 4
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    fold_type = g_user_data-outboxfol+0(3).
    fold_yr = g_user_data-outboxfol+3(2).
    fold_number = g_user_data-outboxfol+5(12).
    clear g_files.
    refresh : g_objcnt,
    g_objhead,
    g_objpara,
    g_objparb,
    g_receipients,
    g_attachments,
    g_references,
    g_files.
    method1 = 'SAVE'.
    g_document-foltp = fold_type.
    g_document-folyr = fold_yr.
    g_document-folno = fold_number.
    g_document-objtp = g_user_data-object_typ.
    *g_document-OBJYR = '27'.
    *g_document-OBJNO = '000000002365'.
    *g_document-OBJNAM = 'MESSAGE'.
    g_document-objdes = 'sap-img.com testing by program'.
    g_document-folrg = 'O'.
    *g_document-okcode = 'CHNG'.
    g_document-objlen = '0'.
    g_document-file_ext = 'TXT'.
    g_header-objdes = 'sap-img.com testing by program'.
    g_header-file_ext = 'TXT'.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
    exporting
    method = method1
    office_user = sy-uname
    ref_document = g_ref_document
    new_parent = g_new_parent
    importing
    authority = g_authority
    tables
    objcont = g_objcnt
    objhead = g_objhead
    objpara = g_objpara
    objparb = g_objparb
    recipients = g_receipients
    attachments = g_attachments
    references = g_references
    files = g_files
    changing
    document = g_document
    header_data = g_header
    FOLMEM_DATA =
    RECEIVE_DATA =
    File from the pc to send...
    method1 = 'ATTCREATEFROMPC'.
    g_files-text = ws_file.
    append g_files.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
    exporting
    method = method1
    office_user = g_owner
    ref_document = g_ref_document
    new_parent = g_new_parent
    importing
    authority = g_authority
    tables
    objcont = g_objcnt
    objhead = g_objhead
    objpara = g_objpara
    objparb = g_objparb
    recipients = g_receipients
    attachments = g_attachments
    references = g_references
    files = g_files
    changing
    document = g_document
    header_data = g_header
    method1 = 'SEND'.
    g_receipients-recnam = 'MK085'.
    g_receipients-recesc = 'B'.
    g_receipients-sndex = 'X'.
    append g_receipients.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
    exporting
    method = method1
    office_user = g_owner
    ref_document = g_ref_document
    new_parent = g_new_parent
    importing
    authority = g_authority
    tables
    objcont = g_objcnt
    objhead = g_objhead
    objpara = g_objpara
    objparb = g_objparb
    recipients = g_receipients
    attachments = g_attachments
    references = g_references
    files = g_files
    changing
    document = g_document
    header_data = g_header.
    *-- End of Program
    also try this one for background scheduling the same
    Sending mail with attachment report in Background
    Pay attention because it’s working with output list from spool converted to pdf.
    =================================================================================
    z_send_email_fax_global
    FUNCTION-POOL z_gfaian_mail_fax. “MESSAGE-ID ..
    WORK TABLE AREAS
    TABLES: tsp01.
    INTERNAL TABLES
    DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
    lt_note_text LIKE STANDARD TABLE OF soli WITH HEADER LINE,
    lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
    DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
    lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
    DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
    TYPES: BEGIN OF y_files,
    file(60) TYPE c,
    END OF y_files.
    DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
    DATA: l_objcont LIKE soli OCCURS 0 WITH HEADER LINE.
    DATA: l_objhead LIKE soli OCCURS 0 WITH HEADER LINE.
    STRUCTURES
    DATA: folder_id LIKE soodk,
    object_id LIKE soodk,
    link_folder_id LIKE soodk,
    g_document LIKE sood4,
    g_header_data LIKE sood2,
    g_folmem_data LIKE sofm2,
    g_header_data LIKE sood2,
    g_receive_data LIKE soos6,
    g_ref_document LIKE sood4,
    g_new_parent LIKE soodk,
    l_folder_id LIKE sofdk,
    v_email(50).
    DATA: hd_dat like sood1.
    VARIABLES
    DATA: client LIKE tst01-dclient,
    name LIKE tst01-dname,
    objtype LIKE rststype-type,
    type LIKE rststype-type.
    DATA: numbytes TYPE i,
    arc_idx LIKE toa_dara,
    pdfspoolid LIKE tsp01-rqident,
    jobname LIKE tbtcjob-jobname,
    jobcount LIKE tbtcjob-jobcount,
    is_otf.
    DATA: outbox_flag LIKE sonv-flag VALUE ‘X’,
    store_flag LIKE sonv-flag,
    delete_flag LIKE sonv-flag,
    owner LIKE soud-usrnam,
    on LIKE sonv-flag VALUE ‘X’,
    sent_to_all LIKE sonv-flag,
    g_authority LIKE sofa-usracc,
    w_objdes LIKE sood4-objdes.
    DATA: c_file LIKE rlgrap-filename,
    n_spool(6) TYPE n.
    DATA: cancel.
    DATA: desired_type LIKE sood-objtp,
    real_type LIKE sood-objtp,
    attach_type LIKE sood-objtp,
    otf LIKE sood-objtp VALUE ‘OTF’, ” SAPscript Ausgabeformat
    ali LIKE sood-objtp VALUE ‘ALI’. ” ABAP lists
    CONSTANTS
    CONSTANTS: ou_fol LIKE sofh-folrg VALUE ‘O’,
    c_objtp LIKE g_document-objtp VALUE ‘RAW’,
    c_file_ext LIKE g_document-file_ext VALUE ‘TXT’.
    =================================================================================
    z_send_email_fax2
    FUNCTION z_faian_mail_fax2.
    ””Interface local:
    *” IMPORTING
    *” REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
    *” REFERENCE(FAX_MAIL_NUMBER) TYPE SO_NAME
    *” REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
    *” REFERENCE(OBJECT_TYPE) TYPE SO_ESCAPE
    *” TABLES
    *” LT_BODY_EMAIL STRUCTURE SOLI
    *” EXCEPTIONS
    *” ERR_NO_ABAP_SPOOLJOB
    Fist part: Verify if the spool really exists
    SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
    IF sy-subrc NE 0.
    RAISE err_no_abap_spooljob. “doesn’t exist
    ELSE.
    client = tsp01-rqclient.
    name = tsp01-rqo1name.
    CALL FUNCTION ‘RSTS_GET_ATTRIBUTES’
    EXPORTING
    authority = ‘SP01&#8242;
    client = client
    name = name
    part = 1
    IMPORTING
    type = type
    objtype = objtype
    EXCEPTIONS
    fb_error = 1
    fb_rsts_other = 2
    no_object = 3
    no_permission = 4
    OTHERS = 5.
    IF objtype(3) = ‘OTF’.
    desired_type = otf.
    ELSE.
    desired_type = ali.
    ENDIF.
    CALL FUNCTION ‘RSPO_RETURN_SPOOLJOB’
    EXPORTING
    rqident = src_spoolid
    desired_type = desired_type
    IMPORTING
    real_type = real_type
    TABLES
    buffer = l_objcont
    EXCEPTIONS
    no_such_job = 14
    type_no_match = 94
    job_contains_no_data = 54
    no_permission = 21
    can_not_access = 21
    read_error = 54.
    IF sy-subrc EQ 0.
    attach_type = real_type.
    ENDIF.
    CALL FUNCTION ‘SO_FOLDER_ROOT_ID_GET’
    EXPORTING
    owner = sy-uname
    region = ou_fol
    IMPORTING
    folder_id = l_folder_id
    EXCEPTIONS
    OTHERS = 5.
    fill out informations about the header of the email
    CLEAR: g_document.
    g_document-foltp = l_folder_id-foltp.
    g_document-folyr = l_folder_id-folyr.
    g_document-folno = l_folder_id-folno.
    g_document-objtp = c_objtp.
    g_document-objdes = header_mail.
    g_document-file_ext = c_file_ext.
    g_header_data-objdes = header_mail.
    CALL FUNCTION ‘SO_DOCUMENT_REPOSITORY_MANAGER’
    EXPORTING
    method = ‘SAVE’
    office_user = sy-uname
    IMPORTING
    authority = g_authority
    TABLES
    objcont = lt_body_email
    attachments = lt_attachments
    CHANGING
    document = g_document
    header_data = g_header_data
    EXCEPTIONS
    OTHERS = 1.
    folder_id-objtp = l_folder_id-foltp.
    folder_id-objyr = l_folder_id-folyr.
    folder_id-objno = l_folder_id-folno.
    object_id-objtp = c_objtp.
    object_id-objyr = g_document-objyr.
    object_id-objno = g_document-objno.
    link_folder_id-objtp = l_folder_id-foltp.
    link_folder_id-objyr = l_folder_id-folyr.
    link_folder_id-objno = l_folder_id-folno.
    REFRESH lt_rec_tab.
    CLEAR lt_rec_tab.
    lt_rec_tab-sel = ‘X’.
    lt_rec_tab-recesc = object_type. “This field for FAX/MAIL
    lt_rec_tab-recnam = ‘U-’.
    lt_rec_tab-deliver = ‘X’.
    lt_rec_tab-not_deli = ‘X’.
    lt_rec_tab-read = ‘X’.
    lt_rec_tab-mailstatus = ‘E’.
    lt_rec_tab-adr_name = fax_mail_number.
    lt_rec_tab-sortfield = fax_mail_number.
    lt_rec_tab-recextnam = fax_mail_number.
    lt_rec_tab-sortclass = ‘5&#8242;.
    APPEND lt_rec_tab.
    lt_rec_tab-recextnam = fax_mail_number.
    lt_rec_tab-recesc = object_type.
    lt_rec_tab-sndart = ‘INT’.
    lt_rec_tab-sndpri = 1.
    APPEND lt_rec_tab.
    lt_files-file = c_file.
    APPEND lt_files.
    begin of insertion by faianf01
    hd_dat-objdes = header_mail.
    CALL FUNCTION ‘SO_ATTACHMENT_INSERT’
    EXPORTING
    object_id = object_id
    attach_type = attach_type
    object_hd_change = hd_dat
    owner = sy-uname
    TABLES
    objcont = l_objcont
    objhead = l_objhead
    EXCEPTIONS
    active_user_not_exist = 35
    communication_failure = 71
    object_type_not_exist = 17
    operation_no_authorization = 21
    owner_not_exist = 22
    parameter_error = 23
    substitute_not_active = 31
    substitute_not_defined = 32
    system_failure = 72
    x_error = 1000.
    IF sy-subrc > 0.
    ENDIF.
    end of insertion by faianf01
    send email from SAPOFFICE
    CALL FUNCTION ‘SO_OBJECT_SEND’
    EXPORTING
    folder_id = folder_id
    object_id = object_id
    outbox_flag = outbox_flag
    link_folder_id = link_folder_id
    owner = sy-uname
    check_send_authority = ‘X’
    TABLES
    receivers = lt_rec_tab
    note_text = lt_note_text
    EXCEPTIONS
    active_user_not_exist = 35
    communication_failure = 71
    component_not_available = 1
    folder_no_authorization = 5
    folder_not_exist = 6
    forwarder_not_exist = 8
    object_no_authorization = 13
    object_not_exist = 14
    object_not_sent = 15
    operation_no_authorization = 21
    owner_not_exist = 22
    parameter_error = 23
    substitute_not_active = 31
    substitute_not_defined = 32
    system_failure = 72
    too_much_receivers = 73
    user_not_exist = 35.
    ENDIF.
    ENDFUNCTION.
    =================================================================================
    z_send_email_fax
    FUNCTION ZCBFS_SEND_MAIL.
    ””Interface local:
    *” IMPORTING
    *” REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
    *” REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
    *” TABLES
    *” LIST_FAX_MAIL_NUMBER STRUCTURE SOLI
    *” EXCEPTIONS
    *” ERR_NO_ABAP_SPOOLJOB
    DATA: vg_achou(1) TYPE n.
    Fist part: Verify if the spool really exists
    vg_achou = 1.
    DO 60 TIMES.
    SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
    IF sy-subrc IS INITIAL.
    CLEAR vg_achou.
    EXIT.
    ELSE.
    WAIT UP TO 1 SECONDS.
    ENDIF.
    ENDDO.
    IF vg_achou = 1.
    RAISE err_no_abap_spooljob. “doesn’t exist
    ENDIF.
    client = tsp01-rqclient.
    name = tsp01-rqo1name.
    CALL FUNCTION ‘RSTS_GET_ATTRIBUTES’
    EXPORTING
    authority = ‘SP01&#8242;
    client = client
    name = name
    part = 1
    IMPORTING
    type = type
    objtype = objtype
    EXCEPTIONS
    fb_error = 1
    fb_rsts_other = 2
    no_object = 3
    no_permission = 4
    OTHERS = 5.
    IF objtype(3) = ‘OTF’.
    desired_type = otf.
    ELSE.
    desired_type = ali.
    ENDIF.
    CALL FUNCTION ‘RSPO_RETURN_SPOOLJOB’
    EXPORTING
    rqident = src_spoolid
    desired_type = desired_type
    IMPORTING
    real_type = real_type
    TABLES
    buffer = l_objcont
    EXCEPTIONS
    no_such_job = 14
    type_no_match = 94
    job_contains_no_data = 54
    no_permission = 21
    can_not_access = 21
    read_error = 54.
    IF sy-subrc EQ 0.
    attach_type = real_type.
    ENDIF.
    CALL FUNCTION ‘SO_FOLDER_ROOT_ID_GET’
    EXPORTING
    owner = sy-uname
    region = ou_fol
    IMPORTING
    folder_id = l_folder_id
    EXCEPTIONS
    OTHERS = 5.
    fill out informations about the header of the email
    CLEAR: g_document.
    g_document-foltp = l_folder_id-foltp.
    g_document-folyr = l_folder_id-folyr.
    g_document-folno = l_folder_id-folno.
    g_document-objtp = c_objtp.
    g_document-objdes = header_mail.
    g_document-file_ext = c_file_ext.
    g_header_data-objdes = header_mail.
    CALL FUNCTION ‘SO_DOCUMENT_REPOSITORY_MANAGER’
    EXPORTING
    method = ‘SAVE’
    office_user = sy-uname
    IMPORTING
    authority = g_authority
    TABLES
    attachments = lt_attachments
    CHANGING
    document = g_document
    header_data = g_header_data
    EXCEPTIONS
    OTHERS = 1.
    folder_id-objtp = l_folder_id-foltp.
    folder_id-objyr = l_folder_id-folyr.
    folder_id-objno = l_folder_id-folno.
    object_id-objtp = c_objtp.
    object_id-objyr = g_document-objyr.
    object_id-objno = g_document-objno.
    link_folder_id-objtp = l_folder_id-foltp.
    link_folder_id-objyr = l_folder_id-folyr.
    link_folder_id-objno = l_folder_id-folno.
    REFRESH lt_rec_tab.
    LOOP AT LIST_FAX_MAIL_NUMBER.
    lt_rec_tab-recextnam = LIST_FAX_MAIL_NUMBER-LINE.
    lt_rec_tab-recesc = ‘U’.
    lt_rec_tab-sndart = ‘INT’.
    lt_rec_tab-sndpri = 1.
    APPEND lt_rec_tab.
    ENDLOOP.
    lt_files-file = c_file.
    APPEND lt_files.
    hd_dat-objdes = header_mail.
    CALL FUNCTION ‘SO_ATTACHMENT_INSERT’
    EXPORTING
    object_id = object_id
    attach_type = attach_type
    object_hd_change = hd_dat
    owner = sy-uname
    TABLES
    objcont = l_objcont
    objhead = l_objhead
    EXCEPTIONS
    active_user_not_exist = 35
    communication_failure = 71
    object_type_not_exist = 17
    operation_no_authorization = 21
    owner_not_exist = 22
    parameter_error = 23
    substitute_not_active = 31
    substitute_not_defined = 32
    system_failure = 72
    x_error = 1000.
    IF sy-subrc > 0.
    ENDIF.
    send email from SAPOFFICE
    CALL FUNCTION ‘SO_OBJECT_SEND’
    EXPORTING
    folder_id = folder_id
    object_id = object_id
    outbox_flag = outbox_flag
    link_folder_id = link_folder_id
    owner = sy-uname
    TABLES
    receivers = lt_rec_tab
    note_text = lt_note_text
    EXCEPTIONS
    active_user_not_exist = 35
    communication_failure = 71
    component_not_available = 1
    folder_no_authorization = 5
    folder_not_exist = 6
    forwarder_not_exist = 8
    object_no_authorization = 13
    object_not_exist = 14
    object_not_sent = 15
    operation_no_authorization = 21
    owner_not_exist = 22
    parameter_error = 23
    substitute_not_active = 31
    substitute_not_defined = 32
    system_failure = 72
    too_much_receivers = 73
    user_not_exist = 35.
    ENDFUNCTION.
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • Background Jobs with Dynamic Dates

    I am looking for how to run a job in the background on a Daily basis where the data time range is always Yesterday - specifically, I want to run a Notification report daily to see the previous day's notifications.
    I have established a Variant with the Dynamic Dates to be "Current Date - 1 days", and schedule it to run in the background Daily.  The report runs daily as scheduled, but the dates are not changing (i.e. it always runs the report for the same date).

    Dear Richard,
    It appears that the date that you generated by "Current Date - 1" is not used for running notification report or not passed from variant.
    You can actually code the same in your program.
    I suggest you to expecute the report in SE38 with debugging by putting a break-point.
    v_date = sy-datum - 1.
    v_date should be used for notification report. (not sy-datum)
    Reward points if this is helpful.
    Regards,
    Naveen.

Maybe you are looking for