AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
  • 1.  How to specify the SMTP getway ?

    Posted Tue August 22, 2006 08:22 AM

    Originally posted by: SystemAdmin


    Hi everybody,

    Does someone know how and where to specify the IP for the SMTP getway ?

    thanks in davance,
    #AIX-Forum


  • 2.  Re: How to specify the SMTP gateway ?

    Posted Tue August 22, 2006 08:27 AM

    Originally posted by: SystemAdmin


    excuse-me, i mean gateway not getway! ;-))
    #AIX-Forum


  • 3.  Re: How to specify the SMTP gateway ?

    Posted Tue August 22, 2006 08:44 AM

    Originally posted by: SystemAdmin


    I'm guessing you are trying to send mail from an AIX box to a SMTP server ?

    Then you have to take a good look at the /etc/sendmail.cf file ....
    (not really for the faint hearted that one :) )

    hint:

    look for the DSmailer:relayhostname entry, it should be edited to something like
    DSsmtp:<your.smtp.gateway>

    then you have to make sure sendmail is running ( or when it's allready running, you'll have it re-read it's config i.e. refresh -s sendmail )

    finally you can test it with

    sendmail -v

    more info in the man pages :)
    #AIX-Forum


  • 4.  Re: How to specify the SMTP gateway ?

    Posted Tue August 22, 2006 09:28 AM

    Originally posted by: SystemAdmin


    yes! i turn around with this sendmail.cf!! ;-)

    ysterday, i had the problem with the firewall.
    so today, they give another IP and tell me to put it into the SMTP gateway

    so that's what i've done
    1) to see if the sendmail is running:
    1. lssrc -s sendmail
    Subsystem Group PID Status
    sendmail mail 39862 active

    2) in the sendmail.cf
    1. "Smart" relay host (may be null)
    2. Relay host to forward outgoing mail not in the local domain to.
    3. To forward ALL mail to this relay host, uncomment the appropriate
    4. rule in ruleset 0, as indicated by the ruleset's comments.
    #DSmailer:relayhostname
    DSsmtp:IP_of_the_SMTP_gateway

    but it still doesn't work and i just get this message even with -v
    /dead.letter... Saved message in /dead.letter
    thanks for help!
    #AIX-Forum


  • 5.  Re: How to specify the SMTP gateway ?

    Posted Tue August 22, 2006 09:46 AM

    Originally posted by: SystemAdmin


    Ok,

    well next thing would be to look in you syslog as sendmail will log to that about what it's doing and what goes wrong.
    (you might have to tweak /etc/syslog.conf to get more info (don't forget to refresh the syslogd when you do :) )

    As I said .... sendmail is a quite complicated beast meant to do full fledged mail delivery....

    for just relaying mail to a smarter hos you might want to look at 'postfix' it's configuration is simpler ( but than agian you'll have to compile/install it yourself)

    There is plenty of info about sendmail on the internet ...
    www.sendmail.org might be a good place to start.

    (O'Reilly has a very good book about sendmail, but for what you want it's probably overkill)

    Good luck
    Remko
    #AIX-Forum


  • 6.  Re: How to specify the SMTP gateway ?

    Posted Tue August 22, 2006 10:05 AM

    Originally posted by: SystemAdmin


    First of all, you do not need to have sendmail running unless you need to receive mail at the host. Having it run without using it is a security hole that you do not need to open.

    Second, since you have not shown any of the commands that you are using, it
    is not clear that you are using even the mail -v command correctly.

    Third, there is a fairly easy way to test if the mail gateway is even running
    an SMTP daemon or is receiving mail. You cannot know that it is actually
    forwarding the mail until it is sent.

    One way to do this is to actually telnet to the gateway at port 25.
    tn <gateway> 25
    Trying...
    Connected to tesch.dfw.ibm.com.
    Escape character is '^T'.
    220 tesch.dfw.ibm.com ESMTP Sendmail Tue, 22 Aug 2006 08:55:26 -0500

    Then you have a gateway that works.
    You can actually send a mail, or just type HELP to learn about the mail server
    HELP
    214-2.0.0 This is sendmail version AIX5.3/8.11.6p2
    214-2.0.0 Topics:
    214-2.0.0 HELO EHLO MAIL RCPT DATA
    214-2.0.0 RSET NOOP QUIT HELP VRFY
    214-2.0.0 EXPN VERB ETRN DSN AUTH
    214-2.0.0 STARTTLS
    214-2.0.0 For more info use: HELP <topic>.
    214-2.0.0 To report bugs in the implementation send email to
    214-2.0.0 sendmail-bugs@sendmail.org.
    214-2.0.0 For local information send email to Postmaster at your site.
    214 2.0.0 End of HELP info
    • Then you can type QUIT to quit, or you can actually send an email this way
    quit
    221 2.0.0 tesch.dfw.ibm

    Once you know the gateway is right, then you can see if the mail was received
    by the gateway. In this case I'm sending mail directly to another host in my
    same domain. Notice how I am using a full domain name. I shouldn't need to
    do this, but it is always good practice and will help you debug.
    1. mail -v jwtesch@teschp2.dfw.ibm.com
    Subject: What
    Now
    .
    Cc:
    jwtesch@teschp2.dfw.ibm.com... Connecting to teschp2.dfw.ibm.com. via esmtp...
    220 teschp2.dfw.ibm.com ESMTP Sendmail Tue, 22 Aug 2006 08:43:29 -0500
    >>> EHLO tesch.dfw.ibm.com --- if you didn't get this far, you've got problems
    250-teschp2.dfw.ibm.com Hello tesch.dfw.ibm.com http://9.19.51.184, pleased to meet you
    250-ENHANCEDSTATUSCODES
    250-EXPN
    250-VERB
    250-8BITMIME
    250-SIZE
    250-DSN
    250-ONEX
    250 HELP
    >>> MAIL From:<jwtesch@tesch.dfw.ibm.com> SIZE=51
    250 2.1.0 <jwtesch@tesch.dfw.ibm.com>... Sender ok
    >>> RCPT To:<jwtesch@teschp2.dfw.ibm.com>
    250 2.1.5 <jwtesch@teschp2.dfw.ibm.com>... Recipient ok
    >>> DATA
    354 Enter mail, end with "." on a line by itself
    >>> .
    250 2.0.0 k7MDhTd307418 Message accepted for delivery
    jwtesch@teschp2.dfw.ibm.com... Sent (k7MDhTd307418 Message accepted for delivery)
    Closing connection to teschp2.dfw.ibm.com.
    >>> QUIT
    221 2.0.0 teschp2.dfw.ibm.com closing connection

    • That is all there is to it, except to look on the mail server side
    and check the message is received.

    1. ls -l /var/spool/mail
    total 8
    -rw-rw---- 1 hock mail 0 Nov 02 2005 hock
    -rw-rw---- 1 jwtesch mail 624 Aug 22 08:43 jwtesch

    cat -v /var/spool/mail/jwtesch
    From jwtesch@tesch.dfw.ibm.com Tue Aug 22 08:43:29 2006
    Received: from tesch.dfw.ibm.com (tesch.dfw.ibm.com http://9.19.51.184) by teschp2.dfw.ibm.com (AIX5.3/8.11.6p2/8.11.0) with ESMTP id k7MDhTd307418 for <jwtesch@teschp2.dfw.ibm.com>; Tue, 22 Aug 2006 08:43:29 -0500
    Received: (from root@localhost)
    by tesch.dfw.ibm.com (tesch5.3/8.11.6p2/8.11.0) id k7MDieJ209034
    for jwtesch@teschp2.dfw.ibm.com; Tue, 22 Aug 2006 08:44:40 -0500
    Date: Tue, 22 Aug 2006 08:44:40 -0500
    From: John Tesch <jwtesch@tesch.dfw.ibm.com>
    Message-Id: <200608221344.k7MDieJ209034@tesch.dfw.ibm.com>
    To: jwtesch@teschp2.dfw.ibm.com
    Subject: What

    Now

    On the other hand, if I send to a host not running sendmail, I get
    root@teschp2 / # mail -v root@fs1
    Subject: Try with DS
    Gateway
    .
    Cc:
    root@fs1... Connecting to fs1.dfw.ibm.com. via esmtp...

    • just sets there timing out.

    Now I set the DS in the /etc/sendmail.cf file to my other AIX host

    DSsmtp:tesch.dfw.ibm.com
    root@teschp2 / # mail -v hillery@myplace.ibm.com
    Subject: Bad
    Addr
    .
    Cc: '
    '... User unknown
    hillery@myplace.ibm.com... Connecting to tesch.dfw.ibm.com. via smtp...
    220 tesch.dfw.ibm.com ESMTP Sendmail Tue, 22 Aug 2006 09:00:47 -0500
    >>> EHLO teschp2.dfw.ibm.com
    250-tesch.dfw.ibm.com Hello teschp2 http://9.19.51.185, pleased to meet you
    250-ENHANCEDSTATUSCODES
    250-EXPN
    ...

    250 HELP
    >>> MAIL From:<root@teschp2.dfw.ibm.com> SIZE=53
    250 2.1.0 <root@teschp2.dfw.ibm.com>... Sender ok
    >>> RCPT To:<hillery@myplace.ibm.com>
    550 5.7.1 <hillery@myplace.ibm.com>... Relaying denied
    >>> RSET
    250 2.0.0 Reset state
    [b]/dead.letter... Saved message in /dead.letter[/b]
    Closing connection to tesch.dfw.ibm.com.
    >>> QUIT
    221 2.0.0 tesch.dfw.ibm.com closing connection

    • This is because I've disabled relaying on the DS host (for security
    reasons). So that gateway needs turned on if it is going to be an email
    gateway. This case, the problem is not on the client but on the
    mail gateway.

    #AIX-Forum


  • 7.  Re: How to specify the SMTP gateway ?

    Posted Wed August 23, 2006 08:57 AM

    Originally posted by: SystemAdmin


    ok, thank you CompuChem!
    the first test : telnet IP 25 doesn't work!!
    so i'm waiting for it from another dept.

    but i would like to know (for later) :
    where can you get your full domain name (tesch.dfw.ibm.com and teschp2.dfw.ibm.com) before putting them into the sendmail.cf ?

    in the e-mail adress tap of my outlook , i have 3 lines
    SMTP:my_first_name.my_name@my_company.com
    smtp:my_first_name.my_name@frex.exch.my_company.com
    after that i have a line with many parameters
    x400:c=,a=,p=,o=,cn=

    in your example, to which of these things correpond your tesch.dfw.ibm.com ?
    and where can you look for teschp2.dfw.ibm.com ?

    Thks

    #AIX-Forum


  • 8.  Re: How to specify the SMTP gateway ?

    Posted Wed August 23, 2006 09:00 AM

    Originally posted by: SystemAdmin


    ... and the command that i used to test is:

    mail -v my_first_name.my_name@frex.exch.my_company.com
    and sometimes with
    mail -v my_first_name.my_name@my_company.com

    thks
    #AIX-Forum


  • 9.  Re: How to specify the SMTP gateway ?

    Posted Wed August 23, 2006 09:40 AM

    Originally posted by: SystemAdmin


    ok, when i type telnet IP 25 from a pc on the same network of the gateway, i've got the fully qualified domain name!

    Thanks a lot for your example!! ;-))
    #AIX-Forum


  • 10.  Re: How to specify the SMTP gateway ?

    Posted Fri October 06, 2017 01:11 AM

    Originally posted by: aruraja


    Hi,

       I am working on performance and monitoring application which has been installed in power AIX version 7.1 and i'm trying to enable alert for increase in CPU% by sending a mail to particular mail id's.I came to know that entire mail configuration would takes place in "sendmail.cf" but unable to find my smtp server name/address and DNS name of the system.Please help me to resolve this.We are new to AIX environment if you have help with step by step would be helpful


    #AIX-Forum