I have a requirement to put a mail relay in my DMZ and to not let that mail relay send to the internal mail server. I need to have the internal mail server poll for new messages on the DMZ server with some frequency. I have (I think) everything read on the DMZ mail relay. What I need is something that works the opposite of rmail(8) for the DMZ mail relay side.

What I'm thinking is a perl script that opens each message in /var/spool/mqueue (each message has one df* file and one qf* file), create an output stream that is compatible with rmail(8) or procmail or something that can use deliver(8) from Cyrus, then finally delete the message on the DMZ mail relay.

Is there already a module for opening /var/spool/mqueue and properly formatting the messages (envelope and message)?


In reply to Pulling from /var/spool/mqueue? by edwyr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.