Next step is to set up mercury that it either sends all these e-mails
to our internal mailserver, or our mailserver takes the mails via pop3
protocol from mercury. When i get it done i probably will buy mercury
for our backup mail-system.
If the server can pull via POP3 from a domain mailbox then you can use that. My Mercury NLM server on Netware does not have that capability so I push the mail using a batch file and BASIC program. I'm running the BASIC program compiled now. All this program does is take the CNM files and add the "glue" headers and save it as a 101 file to the Mercury/32 queue. I'm using a third party WAIT.COM program to make this happen every 5 minutes. http://www.plop.at/en/tools.html I've been using this for a few months now for the domain Novell-tstephenson.com and it's works quite well.
-------------------------------------------------------------------------------------------- MX.bat ----------------------------------------------------------------------------------------------------
ECHO OFF
:LOOP
CD c:\pmail\mail\novell
dir c:\pmail\mail\novell\*.cnm > c:\pmail\mail\novell\files.txt
REM CALL c:\qb45\qb /RUN c:\pmail\mail\novell\MX.BAS
call c:\pmail\mail\novell\mx.exe
move *.101 c:\mercury\queue
DEL c:\pmail\mail\novell\files.txt
call c:\pmail\mail\novell\wait -m 5
GOTO LOOP
------------------------------------------------------------------------------------------ MX.BAS ------------------------------------------------------------------------------------------------
REM MX.BAS This program was developed to send mail from a "domain" account to a different
REM server via SMTP. It takes the CNM RFC 2822 message body, extracts the SMTP addresses
REM and then saves it as a 101 file. The CNM import file is a directory listing
REM of the CNM files in the "domain" user account.
CLS
REM Set the path to the domain mailbox and the new domain name.
PATHSPEC$ = "c:\pmail\mail\novell\"
Domain$ = "@[192.168.1.3]"
REM Read in the CNM files
OPEN PATHSPEC$ + "files.txt" FOR INPUT AS #1
WHILE NOT EOF(1)
REM Read the CNM directory listing
LINE INPUT #1, Line$
REM Check to see if this is a CNM file else skip it. The CNM file is always 8.3.
IF RIGHT$(Line$, 3) = "CNM" THEN File$ = RIGHT$(Line$, 12) ELSE GOTO SKIP
REM Read the CNM file
OPEN PATHSPEC$ + File$ FOR INPUT AS #2
REM Get the MAIL FROM: and RCPT TO: addresses for the glue headers.
REM I'm using the Sender: for the MAIL FROM: address. It may be blank
REM for locally delivered mail but a blank MAIL FROM: works for me.
WHILE NOT EOF(2)
LINE INPUT #2, Line$
IF LEFT$(Line$, 14) = "X-Envelope-To:" THEN RCPTTO$ = MID$(Line$, 16, LEN(Line$))
IF LEFT$(Line$, 7) = "Sender:" THEN MAILFROM$ = MID$(Line$, 9, LEN(Line$))
WEND
REM Close the CNM file.
CLOSE #2
REM Change the domain name to the new domain in the RCPT TO: address.
FOR I = 1 TO 100
IF MID$(RCPTTO$, I, 1) = "@" THEN RCPT2$ = MID$(RCPTTO$, 1, I - 1) + Domain$
NEXT I
REM If the SMTP address was in brackets add the trailing bracket.
IF LEFT$(RCPT2$, 1) = "<" THEN RCPT2$ = RCPT2$ + ">"
REM Write the 101 file in Glue header format.
OPEN PATHSPEC$ + File$ FOR INPUT AS #2
OPEN PATHSPEC$ + LEFT$(File$, 8) + ".101" FOR OUTPUT AS #3
REM Write the MAIL FROM:, RCPT TO: and blank line.
PRINT #3, "$$ " + MAILFROM$
PRINT #3, RCPT2$
PRINT #3, ""
REM Write the rest of the RFC 2822 body to the 101 file.
WHILE NOT EOF(2)
LINE INPUT #2, Line$
PRINT #3, Line$
WEND
REM Close the CNM and 101 Files.
CLOSE 2
CLOSE 3
REM Delete the CNM file
KILL PATHSPEC$ + File$
SKIP:
WEND
CLOSE
SYSTEM
END
<blockquote>Next step is to set up mercury that it either sends all these e-mails
to our internal mailserver, or our mailserver takes the mails via pop3
protocol from mercury. When i get it done i probably will buy mercury
for our backup mail-system.</blockquote><p>If the server can pull via POP3 from a domain mailbox then you can use that.&nbsp; My Mercury NLM server on Netware does not have that capability so I push the mail using a batch file and BASIC program. I'm running the BASIC program compiled now.&nbsp; All this program does is take the CNM files and add the "glue" headers and save it as a 101 file to the Mercury/32 queue.&nbsp;&nbsp; I'm using a third party WAIT.COM program to make this happen every 5 minutes.&nbsp; http://www.plop.at/en/tools.html&nbsp; I've been using this for a few months now for the domain Novell-tstephenson.com and it's works quite well.
</p><p>-------------------------------------------------------------------------------------------- MX.bat ----------------------------------------------------------------------------------------------------&nbsp;</p><p>ECHO OFF
:LOOP
CD c:\pmail\mail\novell
dir c:\pmail\mail\novell\*.cnm &gt; c:\pmail\mail\novell\files.txt
REM CALL c:\qb45\qb /RUN c:\pmail\mail\novell\MX.BAS
call c:\pmail\mail\novell\mx.exe
move *.101 c:\mercury\queue
DEL c:\pmail\mail\novell\files.txt
call c:\pmail\mail\novell\wait -m 5
GOTO LOOP</p><p>&nbsp;------------------------------------------------------------------------------------------ MX.BAS ------------------------------------------------------------------------------------------------
</p><p>REM MX.BAS This program was developed to send mail from a "domain" account to a different
REM server via SMTP.&nbsp; It takes the CNM RFC 2822 message body, extracts the SMTP addresses
REM and then saves it as a 101 file.&nbsp; The CNM import file is a directory listing
REM of the CNM files in the "domain" user account.
CLS
REM Set the path to the domain mailbox and the new domain name.
PATHSPEC$ = "c:\pmail\mail\novell\"
Domain$ = "@[192.168.1.3]"
REM Read in the CNM files
OPEN PATHSPEC$ + "files.txt" FOR INPUT AS #1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
WHILE NOT EOF(1)
&nbsp;&nbsp; &nbsp;REM Read the CNM directory listing
&nbsp;&nbsp; &nbsp;LINE INPUT #1, Line$
&nbsp;&nbsp; &nbsp;REM Check to see if this is a CNM file else skip it.&nbsp; The CNM file is always 8.3.
&nbsp;&nbsp; &nbsp;IF RIGHT$(Line$, 3) = "CNM" THEN File$ = RIGHT$(Line$, 12) ELSE GOTO SKIP
&nbsp;&nbsp; &nbsp;
&nbsp;&nbsp; &nbsp;REM Read the CNM file
&nbsp;&nbsp; &nbsp;OPEN PATHSPEC$ + File$ FOR INPUT AS #2
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
&nbsp;&nbsp; &nbsp;REM Get the MAIL FROM: and RCPT TO: addresses for the glue headers.
&nbsp;&nbsp; &nbsp;REM I'm using the Sender: for the MAIL FROM: address. It may be blank
&nbsp;&nbsp; &nbsp;REM for locally delivered mail but a blank MAIL FROM: works for me.
&nbsp;&nbsp; &nbsp;WHILE NOT EOF(2)
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; LINE INPUT #2, Line$
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; IF LEFT$(Line$, 14) = "X-Envelope-To:" THEN RCPTTO$ = MID$(Line$, 16, LEN(Line$))
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; IF LEFT$(Line$, 7) = "Sender:" THEN MAILFROM$ = MID$(Line$, 9, LEN(Line$))
&nbsp;&nbsp; &nbsp;WEND
&nbsp;&nbsp; &nbsp;REM Close the CNM file.
&nbsp;&nbsp; &nbsp;CLOSE #2
&nbsp;&nbsp; &nbsp;REM Change the domain name to the new domain in the RCPT TO: address.
&nbsp;&nbsp; &nbsp;FOR I = 1 TO 100
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; IF MID$(RCPTTO$, I, 1) = "@" THEN RCPT2$ = MID$(RCPTTO$, 1, I - 1) + Domain$
&nbsp;&nbsp; &nbsp;NEXT I
&nbsp;&nbsp; &nbsp;REM If the SMTP address was in brackets add the trailing bracket.
&nbsp;&nbsp; &nbsp;IF LEFT$(RCPT2$, 1) = "&lt;" THEN RCPT2$ = RCPT2$ + "&gt;"
&nbsp;&nbsp; &nbsp;REM Write the 101 file in Glue header format.
&nbsp;&nbsp; &nbsp;OPEN PATHSPEC$ + File$ FOR INPUT AS #2
&nbsp;&nbsp; &nbsp;OPEN PATHSPEC$ + LEFT$(File$, 8) + ".101" FOR OUTPUT AS #3
&nbsp;&nbsp; &nbsp;REM Write the MAIL FROM:, RCPT TO: and blank line.
&nbsp;&nbsp; &nbsp;PRINT #3, "$$ " + MAILFROM$
&nbsp;&nbsp; &nbsp;PRINT #3, RCPT2$
&nbsp;&nbsp; &nbsp;PRINT #3, ""
&nbsp;&nbsp; &nbsp;REM Write the rest of the RFC 2822 body to the 101 file.
&nbsp;&nbsp; &nbsp;WHILE NOT EOF(2)
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; LINE INPUT #2, Line$
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; PRINT #3, Line$
&nbsp;&nbsp; &nbsp;WEND
&nbsp;&nbsp; &nbsp;REM Close the CNM and 101 Files.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; &nbsp;CLOSE 2
&nbsp;&nbsp; &nbsp;CLOSE 3
&nbsp;&nbsp; &nbsp;REM Delete the CNM file
&nbsp;&nbsp; &nbsp;KILL PATHSPEC$ + File$
SKIP:
WEND
CLOSE
SYSTEM
END</p>