Difference between revisions of "Setting Up Mailman For External Email"

From VistApedia
Jump to: navigation, search
 
Line 6: Line 6:
 
==Receiving==
 
==Receiving==
 
While you can expose your VISTA system to the outside world, it is better to have email go through your own mail server and then be relayed to VISTA. Either way, the VISTA set-up is the same.
 
While you can expose your VISTA system to the outside world, it is better to have email go through your own mail server and then be relayed to VISTA. Either way, the VISTA set-up is the same.
 +
 +
I have a domain name that is linked to my ip address through dynamic DNS. So I opened port 25 on my router and had it forwarded to the machine hosting VISTA on port 25 on the machine. So if I send email to my domain from Gmail, it reaches VISTA.
  
 
Set-up a xinetd listener to forward requests on port 25 (or another port, if you are forwarding email to VISTA from a mail server) to a script that sets up GT.M and calls <code>GTMLNX^XMRUCX</code>.
 
Set-up a xinetd listener to forward requests on port 25 (or another port, if you are forwarding email to VISTA from a mail server) to a script that sets up GT.M and calls <code>GTMLNX^XMRUCX</code>.
  
<pre>
+
<pre style="padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em">
 
sudo cat vista_pocn-moh_mm_port25
 
sudo cat vista_pocn-moh_mm_port25
 
service vista-mm
 
service vista-mm
Line 26: Line 28:
 
</pre>
 
</pre>
  
<pre>
+
<pre style="padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em">
 
sam@sam-desktop:~/pocn-moh$ cat mm_rpcproc
 
sam@sam-desktop:~/pocn-moh$ cat mm_rpcproc
 
#!/bin/bash
 
#!/bin/bash
Line 41: Line 43:
 
$gtm_dist/mumps -run GTMLNX^XMRUCX 2>> rpc_log.log
 
$gtm_dist/mumps -run GTMLNX^XMRUCX 2>> rpc_log.log
 
exit 0
 
exit 0
 +
</pre>
 +
 +
Stop xinetd and start it in debug mode:
 +
 +
<pre style="padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em">
 +
sam@sam-desktop:/etc/xinetd.d$ sudo service xinetd stop
 +
* Stopping internet superserver xinetd                                  [ OK ]
 +
sam@sam-desktop:/etc/xinetd.d$ sudo xinetd -d
 +
</pre>
 +
 +
Make sure you see this line to indicate that your service started.
 +
 +
<pre style="padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em">
 +
11/5/18@13:06:29: DEBUG: 6623 {cnf_start_services} Started service: vista-mm
 +
</pre>
 +
 +
Check netstat -tnlp to see that your port is open.
 +
 +
<pre style="padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.1em">
 +
sam@sam-desktop:~$ netstat -tnlp
 +
(Not all processes could be identified, non-owned process info
 +
will not be shown, you would have to be root to see it all.)
 +
Active Internet connections (only servers)
 +
Proto Recv-Q Send-Q Local Address          Foreign Address        State      PID/Program name
 +
tcp        0      0 0.0.0.0:9200            0.0.0.0:*              LISTEN      -
 +
tcp        0      0 0.0.0.0:9201            0.0.0.0:*              LISTEN      -
 +
tcp        0      0 0.0.0.0:9270            0.0.0.0:*              LISTEN      -
 +
tcp        0      0 0.0.0.0:22              0.0.0.0:*              LISTEN      -
 +
tcp        0      0 127.0.0.1:631          0.0.0.0:*              LISTEN      -
 +
tcp        0      0 0.0.0.0:25              0.0.0.0:*              LISTEN      -
 +
tcp        0      0 0.0.0.0:8001            0.0.0.0:*              LISTEN      -
 +
tcp        0      0 0.0.0.0:9250            0.0.0.0:*              LISTEN      -
 +
tcp        0      0 0.0.0.0:10025          0.0.0.0:*              LISTEN      -
 +
tcp        0      0 127.0.0.1:3306          0.0.0.0:*              LISTEN      -
 +
tcp        0      0 0.0.0.0:9260            0.0.0.0:*              LISTEN      -
 +
tcp        0      0 0.0.0.0:9100            0.0.0.0:*              LISTEN      -
 +
tcp6      0      0 :::80                  :::*                    LISTEN      -
 +
tcp6      0      0 :::22                  :::*                    LISTEN      -
 +
tcp6      0      0 ::1:631                :::*                    LISTEN      -
 +
tcp6      0      0 :::443                  :::*                    LISTEN      -
 +
tcp6      0      0 :::5900                :::*                    LISTEN      1472/vino-server
 
</pre>
 
</pre>

Revision as of 10:11, 18 May 2011

Sending

Most people want to send email to the outside world from VISTA. So we will start with that.

First you need to set-up an Email Server that accepts unauthenticated email via SMTP and relays it to the outside world. If you have an old style smtp relay server from your ISP, that will suffice. If you, like me,

Receiving

While you can expose your VISTA system to the outside world, it is better to have email go through your own mail server and then be relayed to VISTA. Either way, the VISTA set-up is the same.

I have a domain name that is linked to my ip address through dynamic DNS. So I opened port 25 on my router and had it forwarded to the machine hosting VISTA on port 25 on the machine. So if I send email to my domain from Gmail, it reaches VISTA.

Set-up a xinetd listener to forward requests on port 25 (or another port, if you are forwarding email to VISTA from a mail server) to a script that sets up GT.M and calls GTMLNX^XMRUCX.

sudo cat vista_pocn-moh_mm_port25
service vista-mm
        {
        disable = no
        port = 25
        socket_type = stream
        protocol = tcp
        user = sam
        server = /bin/bash
        groups = yes
        server_args = /home/sam/pocn-moh/mm_rpcproc
        type = UNLISTED
        wait = no
        }
sam@sam-desktop:~/pocn-moh$ cat mm_rpcproc
#!/bin/bash
#
cd /home/sam/pocn-moh
export gtm_dist=/opt/fis-gtm/V5.4-002A/utf8/
export gtmroutines="uo(routines) $gtm_dist"
export gtmgbldir=mumps.gld
export PATH=$PATH:$gtm_dist
export gtm_chset=utf-8
export gtm_icu_version=4.2
export gtm_badchar=0
date>>rpc_log.log
$gtm_dist/mumps -run GTMLNX^XMRUCX 2>> rpc_log.log
exit 0

Stop xinetd and start it in debug mode:

sam@sam-desktop:/etc/xinetd.d$ sudo service xinetd stop
 * Stopping internet superserver xinetd                                  [ OK ]
sam@sam-desktop:/etc/xinetd.d$ sudo xinetd -d

Make sure you see this line to indicate that your service started.

11/5/18@13:06:29: DEBUG: 6623 {cnf_start_services} Started service: vista-mm

Check netstat -tnlp to see that your port is open.

sam@sam-desktop:~$ netstat -tnlp
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:9200            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9201            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9270            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:8001            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9250            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:10025           0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9260            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9100            0.0.0.0:*               LISTEN      -
tcp6       0      0 :::80                   :::*                    LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -
tcp6       0      0 ::1:631                 :::*                    LISTEN      -
tcp6       0      0 :::443                  :::*                    LISTEN      -
tcp6       0      0 :::5900                 :::*                    LISTEN      1472/vino-server