Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sendmail mail relay configuration on AIX

1,166 views
Skip to first unread message

john.pa...@btinternet.com

unread,
Dec 1, 2015, 9:48:04 AM12/1/15
to
I am having real trouble in getting sendmail configured to act as a relay on AIX. All I want to be able to do is send mail from the Unix box via a mail gateway. In older versions of AIX it was simply change the DS value in the sendmail.cf file and away you go, but in 7.1 this simply doesn't work. If I run "sendmail -v mye...@myhost.com" it will sit there forever, same with mailx.

I know that I can talk to the relay server and send mail to it, but how do I get sendmail on AIX to do this for me?:

Here is the manual run showing what I'm trying to do:

==========================================
root@aixdb2: / # telnet aixmail 25

Trying...
Connected to aixmail.fsc.uk.
Escape character is '^]'.
220 aixmail.fsc.uk ESMTP Sendmail Thu, 3 Nov 2011 15:45:05 GMT

helo aixmail

mailserver (setting up the communication,'ehlo' works as well)
250 aixmail.fsc.uk Hello aixdb2.fsc.uk [10.200.200.22], pleased to meet you

mail from: some...@anything.com

mailbox (don't forget on mailrelay could be some restricions)
250 2.1.0 some...@anything.com... Sender ok  

rcpt to: mail_a...@anything.com  

250 2.1.5 mail_a...@anything.com... Recipient ok

data

subject: test message

this is a test message from aixdb2

.
250 2.0.0 pA3Fj5mf586210 Message accepted for delivery

quit
==========================================

So I basically want sendmail to re-write the username from "root@hostname" to "ro...@anything.com" and then forward to my "aixmail" gateway. Should be fairly simple, but something is not working as expected. I believe it is something to do with external MX record lookup as I've seen similar issues on redhat which were fixed by telling it not to do external MX lookup, but no such option seems to exist on AIX.

Any help would be gratefully received.


Thanks,
John

Grant Taylor

unread,
Dec 1, 2015, 11:56:10 PM12/1/15
to
On 12/01/2015 07:48 AM, john.pa...@btinternet.com wrote:
> I am having real trouble in getting sendmail configured to act as
> a relay on AIX. All I want to be able to do is send mail from the Unix
> box via a mail gateway. In older versions of AIX it was simply change
> the DS value in the sendmail.cf file and away you go, but in 7.1 this
> simply doesn't work. If I run "sendmail -v mye...@myhost.com" it will
> sit there forever, same with mailx.
>
> I know that I can talk to the relay server and send mail to it, but how
> do I get sendmail on AIX to do this for me?:
>

> So I basically want sendmail to re-write the username from "root@hostname"
> to "ro...@anything.com" and then forward to my "aixmail" gateway. Should
> be fairly simple, but something is not working as expected. I believe
> it is something to do with external MX record lookup as I've seen similar
> issues on redhat which were fixed by telling it not to do external MX
> lookup, but no such option seems to exist on AIX.
>
> Any help would be gratefully received.

Hi John,

The last time I had to work with Sendmail on AIX was a couple of years
ago and it was on a 6.1 (?) system. So, I'm not sure if it applies to 7.1.

At the time I had to install an additional package that brought the rest
of the m4 files in so that I could re-configure Sendmail per standard
Sendmail methods (mc -> cf).

After I got the proper files installed and found the mc file used to
create the default cf file shipped with AIX, I was able to start
configuring things the way that I wanted it.

I know it seems like the long way around the mountain, but I've found
the long way to be reliable. (I've just lost my notes on what packages
to install.)

As a bonus, you are using the union of IBM's AIX method that follows
Sendmail's mc -> cf method.



--
Grant. . . .
unix || die

john.pa...@btinternet.com

unread,
Dec 2, 2015, 6:55:34 AM12/2/15
to
Thnaks for the reply. After reading your post I did a re-google and found the following which works like a charm:

vi /etc/mail//sendmail.cf
a) configure relay host in Smart relay host entry
DSmailserver.xxxxxx.com
b) masquerade by entering my company's domain
DMxxxxxx.com
c) change entry Ruleset 94 by commenting out the R$ entry and adding
new entry with diffferent options

############################################## #####################
### Ruleset 94 -- convert envelope names to masqueraded form ###
############################################## #####################

SMasqEnv=94
#R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
R$+ $@ $>93 $1

Note the above new R$ entry line is very sensitive to where the spacing
and tabs are.
There are 3 'tabs' between R$+ and $@.
A space after $@, and then another space after >93.

0 new messages