This content has been marked as final. Show 12 replies
Sounds like the connection was dropped by the remote host. Many times, this is a result of the remote host identifying you as a spam site and just dropping the connection.
Try doing a manual connection to that host using telnet and just type the commands to see what might be wrong. If they are dropping you, most of the time they say why or that they are doing so.
I replace sendmail with a bundled version of Exim on all my servers now. Better logging and easier configuration.
When i do Telnet, says connection open.
what's this Exim?
To test with telnet, you need to provide the smtp port like
# telnet hostname.domain.com 25
That should get you that servers smtp port (many times Sendmail). You would then use smtp commands to test the server. Example...
- - - - - - - - - - - - - - - - - - - -
# telnet somehost.mail.com 25
Connected to somehost.mail.com.
Escape character is '^]'.
220 somehost.mail.com ESMTP Generic MTA Thu, 27 Jul 2006 13:33:04 -0700
250 somehost.mail.com Hello myhost.com [xxx.xxx.xxx.xxx] <- IP would be your IP
mail from: firstname.lastname@example.org
rcpt to: email@example.com
354 Enter message, ending with "." on a line by itself
Subject: This is a test
This is a test message
250 OK id=1G6CY2-00044z-0B
221 somehost.mail.com closing connection
- - - - - - - - - - - - - - - - - - - -
Exim = http://www.exim.org
there are several binary builds you could use as well. I have a simple tarball that I built to load onto a Sun box that creates the necessary files/dirs permissions etc.. and all you have to do is change the hostname and you have a basic mail client/server. I replace sendmail on all our sun boxes with it.
How can i schedule this in a cron?
Man pages for sendmail are so fishy.
Can some one send me the options like
sendmail -v ......................................
Message: status report
to: firstname.lastname@example.org, email@example.com
Assuming sendmail is configured properly, you want to use mailx instead of sendmail itself to do that...
Logged in as the user xyz
To make it look like it is coming from a user other than the logged in user requires the use of sendmail but the user needs to be trusted to allow it.
mailx -s 'status report' firstname.lastname@example.org, email@example.com < /tmp/report.log
I was looking for options in Sendmail to do it.
In order to make mail look like it comes from someone else, the sender must be Trusted. Then you can use the -f switch to say who the Envelope Sender (Sender of the mail) is like below:
The -t switch tells sendmail to use the headers found in the mail_file to do the rest of the headers including From: To: Subject etc. and figure out who the mail is sent to.
/usr/lib/sendmail -f firstname.lastname@example.org -t < mail_file
Make sure you create valid Date and Message-ID headers too or your mail may be dropped as Spam.
If this is for Cron job like entries, unless you want to write your own wrapper for sendmail you are much better off using mailx.
From: email@example.com To: firstname.lastname@example.org, email@example.com Subject: Test message Date: Tue, 1 Aug 2006 12:31:24 -0700 (MST) Message-ID: <firstname.lastname@example.org> Sample Mail message using full headers.
This is what i was expecting.
Now my question is can i add the log file which i need to be send to the users in the mail_file list?
/usr/lib/sendmail -f email@example.com -t < mail_file /tmp/report.log
though i am now comfortable with mailx, would like to know out of curiosity!
One of the reasons why you want to use mailx is because it is a Mail User Agent (MUA). It adds necessary headers when you use it so that you don't have to.
Sendmail is not a MUA but rather a Mail Transfer Agent (MTA) and is normally what an MUA talks to, to send mail. So it works more in raw mode.
You can create scripts (ksh, perl even PHP) that can do custom stuff with sendmail to get what you want but by default, mailx sends mail as the user that is running it and is more than enough to do what is necessary, especially for sending log files.
Doing that, you can make mail look like just about anything you want, but you need to know some coding to make it work.
I cannot access my Inbox, instead Im receiving below error message
"ERROR: Could not complete request.
Query: SELECT "INBOX"
Reason Given: Internal error occurred. Refer to server log for more information. [2006-08-30 15:29:38]"
when I try to restart my sendmail the following error message appairs
Failed to start sendmail :
Starting sendmail: [ OK ]
Starting sm-client: exim abandoned: unknown, malformed, or incomplete option -L
Are you restarting sendmail as root user?
Above threads would help you!