PDA

View Full Version : sendmail



techkarthi
30th June 2010, 05:09 AM
Hi all,

Problem in sendmail.For the past two days im working on it.I have reviewed many forums helps,suggestions.

The problem is . I need to send an email from command line as mail -v abv@gmail.com

I have installed sendmail and sendmail-cf.
I have done the basic configuration

in /etc/mail/sendmail.mc ( commented the line DAEMON_OPTIONS )
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart

Then i tried mail -v abv@gmail.com
yes i got email.
nmap localhost

25 smtp port
telnet localhost 25
yes i got connected

THE PROBLEM is :
I need to configure sendmail port as 2025 instead of 25

First I configured port as 2025 in /etc/mail/sendmail.mc
DAEMON_OPTIONS port=2025 (instead of smtp)

m4 sendmail.mc > sendmail.cf
service sendmail restart

I tried to sendmail
Connecting to [127.0.0.1] via relay...
abv@gmail.com... Deferred: Connection refused by [127.0.0.1]

I tried one more change adding up the following line in sendmail.mc
define(`RELAY_MAILER_ARGS', `TCP $h 2025')
define(`ESMTP_MAILER_ARGS', `TCP $h 2025')

m4 sendmail.mc > sendmail.cf
service sendmail restart

The same error ( connection refused )

The third option I tried in the sendmail.cf
Mrelay, P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,
T=DNS/RFC822/SMTP,
A=TCP $h 2025

In the last line $h was there.I added 2025 port number

After restarting sendmail I got the same error. Deffered connection error.

I read in a forum to change the smtp 25 to 2025 in /etc/services

After that i did not get the connection refused error.

[root@efycaci21 ~]# mail -v abv@gmail.com
Subject: test
as
as
.
Cc:
abv@gmail.com... Connecting to [127.0.0.1] via relay...
220 test.acme.com ESMTP Sendmail 8.14.2/8.14.2; Wed, 30 Jun 2010 09:29:07 +0530
>>> EHLO test.acme.com
250-test.acme.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root@test.acme.com> SIZE=54 AUTH=root@test.acme.com
250 2.1.0 <root@test.acme.com>... Sender ok
>>> RCPT To:<abv@gmail.com>
>>> DATA
250 2.1.5 <abv@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 o5U3x7aV002568 Message accepted for delivery
abv@gmail.com... Sent (o5U3x7aV002568 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 test.acme.com closing connection

I tried to check the 2025 port number is listening. nmap localhost
PORT STATE SERVICE
111/tcp open rpcbind
2025/tcp open ellpack

Now mail is not getting delivered. It is /var/spool/mqueue
The mails are in queue.

Kindly suggest me what else I need to do

even in /etc/mail/access i have entered my localhost ,127.0.0.0,IP address, as RELAY

Is it possible to change the default port number to customized port number. The reason I wish to change the port number is. I need to run James mail server in the same machine which requires 25 port.