Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AIX Sendmail

Status
Not open for further replies.

crmayer

Programmer
Nov 22, 2002
280
US
we have a program that gives a user the ability to send mail from our unix box with AIX 4.3.3, the problem is when they send something it goes out as first name and first letter of last name (this is the login for the user on the unix server).

example....
John Doe, this would be sent at johnd@company.com

The problem I am running into is that John Does actual e-mail address is john.doe@company.com. So if somebody replies to it, it comes back as undeliverable, could not find johnd@company.com. Well, that is not a valid e-mail address. I want the reply to go to John's pop server account that he has set up for the company.

Is there a way in sendmail to say if John Doe (johnd) sends something via mail it will put john.doe@company.com instead of johnd@company.com?
 
I have already edited that file and it does not seem to work. Unless there is something in the sendmail config that I need to change so it looks at that file?
 
I appologize. After you edited the /etc/alaiases, you have to run "newaliases" command.
 
If "newaliases" does not work, run "sendmail -bi" that should do the same thing...

were you able to get this issue resolved?
 
Maybe I am not explaining this problem the way I should. When an email leaves the unix server, it never returns. If you were to reply to an e-mail that I sent from our imaging product (which it would orginate on the unix server), it would go to our Email provider and fail because it would not be a valid e-mail address. Let say my username on the unix server is chrism, my e-mail address is chris.mayer@company.com. The e-mail that is sent from the unix server combines unix useranem with our domain, therefore is says the mail was sent from chrism@company.com. So, if you reply to the e-mail (chrism@company.com) it goes to our email provide (which is off site) and gets rejected because that is not a valid e-mail address. The reply never gets back to the unix server from which it was originated. Therefore, I need sendmail to change the from address (from chrism@company.com to chris.mayer@company.com) before it leaves the unix server, this way somebody could reply to that e-mail.

I am sorry if I did not explain this corretly, I find that most things are much harder to explain through typeing opposed to talking person to person.

So, with the above proposed, can send mail do this? Is this even possible?
 
Okay to convert chrism to chris.mayer@company.com do this.

In your /etc/mail/aliases have something like this.

chrism:chris.mayer@company.com

then run,
/usr/ucb/newaliases
or
/usr/sbin/sendmail -bi


then copy and paste this line into the shell.
echo "Hello from `hostname` @ `date`" | mailx -s "Testing from `hostname`" chrism




Don't worry about the return envelope for now...lets get this fixed now :)

Let us know how this goes...
 
OK, I will try that, but I should also add that we run AIX 4.3.2.0.
So from what I have seen/learned is that my aliases file is located in /etc/aliases. I already have that entry in there.
On running the newaliases, I then ran /usr/sbin/sendmail -bi.
As for the next step, what shell do I put that in?
 
Just paste that in the anyshell on that server.

echo "Hello from `hostname` @ `date`" | mailx -s "Testing from `hostname`" chrism
 
OK, I just created a new file called testmail and put that line in there, then made it an executable file. Will that work?
 
yes. Run that file, and let us know if you get an email...

Make sure you put a -v for mailx command, like this mailx -v -s "Testing from `hostname`" chrism
 
OK,
I must have done something wrong here.

This is what my testmail file looks like:
echo "Hello from 'hostanme' @ 'date'"| mailx -v -s "Testing from 'hostname' chrism"

This is what I get when I run it:

The flags you gave make no sense since you're not sending mail.

 
it needs to be
echo "Hello from `hostname`@`date`" | mailx -v -s "Testing from `hostname`" chrism


"If you always do what you've always done, you will always be where you've always been."
 
I got it... sorry.

Yes, it worked and I got an e-mail.

$ testmail
chrism... aliased to chris.mayer@company.com
chris.mayer@company.com... Connecting to mail.company.com. via esmtp...
220 company.com ESMTP
>>> EHLO rs6000.company.com
250-company.com
250-PIPELINING
250-SIZE 10485760
250 8BITMIME
>>> MAIL From:<chrism@rs6000.company.com> SIZE=94
250 ok
>>> RCPT To:<chris.mayer@company.com>
250 ok
>>> DATA
354 go ahead
>>> .
250 ok 1113482739 qp 60167 by company.com
chris.mayer@company.com... Sent (ok 1113482739 qp 60167 by company.com)
Closing connection to mail.company.com.
>>> QUIT
221 company.com
 
Well done ...

&quot;If you always do what you've always done, you will always be where you've always been.&quot;
 
Well, the e-mail did get sent to me, but the the address in the from line is still chrism@company.com... I can not reply to that message.
 
Setting up the virtual hosting is a pain.
Maybe another aproach would be to create a script which would create the name john.doe
Do all the users have their full name in /etc/passwd ?
Then create an alias for the mailx command that automatically put in the reply to address.
ie. mailx -r "john.doe@company.com" -s "test" jane.doe@home.com
This could be easily done

&quot;If you always do what you've always done, you will always be where you've always been.&quot;
 
Good!

So, the email is coming to you, but when you press reply on your Mail Client, put this address:

chrism@company.com instead of chris.mayer@company.com?
 
rzs0502
So you would recommend creating a script that would change the name from who the e-mail is comming from?

Mag0007
Yes, I did get the e-mail, but you are correct, if I hit reply in my ms outlook client it tries to send the e-mail to chrism@company.com instead of chris.mayer@company.com

 
Okay...

Try this, you need to create a generic table.


Create a file called,
/etc/generics

And put this into the file.
chrism chris.mayer@company.com


Then, run
makemap -hash generics <generics

Make sure this is uncommented in your /etc/sendmail.cf file
Kgenerics hash /etc/mail/genericstable

Uncomment
# handle generics database
UNCOMMENT ALL THESE LINES
# End of generics table specific rules


then send yourself an email as you did before, and let us know...

 
Sorry to make this so difficult, I am no wiz with AIX....

When I run makemap -hash generics <generics I get an error.

ksh: makemap: not found.

Also, after I uncomment those lines, is there something I have to run to make those changes take effect in the sendmail.cf file?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top