01-24-2012 05:46 AM
I'm forwarding emails (MAIL>set forward /user=localuser CENTER::USER) from production VMS servers to the only VMS server which has SMTP enabled (CENTER) . From here, it is forwarded to Lotus email (MAIL>set forward/user=USER SMTPfirstname.lastname@example.org" ).
The forwarded emails have the decnet format in sender field "SERVER::localuser"@vmsdomain.com
The problem is that, after an upgrade, Lotus server is rejecting all emails from senders containing ":" character. The admin from Lotus support advised that we change sender address, because character ":" (colon) is agains RFC rules. I found in RFC 2822 that the colon is indeed to be avoided, but only for field names, not for field bodies; I guess Lotus admin interpreted differently.
When I send email from command line (MAIL NL: /subject="test" smtp%"email@example.com" ) from CENTER server, the sender address does not contain the 2 colons "::" and email is received correctly. Sender shows like "USER@vmsdomain.com"
I tested with logical name TCPIP$SMTP_FROM defined /system /exec on the SMTP VMS server and it works, but I cannot use it because it's affecting also customer emails. I only need this sender address changed for the specific account which is sending reports from all servers; also the is only one destination address for this purpose.
For the record, I'm runing OpenVMS 7.3.-2, TCPIP V5.4 - ECO 7
Solved! Go to Solution.
01-24-2012 06:05 AM - edited 01-24-2012 06:15 AM
Unfortunately all forwarded emails are sent from CENTER node using account SMTP$SERVER , and not the specific account. Would be good if there was a way to change this behaviour.
It will not help to define this logical on each server which is sending reports (where mails are sent using utility MAIL from the specific account used for reports), I already tested.
01-24-2012 06:19 AM
there is an OpenVMS Freeware utility called 'DELIVER'. It may be possible to use this to individually process each mail separately.
For more information, look at:
01-24-2012 12:07 PM
So your production server has (only) a DECnet connection to the remote SMTP server?
Or does your production server (also) have IP, but no local SMTP server?
If it's the latter case, run some php or analogous code that uses a remote mail server directly, and that bypasses the limited SMTP server that's part of TCP/IP Services. I'd tend to expect that the PHPmailer script would work here, and there are SMTP-capable libraries available for most any modern scripting language.
If you're inclined, there's also a DCL procedure around that connects DECnet to submit VAX mail remotely, if you're willing to tweak some port access protections. That's a couple-dozen lines of DCL.
If you have a support contract, then upgrade to the current TCP/IP Services patch for V5.4, and (if the colons persist) ask HP about the colons in the forwarding.
01-24-2012 01:28 PM - edited 01-24-2012 01:34 PM
Your SMTP$SERVER account has a LOGIN.COM, which is probably empty at the moment. If you can identify the incoming email request you want to change, you can define TCPIP$SMTP_FROM.
Without doing anything clever, you can immediately identify the source node of the request as logical name SYS$REM_NODE. So, if all mail from SERVER1 needs a modified from address, all you need to is test SYS$REM_NODE, and if it matches, define TCPIP$SMTP_FROM to whatever you want. If you need to be more selective there are other network structures you can look into (but I'm not sure if you can do it in a non-descructive manner).
Simple way to start investigating, add this line to LOGIN.COM:
and in SHOWALL.COM:
$ SHOW LOGICAL
$ SHOW SYMBOL *
Now start sending different mails and compare the outputs in the log files.
I also wonder what happens if you change your initial forward to:
MAIL>set forward /user=localuser SMTP%"USER@CENTER.mydomain.com"
Another trick we use... if the set of target addresses is fairly small is to create tcpip alias addresses which point to your gateway node. For example, suppose your corporate addresses are "firstname.lastname@example.org" and you also want to be able to send messages to "email@example.com", "firstname.lastname@example.org" and "email@example.com". Your node with an SMTP server, and access to the outside world is CENTER.MYCORP.COM at IP address 10.1.1.10. On SERVER1.MYCORP.COM and SERVER2.MYCORP.COM, start the SMTP service. All you need to define is the general gateway, which points to 10.1.1.10. The trick is to define each target domain as an alias of the gateway address in the local host file. Thus:
$ TCPIP SET HOST CENTER/ADDRESS=10.1.1.10/ALIAS=(mycorp.com,another
Since the nodes are isolated from the rest of the world anyway, it doesn't matter that these addresses translate to the wrong address. The only one which might cause trouble is "mycorp.com" if the node is a member of that domain.
Now, from SERVER1 and SERVER2 you can send "directly" to addresses in those domains. What's more, defining TCPIP$SMTP_FROM works as you expect from the sender process on SERVER1. The mechanism is the SMTP server on SERVER1 translates (say) gmail.com into 10.1.1.10, so it delivers the mail to that node, but the "to" address is still in text form. When CENTER receives the message, it translates gmail.com into the proper address and forwards it.
(Note that the limitation of having to define all the potential target domains can be turned into a virtue wrt auditors. You can say that processes on SERVER1 and SERVER2 can ONLY send mail to your specified set of authorised addresses ;-)
01-25-2012 04:30 AM - edited 01-25-2012 06:31 AM
@All Thanks to all for your replies.
@Volker, Hoff I wanted a more simple solution, before starting to search new software or make major changes, but thanks anyway.
The solution I was thinking to was to use decnet copy from production nodes to central node instead of mail, then run a batch job on central node to search for new reports and send them by email. But John's solution is more simple.
@John, In fact it is user MAIL$SERVER and not smtp$server as I wrote in previous post, but worked as you said, with conditional defining of TCPIP$SMTP_FROM inside the login.com
I used SYS$REM_ID instead of node, because there are just too many nodes.
Thanks a lot
01-25-2012 05:16 AM
01-26-2012 03:00 AM
After losing some new emails, and after more analysis and watching the log file SYS$SPECIFIC:[MAIL$SERVER]NET$SERVER.LOG , I noticed that SYS$SPECIFIC:[MAIL$SERVER]login.com is executed only some times and that this is because MAIL_SERVER object is spawnining a process Server_xxx which is used by more decnet mails, in a similar way that the FAL$SERVER is reusing one process for more decnet copy transfers. If there is no decnet mail traffic, the process Server_xxx dies and another one is spawned when next decnet mail is coming; so all emails sharing the same decnet process are sharing also the same logical name TCPIP$SMTP_FROM. This is not good.
I'm searching now a way to make the process die immediately so there will be only one process per mail.
01-26-2012 03:42 AM - edited 01-26-2012 03:43 AM
I'm getting the distinct impression you want a solution that you can picture and understand and support (entirely reasonable), but where youre headed right now is not (in this case) probably going to be the simple solution.
You're aiming at a set of solutions that requires system-wide effects including defeating cached processes, proper timeout management in an environment than can potentially (or actuall) invoke asynchronous arriving traffic, and setting up the return address within a shared context. That's sounding not-simple. What happens if you (still) receive two messages within your far shorter server process timeout?
Pipe your data over to the server with SMTP using some client DCL to server DCL, and MAIL it from there.
(There are other and more ways to communicate with a remote SMTP server, but I'm guessing you're not familiar with Perl, php or Python, and not looking to move to a compiled-in client, nor migrate to Process Software's SMTP client transport. DCL, particularly, lacks all IP capabilities.)
Run some experiments with the client-server DCL. That doesn't involve digging around underneath mail, nor managing process deletion in an asynchronous environment, and you have full control over the dedicated DCL-based server process running on the SMTP server host; the code that's sending the outbound mail.
01-26-2012 11:30 PM
Putting define netserver$timeout 0 only inside SYS$SPECIFIC:[MAIL$SERVER]login.com solved that last issue.
I think this is also limiting the possible system-wide side effects on other decnet activities.
@Hoff, Thanks for your input
I brute-tested sending batched decnet mails simultanously from different servers and noticed no problem; I see in accounting the MAIL$SERVER decnet processes are even overlapping.
Also tested your dcl mail (http://labs.hoffmanlabs.com/node/725), quite interesting is that mail object can be open/read/write in the same time by 2 processes.
01-27-2012 04:55 AM
>quite interesting is that mail object can be open/read/write in the same time by 2 processes.
You're on a network. Stuff happens asynchronously. And with the massive increases in mobile web activity, the network connections can randomly drop as the client crosses cell coverage dead spots, meaning the servers have to contend with gltiches most anywhere in the traffic.
Writing AST-based event-driven servers on VMS is fairly easy, and most servers on VMS are either AST-based or they'll use something akin to inetd or its DECnet analog to start up server processes for incoming connections. Apache uses a pool of server processes for its traffic.
(This is AST-based processing I'm referring to with the VMS server processes. Threaded code with pthreads has rather more "gnarly" than does AST-based code, in my experience. Fewer VMS server processes use threads.)