View Full Version : [Solved] Missing logical link in knowledge
September 1st, 2009, 12:35
I've posted problem here. (http://email@example.com/msg15665.html)
Now that person implies that I need to gain unix knowledge on pipe.
I know what is pipe. I use it everyday to pipe data from one command to another.
So I have no idea what is missing link in my knowledge here.
That is, if I "figure" pipe I'll solve whole problem there...
Can you help me? :beergrin
September 1st, 2009, 13:08
I have no idea why those people are hammering on about pipes. You're simply posting message headers and a message body on standard input (okay, call it a 'reverse pipe'), which is totally normal.
There's nothing wrong with using:
sendmail -G -i -f someone@domain someone_else@domain [enter]
sendmail -t someone_else@domain <<EOF [enter]
Of course, you can put this in a text file called 'content':
and then run
cat content | sendmail -G -i -f someone@domain someone_else@domain
That's what you do if your email contents are already on file and just need to be piped through sendmail, but Sendmail doesn't mind whether you penetrate it from the front (pipe) or the back (standard input), so to speak ..
September 1st, 2009, 13:26
I think the postfix guys mean you cannot do
sendmail -G -i -f someone@domain someone_else@domain <message+headers>
All on one line. That's why they're mentioning pipes. The solution is to use the last example DD gave.
September 1st, 2009, 13:28
What is the problem anyway?
September 1st, 2009, 14:03
Look here! (http://firstname.lastname@example.org/msg15672.html)
I've gave EXACT example, how do I use sendmail which is what DutchDeamon posted and which proves I've already KNEW that but they continued to hammer "solution is in pipe, which you do not understand, and when you do, EVERYTHING shall be solved" :stud
Time wasters! x(
And here is my final response to them
I've goofed searching man pipe, for BASE FreeBSD installation.
AFTER I've installed postfix, then "man 8 pipe" became available!
So here it is: (I've forgot to also search installed pors /apps man pages)
Now I would like to solve something, as it apperas there is a problem in communication here.
We will talk about piping here and ignore all other issue ATM.
Conversation went this way:
Filter is using this command: (after filtering message and in order to return it filtered back to postfix)
/usr/local/sbin/sendmail -G -i -f email@example.com firstname.lastname@example.org
<Comment: As we can see, mail(header+body) is at new line, which indicates ENTER has been pressed>
> The sendmail commend is a pipe. Don't put headers+body on the command line.
<Comment: As commented above, headers+body AREN'T been on the command line as ENTER has been pressed>
<Comment: This is where major confusion started to arise>
Yes I know that.Simply haven't knew how to formulate this mail comand line.
I send mail by firstly typing: /usr/local/sbin/sendmail -G -i -f email@example.com firstname.lastname@example.org
Then I hit enter. Then I paste mail(header + body).
Then I hit:
<Comment: This was critical point AT which major confusion should've been STOPED>
<Comment: As I see, this was supposed to prove I know how to use sendmail and what pipe IS>
> Since you don't seem to have understood my answers, probably a
> book on using Unix or Linux would help you most at this point.
<Comment: Here I've been led into believing I have a missing link in knowledge about pipe>
Now how could that be?!?
Now day later, I've found out I've been discovering warm water again.
My last "Me:" part must have been proved, that I've know what pipe is. So how come it did not?
What have I done wrong??
Executing "/usr/local/sbin/sendmail -G -i -f email@example.com firstname.lastname@example.org" [ENTER]
Gives a PIPE
Then I write mail(header + body)
And how -i arg has been passed to sendmail I dont put a dot "." at new line.
I press ^D [ctrl-D] instead!
Then mail is being sent and sendmail returns it's status code
So why hammering pipe???
September 2nd, 2009, 01:40
There was some error when user, other than root, has been filtering mail.
Error was visible only when I manually executed:
# cat mail_in_file | ./mail_filter.php email@example.com firstname.lastname@example.org
Syntax error: "(" unexpected
I simply changed php code related to execution of shell functions.
Finally, I've completely solved a problem.
Now for a future reference:
where I can find Syntax error: "(" unexpected, error logged, as it wasn't in postfix error log:
Thanks in advance
September 28th, 2009, 17:54
you are probably missing something like
at line 0 on your php script.
dunno I ain't a php man.
cat mail_in_file | php ./mail_filter.php email@example.com firstname.lastname@example.org
logged in as root eh?
September 28th, 2009, 18:39
At line 0..., it has always been there.
And I've solved this long ago and everything is working smoothly now.
September 28th, 2009, 19:17
Please post the solution for the archives.
September 30th, 2009, 17:43
Shell was one that echoed Syntax error: "(" unexpected, because it didn't liked a way PHP "treated" it.
So I've simply used other PHP function for comunnication with shell.
Instead of just executing command like you wouldls -al, I've used PHP's popen to open pipe to sendmail
$po = popen(/usr/local/sbin/sendmail -some_param, 'w');
And then were writing mail to $po
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.