Okay... Not sure how "out there" this thought is...

Right now to send a pager message (aka text message), a user logs into our AS400... logs into the program... enters user name and message and hit's F10 to send.

With a little looking, it seems that you can run remote commands to the AS400 via FTP. So I'm working on building a script (batch or otherwise) that, given two parameters (user, message), will FTP into the AS400 and run a remote command:

c:\>ftp server
user: admin
password: *****
ftp> quote rcmd SNDPGRMSG TOPGR(JDOE) MSG('This is a Test')
ftp> quit

So... what I want to do is

setup an email account on our Exchange server
Monitor the account for incoming mail
upon receipt of incoming mail, parse it... say for example subject is defined as "Recipient" and email text is defined as "Pager message"
run a batch that uses the above mentioned TOPGR and MSG as parameters... via FTP to the AS400
mark email as "read"

The main thing I'm not sure about is monitoring an exchange account and running a script on incoming emails. I'm sure what I want to do is possible... but where would I start?

EDIT: Clarification

The main reasons for using this four part system are logging (messages sent via this are logged and reported by the AS400 program) and the existing scheduler for redirecting pages (For example, the weekly on-call person = TOPGR(oncall) gets updated by the AS400 program).

I'm also trying to remove duplicate work. If I can get this setup working, I can redirect pages from OTHER systems into this one. I then don't have to update 2, soon to be 3, systems with current phone numbers, carriers, on-call schedules, etc. System #2 and #3 can just "email" [email protected].

  • Can't Exchange just send out the pager message directly? You are counting on 4 pieces (Exchange, IBM i, FTP, Paging system) all being up all of the time.
    – Mike Wills
    Jun 21, 2011 at 14:21
  • the paging system logs messages which is used for reporting purposes. It is also the system which is kept up-to-date as far as correct contact information. If the IBM (and FTP/Paging) isn't up, we have bigger problems than not getting pages.
    – WernerCD
    Jun 21, 2011 at 15:04
  • For purposes of reference, here is the previous post. serverfault.com/q/281654/602
    – Mike Wills
    Jun 21, 2011 at 15:51

1 Answer 1


In my research, I found there are triggers that can be added to the Exchange server directly. You can write a program to use that trigger and run a SQL stored procedure on the i that would run your program (cutting out FTP fully).

Another option would be to essentially write an Exchange client (maybe POP or IMAP would work) that checks every x minutes for new mail then processes the information.

Neither option is very elegant or easy.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .