Community Discussions and Support
How can I set up mercury as relay server?

> Hi there,
>
>  I have mercury running on my local webserver. Now I want to configure
> mercury that it sends all the emails received to another smtp server
> in my network (e.g. smtp.mydomain.org). Mercury should not make any mx
> lookups itself, only forward it.

Mercury/32 currently does not provide MX services.  David's looking into this for a future enhancement but until that happens here's a work around.   

1.    Create a domain account for the domain you want forwarded. For example I forward the domain novell-tstephenson.com so I have a domains list setting of

DM=novell: novelltstephenson.com

2.    Create a program to get the CNM files in the user NOVELL directory and convert them to 101 "glue" header queue files that change the address to the IP address of the receiving SMTP host.  I did this in BASIC but you could use anything you happen to have and are familiar with to do the same thing.


REM 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

4.    Create a BATCH file to process the CNM files.  I got the program wait.com off the web someplace.  Works fine.

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

5.    Load the batch file at startup.  I use NT Wrapper Pro to run it as a service  at startup.

Now mail for domain novell-tstephenson.com is received by tstephenson.com and moved to the Novell user new mail directory.  The bat file runs the program very 5 minutes and makes a list of all the CNM to files.txt.  The BAS file is run and reads the files.txt file to get all of the CNM files and adds the "glue" headers to the original CNM file and saves it as a 101 file.  The bat file moves the 101 files to the queue and loops.

This works for me to forward all mail from the outside world with the domain novell-tstephenson.com to the Mercury NLM server running on my Novell system. 

