windmere has asked for the wisdom of the Perl Monks concerning the following question:

Its been a long journey that has brought me to the gates of this monestary. My company runs a UNIX/ORACLE shop for their data center, Microsoft Exchange for their email, and windows as clients. Over the past year, I've used perl to connect with oracle, and create emails on the fly with attachments (reports generated by the erp system). I sent the emails to exchange using smtp, worked great, but the problem was it exposed the ip and node name of our erp system to the world. So I instead sent the email through a relay machine (sendmail) which I configured to strip off the header info relating to the production machine. Worked, but mail servers have started rejecting our mail because of the relaying required to make the thing work.

I am now trying to create the messages directly in the exchange server using mapi functions in perl running from the unix prod box. I've done that, but now need a way of sending them off. This is where I am stuck. When I put the message in the outbox it just sits there. When I open the message up in outlook, there is no send button. The only way I've been able send it off in the outlook gui, is to use "resend" in the tools menu. Anyone know of either a better way of doing this, or a way in perl for doing a resend, or mimicking a resend. Thanks in advance for your help.
  • Comment on Sending messages through exchange, originating in UNIX

Replies are listed 'Best First'.
Re: Sending messages through exchange, originating in UNIX
by Abigail-II (Bishop) on Feb 03, 2004 at 15:13 UTC
    I sent the emails to exchange using smtp, worked great, but the problem was it exposed the ip and node name of our erp system to the world.
    Which, IMO, means that the Exchange server isn't doing its job. If Exchange is acting as a gateway between the "inside" and the outside world, it's the task of the Exchange machine to rewrite or remove the offending headers.
    So I instead sent the email through a relay machine (sendmail) which I configured to strip off the header info relating to the production machine. Worked, but mail servers have started rejecting our mail because of the relaying required to make the thing work.
    That, I don't understand. Which mail servers are rejecting the mail? How do they know sendmail is relaying? Why would they care? Relaying is very common nowadays (as long as you aren't an open relay). In fact, tons of email is rejected because it's send directly, and not relayed through an ISPs SMTP server.
    This is where I am stuck. When I put the message in the outbox it just sits there. When I open the message up in outlook, there is no send button. The only way I've been able send it off in the outlook gui, is to use "resend" in the tools menu.
    Without knowing what you send, who could tell?
    Anyone know of either a better way of doing this,
    To, this sounds like a problem that needs to be solved at the MTA level.

    Abigail

Re: Sending messages through exchange, originating in UNIX
by waswas-fng (Curate) on Feb 03, 2004 at 19:07 UTC
    A few options,

  • Fix your MTA issue like noted above.
  • Have the application that generates the email and does the processing live on a host that does not need to be obscured from the outside world -- an application server on a DMZ perhaps...
  • Fix your sendmail install to strip or obscure the first hop in such a way where your headers are not malformed causing the relay bounces -- correctly configured mail servers should accept those messages.

    About your relaying issue, are you sending mail that is apparently from another domain than the one you are relaying through? Does that domains MX record include the relaying host? One of the only other reasons I can think of that the email is being anti-relay rejected is that your header rewrite is malformed.


    -Waswas