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?
 
It should be in

/usr/sbin/makemap

Nope you don't have to run anything, I would just run:

sendmail -bi as before.


Let us know...
 
Yes, try using makedbm

It creates a dbm hash, so you should be fine.

 
This is the workaround I tried.
Created a file called newmail.ksh and sourced it in .profile

#!/usr/bin/ksh

MAILDOM="@gmail.com"
FNAME=`lsuser -a gecos $USER | sed s/"$USER gecos="/""/g | awk ' {print $1} '`
SNAME=`lsuser -a gecos $USER | sed s/"$USER gecos="/""/g | awk ' {print $2} '`
CHAR=`printf "%c\n" $SNAME`
REPLYTO=$FNAME$CHAR$MAILDOM
export REPLYTO
alias mailx="mailx -r $REPLYTO"



"If you always do what you've always done, you will always be where you've always been."
 
Come to think of it. You could create a file like /etc/mailtab

#UnixID #Email
darthv dvader@deathstar.org
lukes skywalkers@jedi.net

Then in the .profile

REPLYTO=`cat mailtab | grep $USER | awk ' {print $2} '`
alias mailx="mailx -r $REPLYTO "


"If you always do what you've always done, you will always be where you've always been."
 
The flags for makedbm are a little different...

Usage:
makedbm -u file
makedbm [-b] [-s] [-i YP_INPUT_FILE] [-o YP_OUTPUT_FILE]
[-d YP_DOMAIN_NAME] [-m YP_MASTER_NAME] infile outfile


What would be equivalant to makemap -hash generics <generics
 
WOW, it definately changed the e-mail address that the mail was from... But I don't think that is what we were looking for...

Here is what the email shows it is from:

chrism@rs6000.company.com.chrism@company.com@mark

I think something went astray there.... My entry in the generics file is this:
chrism chris.mayer@company.com
 
Okay...thats good.

What do you have in your "DM" setting in your sendmail.cf file?

Have you set up masqueradaing yet?
 
This is what it in the file...
# who I masquerade as (null for no masquerading)
DMcompany.com

As for the masquerading.....
It appears that all the masquerading lines in sendmail.cf are uncommented. Is there a file that should go alone with that like the generics file?
 
Okay.


Checkout ruleset94. Have something like this?
###################################################################
### Ruleset 94 -- convert envelope names to masqueraded form ###
###################################################################

S94
R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2



Also,
ls -la /etc/generics* ?
Do you have a file called generics.db?

 
There is an entry in the sendmail.cf file that says this:

# my official domain name
# Use this only if you wish to override the default.
#Dj$w.$m
Djrs6000.company.com

What is this for, and I am guessing that this is where the rs6000 part of that last e-mail address came from?
 
##########################################################
# Ruleset 94 -- convert envelope names to masqueraded form #
##########################################################

S94
#R$+ $@ $>93 $1
R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2

on the generics.db, no there is not a file by that name. There are 3 generics files:
generics
generics.dir
genercis.pag
 
After I make a change to the sendmail.cf file, what do I have to run?

When I run sendmail -bt now, I get this message:

dbm map "generics": unsafe map file /etc/genericstable
Address Test Mode (ruleset 3 is not automatically invoked)

I did send an e-mail and it was still the same as before, but I am not sure if I am supposed to run something after commenting that line out.
 
Instead of using the makemap or makedbm try using the "hash" command

/usr/bin/hash

When you make changes to /etc/sendmail.cf you don't need to refresh anything in your case.

When you make changes to aliases, domaintables, etc..etc..run sendmail -bi

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top