&amp;gt; Hi there, &amp;gt; &amp;gt; &amp;nbsp;I have mercury running on my local webserver. Now I want to configure &amp;gt; mercury that it sends all the emails received to another smtp server &amp;gt; in my network (e.g. smtp.mydomain.org). Mercury should not make any mx &amp;gt; lookups itself, only forward it. Mercury/32 currently does not provide MX services.&amp;nbsp; David&#039;s looking into this for a future enhancement but until that happens here&#039;s a work around.&amp;nbsp; &amp;nbsp; 1.&amp;nbsp;&amp;nbsp; &amp;nbsp;Create a domain account for the domain you want forwarded. For example I forward the domain novell-tstephenson.com so I have a domains list setting of DM=novell: novelltstephenson.com 2.&amp;nbsp;&amp;nbsp; &amp;nbsp;Create a program to get the CNM files in the user NOVELL directory and convert them to 101 &quot;glue&quot; header queue files that change the address to the IP address of the receiving SMTP host.&amp;nbsp; I did this in BASIC but you could use anything you happen to have and are familiar with to do the same thing. REM This program was developed to send mail from a &quot;domain&quot; account to a different REM server via SMTP.&amp;nbsp; It takes the CNM RFC 2822 message body, extracts the SMTP addresses REM and then saves it as a 101 file.&amp;nbsp; The CNM import file is a directory listing REM of the CNM files in the &quot;domain&quot; user account. CLS REM Set the path to the domain mailbox and the new domain name. PATHSPEC$ = &quot;c:\pmail\mail\novell\&quot; Domain$ = &quot;@[192.168.1.3]&quot; REM Read in the CNM files OPEN PATHSPEC$ + &quot;files.txt&quot; FOR INPUT AS #1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; WHILE NOT EOF(1) &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Read the CNM directory listing &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;LINE INPUT #1, Line$ &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Check to see if this is a CNM file else skip it.&amp;nbsp; The CNM file is always 8.3. &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;IF RIGHT$(Line$, 3) = &quot;CNM&quot; THEN File$ = RIGHT$(Line$, 12) ELSE GOTO SKIP &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Read the CNM file &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;OPEN PATHSPEC$ + File$ FOR INPUT AS #2 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Get the MAIL FROM: and RCPT TO: addresses for the glue headers. &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM I&#039;m using the Sender: for the MAIL FROM: address. It may be blank &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM for locally delivered mail but a blank MAIL FROM: works for me. &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;WHILE NOT EOF(2) &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;LINE INPUT #2, Line$ &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;IF LEFT$(Line$, 14) = &quot;X-Envelope-To:&quot; THEN RCPTTO$ = MID$(Line$, 16, LEN(Line$)) &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;IF LEFT$(Line$, 7) = &quot;Sender:&quot; THEN MAILFROM$ = MID$(Line$, 9, LEN(Line$)) &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;WEND &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Close the CNM file. &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLOSE #2 &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Change the domain name to the new domain in the RCPT TO: address. &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;FOR I = 1 TO 100 &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;IF MID$(RCPTTO$, I, 1) = &quot;@&quot; THEN RCPT2$ = MID$(RCPTTO$, 1, I - 1) + Domain$ &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;NEXT I &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM If the SMTP address was in brackets add the trailing bracket. &amp;nbsp;&amp;nbsp; &amp;nbsp;IF LEFT$(RCPT2$, 1) = &quot;&amp;lt;&quot; THEN RCPT2$ = RCPT2$ + &quot;&amp;gt;&quot; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Write the 101 file in Glue header format. &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;OPEN PATHSPEC$ + File$ FOR INPUT AS #2 &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;OPEN PATHSPEC$ + LEFT$(File$, 8) + &quot;.101&quot; FOR OUTPUT AS #3 &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Write the MAIL FROM:, RCPT TO: and blank line. &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;PRINT #3, &quot;$$ &quot; + MAILFROM$ &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;PRINT #3, RCPT2$ &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;PRINT #3, &quot;&quot; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Write the rest of the RFC 2822 body to the 101 file. &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;WHILE NOT EOF(2) &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;LINE INPUT #2, Line$ &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;PRINT #3, Line$ &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;WEND &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Close the CNM and 101 Files.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLOSE 2 &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLOSE 3 &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;REM Delete the CNM file &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;KILL PATHSPEC$ + File$ SKIP: WEND CLOSE SYSTEM END 4.&amp;nbsp;&amp;nbsp; &amp;nbsp;Create a BATCH file to process the CNM files.&amp;nbsp; I got the program wait.com off the web someplace.&amp;nbsp; Works fine. ECHO OFF :LOOP CD c:\pmail\mail\novell dir c:\pmail\mail\novell\*.cnm &amp;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 5.&amp;nbsp;&amp;nbsp; &amp;nbsp;Load the batch file at startup.&amp;nbsp; I use NT Wrapper Pro to run it as a service&amp;nbsp; at startup. Now mail for domain novell-tstephenson.com is received by tstephenson.com and moved to the Novell user new mail directory.&amp;nbsp; The bat file runs the program very 5 minutes and makes a list of all the CNM to files.txt.&amp;nbsp; The BAS file is run and reads the files.txt file to get all of the CNM files and adds the &quot;glue&quot; headers to the original CNM file and saves it as a 101 file.&amp;nbsp; The bat file moves the 101 files to the queue and loops. This works for me to forward all mail from the outside world with the domain novell-tstephenson.com to the Mercury NLM server running on my Novell system.&amp;nbsp;

Hi there,

 I have mercury running on my local webserver. Now I want to configure mercury that it sends all the emails received to another smtp server in my network (e.g. smtp.mydomain.org). Mercury should not make any mx lookups itself, only forward it.

 Thanks in advance.
 

&lt;p&gt;Hi there,&lt;/p&gt; &lt;p&gt;&amp;nbsp;I have mercury running on my local webserver. Now I want to configure mercury that it sends all the emails received to another smtp server in my network (e.g. smtp.mydomain.org). Mercury should not make any mx lookups itself, only forward it.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks in advance. &amp;nbsp;&lt;/p&gt;

Sorry guys! I already found my mistake. MercuryC was set up right, but the sender's email address was denied... [:#]

&lt;p&gt;Sorry guys! I already found my mistake. MercuryC was set up right, but the sender&#039;s email address was denied... [:#] &lt;/p&gt;
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft