Operating System - OpenVMS
1748045 Members
5081 Online
108757 Solutions
New Discussion

SMTP - Change sender for specific forwarded emails

 
SOLVED
Go to solution
vms
Occasional Collector

SMTP - Change sender for specific forwarded emails

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 SMTP%myuser@mydomain.com" ). 

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%"myuser@mydomain.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

 

11 REPLIES 11
abrsvc
Respected Contributor

Re: SMTP - Change sender for specific forwarded emails

I have no way to test this, but perhaps setting the logical name within the GROUP table will work for this account?

Dan
vms
Occasional Collector

Re: SMTP - Change sender for specific forwarded emails

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.

 

Catalin

Volker Halle
Honored Contributor

Re: SMTP - Change sender for specific forwarded emails

Catalin,

 

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:

 

http://www3.sympatico.ca/n.rieck/docs/openvms_notes_deliver.html

 

Volker.

Hoff
Honored Contributor

Re: SMTP - Change sender for specific forwarded emails

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.

 

John Gillings
Honored Contributor
Solution

Re: SMTP - Change sender for specific forwarded emails

Catalin,

 

   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:

 

$ @SHOWALL/OUTPUT=LOGIN.LOG

 

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 "someone@mycorp.com" and you also want to be able to send messages to "someone@anothercorp.com", "someone@pager.service.com" and "someone@gmail.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,anothercorp.com,pager.service.com,gmail.com)

 

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 ;-)

A crucible of informative mistakes
vms
Occasional Collector

Re: SMTP - Change sender for specific forwarded emails

@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

 

Catalin

Hoff
Honored Contributor

Re: SMTP - Change sender for specific forwarded emails

FWIW...

 

If you're still running DECnet and thinking "COPY" and "BATCH" for remote operations, then something such as DECnet task-to-task in DCL, or remote queue operations via the DQS product, can be a good fit.

 

And here is the DCL-sending DECnet MAIL-11 MAIL code.

 

vms
Occasional Collector

Re: SMTP - Change sender for specific forwarded emails

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.

Hoff
Honored Contributor

Re: SMTP - Change sender for specific forwarded emails

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.