LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-07-2011, 11:42 AM   #1
blainemiller
Member
 
Registered: Dec 2003
Posts: 78

Rep: Reputation: 1
Sendmail piping from a text file


Hello,

I'm trying to pipe from a textfile to sendmail.

The command I'm using on teh sendmail server is:

[root@sendmail-server test]# sendmail to-email-address@relay_server-address < test2.txt

test2.txt is:

Date: 1/6/2011
To: to-email-address@relay_server-address
Subject: ** PROBLEM alert - vvmite02/Florida Handset 02 is CRITICAL **
From: from-email-address@sendmail-server
This is a test three
.

I'm doing this because I was doing this from an aliases file just fine until about three weeks ago. The aliases file suddenly stopped working after the relay server received an inordinate amount of email from the From: address and for the To: address.

I suppose I need a sendmail guru?

Thanks in advance for your time and assistance.

Blaine
 
Old 01-07-2011, 01:52 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Hang on... Didnt see that part of the post. Let me get back to you here in a second.

Got it. So you want to use an input file, not manual input.

The text file would be:

Quote:
to: me@somewhere.com
to: you@somewhere.com
subject: This is the subject
Test message
Then do a

Quote:
sendmail -vt < text.txt

or

sendmail -vt -G relay.server.com < text.txt

Last edited by szboardstretcher; 01-07-2011 at 02:11 PM.
 
Old 01-07-2011, 03:36 PM   #3
blainemiller
Member
 
Registered: Dec 2003
Posts: 78

Original Poster
Rep: Reputation: 1
szboardstretcher,

Tried as you suggested. Thanks for the excellent tip. The email is still not getting through. Could it be that the from-email-name.somewhere.com is getting filtered somehow?

I must admit, I'm a bit confused by sendmail and its workings.

Just a pup, as it were...

Thanks for your time and consideration.

Blaine
 
Old 01-07-2011, 04:10 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,223
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
You can use the -f option to specify the sender:
Code:
sendmail -f sender@domain.com -t < test2.txt
 
Old 01-07-2011, 04:22 PM   #5
blainemiller
Member
 
Registered: Dec 2003
Posts: 78

Original Poster
Rep: Reputation: 1
bathory,

Good suggestion. Tried it with the same null results. sendmail doesn't error, but I don't get the message either.

I'm leaning more and more towards some sort of filtering on the relay server. All the other emails from this domain are passed.

Thanks very much for your continued time and patience.

Blaine
 
Old 01-07-2011, 04:32 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,223
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Take a look at /var/log/maillog to see if the message was accepted by the relay.
Maybe it's finished in recipient's trash or spam folder.
 
Old 01-07-2011, 04:40 PM   #7
blainemiller
Member
 
Registered: Dec 2003
Posts: 78

Original Poster
Rep: Reputation: 1
bathory,

Good idea. I'll call the owners of the relay server and ask them if they're filtering me. I've checked my logs and the stat=Sent for all the messages to the relay server from my sendmail server.

This sure does get complicated. At least to me.

Thanks again for your patience and consideration.

Blaine
 
Old 01-08-2011, 08:25 AM   #8
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
Originally Posted by blainemiller View Post
bathory,

Good idea. I'll call the owners of the relay server and ask them if they're filtering me. I've checked my logs and the stat=Sent for all the messages to the relay server from my sendmail server.

This sure does get complicated. At least to me.

Thanks again for your patience and consideration.

Blaine
Sounds like the mail is leaving your server. With the -v option on the sendmail command, do you see that the sender and receiver are correct? If so, it is probably your relay filtering your mail, which may not give you an error, it may instead take the message, report that it has taken the message, then silently drop it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
piping text to email mek1 Linux - Software 2 04-28-2009 02:24 PM
sendmail : How to email contents of a text file? concoran Linux - Newbie 5 03-09-2008 08:27 PM
Help Piping a Text File Into rm chantrek Linux - Newbie 12 04-02-2007 08:44 AM
Piping output to text files corbis_demon Linux - General 3 10-12-2004 03:33 AM
Piping output to a text file joadoor Linux - Newbie 7 04-19-2002 03:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration