Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 18th April 2002, 16:44
Ilansu's Avatar
Ilansu Ilansu is offline
Member
 
Join Date: Feb 2002
Posts: 81
Ilansu is on a distinguished road
Baan: Bann IV C4 ,C2 - DB: informix - OS: Unix , NT
Question Email

Email from Baan script

Hello all
I’m working on Baan IV c4 installed on Unix.
You probably discussed this in the past but……
We have a customer service which handle the customers complains
When getting the complain we send the customer gets an email response.
I need to be able to send the email directly from a Baan script( choice.user.).
All the fields (from / to / subject / etc’) can be field in a Baan session and copied to an ASCII file if need.

Does any one have the full solution without executing a VB program.
Can I do it all within the script or with some Unix commands?

Thanks
Ilan S
Reply With Quote
  #2  
Old 18th April 2002, 16:59
Han Brinkman's Avatar
Han Brinkman Han Brinkman is offline
Guru
 
Join Date: Aug 2001
Location: The Netherlands
Posts: 1,155
Han Brinkman has a spectacular aura aboutHan Brinkman has a spectacular aura about
Baan: All - DB: Oracle/ms-sql/db2 - OS: *nix/windows
mail

I know that if you put the entry mailhost in /etc/hosts on a Sun machine you can use the mailx functionality direct.

On others it could be a bit more complicated that you have to edit the sendmail.cf file in /etc in other to make the mailhost known.

Han
Reply With Quote
  #3  
Old 18th April 2002, 17:35
norwim's Avatar
norwim norwim is offline
Guru
 
Join Date: Oct 2001
Location: Germany Moenchengladbach
Posts: 450
norwim is on a distinguished road
Baan: some - DB: more - OS: many
try to telnet to the mailhost on port 25.
If it responds, you need the following commands
HELO a_name
MAIL FROM: a_name
RCPT TO: email@adress_destination
(RCPT TO: another@adress_if_you_like)
DATA
all that
you type in now
will be
posted, until
there is a line with a
single dot
like this below
.
QUIT
If this experiment works, you can build a file which contains the data like above. Then cat this file to a pipe and telnet it to port 25

cat the_file | telnet IP_ADRESS_OF_MAILHOST 25

This works perfectly here, we use it to send emails out of Baan programs.

hth

Norber
__________________
Have a nice day
Reply With Quote
  #4  
Old 18th April 2002, 19:22
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,028
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
If you are on the HP Unix you can try this -

email.comm = "echo test|mailx -s " & subject & email.addr & filename

e = shell(email.comm, 0)

email.comm - email command

echo test - I dont know it expects some echo command at the beginning to make the mailx work.

-s - option for the subject

email.addr = email address of the recepient

filename - the file name/path in which the email is composed.

I hope it helps.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #5  
Old 19th June 2002, 09:00
Neal Matthews's Avatar
Neal Matthews Neal Matthews is offline
Guru
 
Join Date: Sep 2001
Location: Nottingham
Posts: 483
Neal Matthews is on a distinguished road
Baan: Baan IVc4 ags0 - DB: Informix 9.40 UC4 - OS: Sun Solaris 9
Hello I'm trying to use the following from an earlier post to send myself a simple e mail via telnet on port 25 of my SMTP server.

HELO a_name
MAIL FROM: a_name
RCPT TO: email@adress_destination
DATA
test
.
QUIT

cat the_file | telnet IP_ADRESS_OF_MAILHOST 25

This works perfectly in the telnet session but when I try it from cat the_file it doesn't work. The system just returns "connection closed by foreign host" in repsonse to the quit which is the expected output but mail the is not being sent.

Can anybody with a little more unix knowhow suggest how I can track this problem or suggest any further testing.

I am using the telnet method as opposed to mailx as my unix server is not the mail server and I am attempting to get my mail to be sent from a notes server.

Is there any way that you can specify the ip address of the mail server when using mailx ?

Regards
Neal Matthews
Intier Automotive - IT Support Analyst
Reply With Quote
Sponsored Links
  #6  
Old 19th June 2002, 13:33
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Not an Expert

I am not an expert, but couldn't you put the IP Address in the /etc/hosts file like Han suggested. Then you could use the mailx command directly. I am not an expert on getting mailx to work, but that was all I did on one of our unix boxes.

Below is a test I did. I needed to find out if I could page people from Baan. It works on our sun system. Just remember it was just a limited test.

Good Luck!

Mark

Code:
function extern tuddc.dllfile.alpha_page(domain tcmcs.str10 pager.number,
                                         domain tcmcs.str20 subject,
                                         domain tcmcs.str132 msg)
{
        string  temp.file(1024),cmd(1024)
        long    status,f1

| Create temporary file to copy the PC file to
        temp.file = creat.tmp.file$(bse.tmp.dir$())
        temp.file = strip$(temp.file)

| Open Server file for processing.
        f1     = seq.open(temp.file,"w")
        seq.puts(msg,f1)
        status = seq.close(f1)
        cmd    = sprintf$("-c %smailx %s@epage.arch.com -s%s<%s%s" ,chr$(34),str
ip$(pager.number),subject,temp.file,chr$(34))
        status = run.prog("sh",cmd,RP_WAIT)
        seq.unlink(temp.file)
}
Reply With Quote
  #7  
Old 19th June 2002, 14:17
Neal Matthews's Avatar
Neal Matthews Neal Matthews is offline
Guru
 
Join Date: Sep 2001
Location: Nottingham
Posts: 483
Neal Matthews is on a distinguished road
Baan: Baan IVc4 ags0 - DB: Informix 9.40 UC4 - OS: Sun Solaris 9
Thanks Mark,

I went back and read Han's post properly.

I have been editing the hosts file but not with the mailhost entry.

I've now got mailx working properly so I just need to fiddle around with it a bit.

Regards
Neal Matthews
Intier Automotive - IT Support Analyst
Reply With Quote
  #8  
Old 28th July 2008, 19:08
DSonifer DSonifer is offline
Junior Member
 
Join Date: Sep 2002
Location: Arlington MA (near Boston)
Posts: 12
DSonifer is on a distinguished road
Baan: Baan IVc4 - DB: Tbase (BISAM) - OS: HP-UX 11.0
Trouble with mailx/sendmail

I know this is an old post. Did you ever get mailx to work with input a file rather than interactively entering data? I am stuck on that spot.

Running HPUX 11.00, also trying from Linux Redhat Enterprise Edition.
Reply With Quote
  #9  
Old 29th July 2008, 07:57
günther günther is offline
Guru
 
Join Date: Jan 2002
Location: Ehingen, Germany
Posts: 571
günther is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Hi,

I would suggest the following tests:

1. cat /etc/passwd | mailx -s subject your_local_unix_user
You should receive that mail on unix; use "mailx" to read it.

2. cat /etc/passwd | mailx -s subject your_offical_mail_account
You sould now receive that mail as usual (windows?). If not: use "mailq" on your unix box to check, if the mail is not buffered there. Check your /var/adm/syslog/mail.log file.

If anything fails: The minimum is to setup a "smart relay host" (see DS in /etc/mail/sendmail.cf); enter the fully qualified name of your smtp server. Remember to restart sendmail (/sbin/init.d/sendmail stop; /sbin/init.d/sendmail start) after changes to that file.

Günther
Reply With Quote
  #10  
Old 31st July 2008, 09:23
Neal Matthews's Avatar
Neal Matthews Neal Matthews is offline
Guru
 
Join Date: Sep 2001
Location: Nottingham
Posts: 483
Neal Matthews is on a distinguished road
Baan: Baan IVc4 ags0 - DB: Informix 9.40 UC4 - OS: Sun Solaris 9
Hello,

This is the command I most commonly use within script files generally called by the Baan job queue. There should be several similar examples on the board which explain the use of uuencode.

uuencode /triappiv/bse/home/tools/test /triappiv/bse/home/tools/test.html | mailx -s "SUBJECT" -r sender@test.co.uk receiver@test.com

Cheers Neal
Reply With Quote
  #11  
Old 31st July 2008, 17:10
DSonifer DSonifer is offline
Junior Member
 
Join Date: Sep 2002
Location: Arlington MA (near Boston)
Posts: 12
DSonifer is on a distinguished road
Baan: Baan IVc4 - DB: Tbase (BISAM) - OS: HP-UX 11.0
I can send an email using telnet to Port 25 of my email sever (Microsoft Exchange); see below. At least sometimes I can. I succeeded once today but am unable to successfully receive an email after doing another telnet command.

Just in case this is important, we are running HP Unix version 11.00.


/# telnet serv10.conwed.conwedplastics.com 25
Trying...
Connected to serv10.conwed.conwedplastics.com.
Escape character is '^]'.
220 serv10.conwed.conwedplastics.com Microsoft ESMTP MAIL Service, Version: 6.0.
3790.3959 ready at Thu, 31 Jul 2008 08:52:52 -0500
helo dks
250 serv10.conwed.conwedplastics.com Hello [140.140.100.16]
mail from: dks
250 2.1.0 dks@conwedplastics.com....Sender OK
rcpt to: dennis.sonifer@conwedplastics.com
250 2.1.5 dennis.sonifer@conwedplastics.com
data
354 Start mail input; end with <CRLF>.<CRLF>
line 1
line 2 NOTE: here I pressed <ctl>d, then entered the 2 lines with just periods
.
.
250 2.6.0 <SERV10ek91HbJggVZVE00000011@serv10.conwed.conwedplastics.com> Queued
mail for delivery
quit
221 2.0.0 serv10.conwed.conwedplastics.com Service closing transmission channel
Connection closed by foreign host.


This is the email I received via Exchange & Outlook
-----Original Message-----
From: dks@conwedplastics.com [mailto:dks@conwedplastics.com]
Sent: Thursday, July 31, 2008 9:50 AM
Subject:

line 1
line 2
end of file next
.

This is the same entry as what succeeded earlier but now nothing from Exchange & Outlook

/var/adm/syslog# telnet mailhost 25
Trying...
Connected to mailhost.
Escape character is '^]'.
220 serv10.conwed.conwedplastics.com Microsoft ESMTP MAIL Service, Version: 6.0.
3790.3959 ready at Thu, 31 Jul 2008 09:51:29 -0500
helo dks
250 serv10.conwed.conwedplastics.com Hello [140.140.100.16]
mail from: dks
250 2.1.0 dks@conwedplastics.com....Sender OK
rcpt to: dennis.sonifer@conwedplastics.com
250 2.1.5 dennis.sonifer@conwedplastics.com
data
354 Start mail input; end with <CRLF>.<CRLF>
test line 1
test line 2 NOTE: I also tried entering <ctl>d and another line with "." but made no difference.
250 2.6.0 <SERV10FIROy6h9O8bLY00000014@serv10.conwed.conwedplastics.com> Queued
mail for delivery
quit
221 2.0.0 serv10.conwed.conwedplastics.com Service closing transmission channel
Connection closed by foreign host.
/var/adm/syslog#

I don't know why there is still a domain error. Here is sendmail.cf file with Dj macro set and Smart Relay value. When I enter command sendmail -bt it shows that macros $m and $j are set to conwedplastics.com

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
# DKS 29 Jul 2008: added fully qualified domain name
Dj$w.conwedplastics.com # NOTE: I also tried Dj$w.conwed.conwedplastics.com and Dj$w.conwed1.conwed.conwedplastics.com
# "Smart" relay host (may be null)
#DS
DS serv10.conwed.conwedplastics.com

Jul 31 09:39:04 conwed1 /sbin/init.d/sendmail[15907]: #### rebooted ####
Jul 31 09:39:04 conwed1 sendmail[15915]: unable to qualify my own domain name (c
onwed1) -- using short name
Jul 31 09:39:04 conwed1 sendmail[15915]: be sure to set domain name in Dj macro
in sendmail.cf
Jul 31 09:39:04 conwed1 sendmail[15915]: alias database /etc/mail/aliases rebuil
t by root
Jul 31 09:39:04 conwed1 sendmail[15915]: /etc/mail/aliases: 7 aliases, longest 9
bytes, 88 bytes total
Jul 31 09:39:04 conwed1 sendmail[15916]: unable to qualify my own domain name (c
onwed1) -- using short name
Jul 31 09:39:04 conwed1 sendmail[15916]: be sure to set domain name in Dj macro
in sendmail.cf
Jul 31 09:39:04 conwed1 sendmail[15917]: starting daemon (8.9.3 (PHNE_29773)): SMTP+queueing@00:30:00

My /etc/hosts also have the domain name. Also 'mailhost' defined so I could use mailx command.

# See the hosts(4) manual page for more information.
# Note: The entries cannot be preceded by a space.
# The format described in this file is the correct format.
# The original Berkeley manual page contains an error in
# the format description.
#
140.140.100.16 conwed1 # L2000 HP Server
140.140.100.16 conwed1.conwed.conwedplastics.com # Fully Qualified Domain Name
140.140.1.85 serv10.conwed.conwedplastics.com # MS Exchange Server
140.140.1.85 mailhost # MS Exchange Server
127.0.0.1 localhost loopback
Reply With Quote
  #12  
Old 1st August 2008, 08:30
günther günther is offline
Guru
 
Join Date: Jan 2002
Location: Ehingen, Germany
Posts: 571
günther is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Your /etc/hosts is wrong. It must loook like

140.140.100.16 conwed1 conwed1.conwed.conwedplastics.com # L2000 HP Server
140.140.1.85 mailhost serv10.conwed.conwedplastics.com # MS Exchange Server
127.0.0.1 localhost loopback

Only one line per IP address, followed by a list of host names and aliases.

When you then restart sendmail (/sbin/init.d/sendmail stop, /sbin/init.d/sendmail start), is there still the "unable to qualify my own domain name" problem?

Günther
Reply With Quote
  #13  
Old 1st August 2008, 16:14
DSonifer DSonifer is offline
Junior Member
 
Join Date: Sep 2002
Location: Arlington MA (near Boston)
Posts: 12
DSonifer is on a distinguished road
Baan: Baan IVc4 - DB: Tbase (BISAM) - OS: HP-UX 11.0
One step forward; now 'just' transient parse error

I updated the /etc/hosts file as you suggested. Then stopped and restarted sendmail. I then tried the following command (cat /home/dks/x.txt | mailx -s "Testing" dennis.sonifer@conwedplastics.com -- where x.txt consists of 2 lines
Line 1
Line 2
, but still getting a 'transient parse error'; see mail.log text below:

Aug 1 09:02:43 conwed1 /sbin/init.d/sendmail[27634]: #### rebooted ####
Aug 1 09:02:43 conwed1 sendmail[27657]: alias database /etc/mail/aliases rebuil
t by root
Aug 1 09:02:43 conwed1 sendmail[27657]: /etc/mail/aliases: 7 aliases, longest 9
bytes, 88 bytes total
Aug 1 09:02:44 conwed1 sendmail[27666]: starting daemon (8.9.3 (PHNE_29773)): S
MTP+queueing@00:30:00
Aug 1 09:04:37 conwed1 sendmail[28281]: JAA28281: to=dennis.sonifer@conwedplast
ics.com, delay=00:00:00, mailer=relay, relay=serv10.conwed.conwedplastics.com, s
tat=Transient parse error -- message queued for future delivery
Aug 1 09:04:37 conwed1 sendmail[28281]: JAA28281: from=root, size=179, class=0,
pri=30179, nrcpts=1, msgid=<200808011404.JAA28281@conwed1.conwed.conwedplastics
.com>, relay=root@localhost
Aug 1 09:04:37 conwed1 sendmail[28281]: JAA28281: to=dennis.sonifer@conwedplast
ics.com, delay=00:00:00, mailer=relay, stat=queued
Reply With Quote
  #14  
Old 1st August 2008, 16:53
DSonifer DSonifer is offline
Junior Member
 
Join Date: Sep 2002
Location: Arlington MA (near Boston)
Posts: 12
DSonifer is on a distinguished road
Baan: Baan IVc4 - DB: Tbase (BISAM) - OS: HP-UX 11.0
SUCCESS!! and thanks

I updated the Domain Name Servers, adding the 2 in our network, stopped/restarted sendmail. No more reference to not being able to determine domain name.

I was still getting transient parse errors. I updated the DNS entries using SAM and that error disappeared. And now I have successfully used the mailx command to send a file
Reply With Quote
  #15  
Old 4th August 2008, 07:26
günther günther is offline
Guru
 
Join Date: Jan 2002
Location: Ehingen, Germany
Posts: 571
günther is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Hi,

congratulations! Now since your sendmail works, you could do some useful things:
  • edit /etc/aliases and add a line that maps your unix user to your full email account; let's say you login as 'dsonifer' on the unix box. The you could add a line

    dsonifer : dennis.sonifer@conwedplastics.com

    Then run 'newaliases' and restart sendmail. No you can run 'mailx dsonifer' and you get that mail to your outlook(?) account.
  • you can also map users to other users to get their mail forwarded

    root : dsonifer
  • you can also build groups or mailing lists, e.g.

    joberrors : user1, user2, user3
Funny, isn't it?

Günther
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Email device not working (from Baan) nick_rogers Tools Development 8 16th December 2003 23:15
Service module in Baan en@frrom Project & Services 6 12th September 2003 09:48
email from Baan benito General Discussion & Chat 5 25th October 2002 19:26


All times are GMT +2. The time now is 21:16.


©2001-2017 - Baanboard.com - Baanforums.com