ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SMTP exit program?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SMTP exit program?

    We have a third-party program that converts PF to Excel format and emails the result to the user running the program.

    From time to time a user will choose to do this with an absurdly large file which proceeds to bring down the SMTP server, or at least have it begging for mercy.

    I need a way to inspect the size of files before allowing it to be sent as an attachment, I'd like it to be universal so that any application trying to send in this fashion will be controlled.

    Does SMTP allow for user exit programming? I couldn't find any with my searches.

  • #2
    Re: SMTP exit program?

    dont know, but there is an api to examine the size of a file on the ifs.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: SMTP exit program?

      Maybe you could do a crude check on the size of the PF before converting it by using RTVMBRD with the DTASPCSIZ parameter.
      If it exceeded X number of bytes in size then don't convert it to Excel...just a thought.

      Comment


      • #4
        Re: SMTP exit program?

        Originally posted by DeadManWalks View Post
        dont know, but there is an api to examine the size of a file on the ifs.
        The stat API reports file size.

        Scott Klement has a wonderful copybook named IFSIO_H, which includes a data structure for stat. Visit this page and look under "RPG and the IFS".

        Comment


        • #5
          Re: SMTP exit program?

          Good suggestions but determining the file size is something I know how to do, the problem is making sure my program that checks the file size has veto power. The third-party software I alluded to just does it's thing, it doesn't check in with any other program to get permission before sending.

          That's why I thought maybe I could shoehorn into SMTP since they do use that system program.

          I may try duplicating their command and having it call my CPP instead, then if the file is too big, bail out with a message.

          Comment


          • #6
            Re: SMTP exit program?

            I'm not aware of the SMTP server having any exit points. This problem would seem to be the responsibility of the 3rd-party vendor.
            Tom

            There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

            Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

            Comment

            Working...
            X