Programming :: Procmail Piping To A PHP Script

Aug 6, 2010

I have my .procmailrc file set up to pipe mail to a simple php script I've written. The only thing the script does at this point is echo back a "hello" message. However, procmail does not execute the script properly.

View 1 Replies


ADVERTISEMENT

CentOS 5 Server :: Procmail: Piping To A Php Script?

Aug 6, 2010

I have my .procmailrc file set up to pipe mail to a simple php script I've written. The only thing the script does at this point is echo back a "hello" message. However, procmail does not execute the script properly.

Here's my script (/home/webs/site.com/scripts/echo.php):

#!/usr/local/bin/php
<?php
echo "hi.";
?>

View 3 Replies View Related

Programming :: Piping In Bash Using Python?

Dec 16, 2010

I have a bash script that I want to import in to Python, mainly just to see if I can or not. However in the script I do use some piping of commands into sed to trim it down to what I need. When I tried doing it with the os.system() call, it didn't work. The exact error is

sed: -e expression #1, char 16: unterminated `s' command

However the command that was run can be run in bash without an error. Is there a better/another way to do this? For reference the command is:

Code:

locate -n 1 wp-config.php | sed 's/wp-config.php/
/g' | sed '/wp-config.php/ d' | sed '/^$/ d'

View 3 Replies View Related

Programming :: Piping Cat Output To Variable?

Jan 10, 2010

New to ubuntu and shell scripting in general... currently I stored some data into a text file. Right now, I would like to output the data from the text file and store it into a variable. Here's what I have so far:

READ_FILE=$(cat $FILE_NAME)

This definitely works and READ_FILE has the necessary data. However, this command will trigger an output to std output and I will see data on the screen, which is not what I want. I tried:

cat $FILE_NAME | $READ_FILE

and various other variants of this. It does not output to std output but neither does anything gets stored into $READ_FILE. I tried:

cat $FILE_NAME >> $READ_FILE

and it arrived at an error of "ambiguous redirect".

View 12 Replies View Related

Programming :: Running More Than One Script In A Bash Script And Piping Results To SSH?

Jun 8, 2010

how to set the subject of this up.. but here is what I am trying to accomplish (please keep in mine, this is only my first month playing with ANY Linux programming): My shared web host limits running 2 CRONS or 2 SSH sessions at one time. I need to run more than that.. So, my solution is to run what I need on my home computer, and then push all the results via SSH to my web server.

To keep things timed, I am trying to call 4 bash scripts from inside of 1 bash script... Each bash script has variables I need to export out to the remote (web) server. Being that I can only run 2 SSH or 2 CRON sessions on the remote, it wouldn't do me any good to open up CRON or SSH remotely or locally - either way I'm maxing out. That is why I would like to call 1 final script that takes the output of the 4 bash scripts and does the job.

Main bash calls via CRON every 30 minutes:

Code: ./script_1 &
./script_2 &
./script_3 &
./script_4 &

[code]....

I need to scp the file saved by wget to the remote server. I also need to pass the SQL statement generated in each script as a command in SSH. I'm lost how to get the info from "script_x" into a string that can be used to SSH - and doing this all inside of ONE SSH command. Would I store the SQL strings in a file and call that in the SSH command line?

If so, what is the command to make sure the variable output in the "script_#" file is sent to a file? Can I call the variable from the main Bash Script? Now - the good news is, I can SSH from my local machine to the remote one.That is about as far as I got.Again - I am so new to this that my ears are still wet. This has been something I have been working on for a while, and I'm just lost at this point.

View 2 Replies View Related

General :: Piping Find To Rsyncrypto?

Aug 21, 2010

I am setting up rsyncrypto to create a backup of my user directory. I read that to exclude directories I need to exclude with find and pipe to rsyncrypto.

I am trying to exclude all .svn directories from getting encrypted and synced.

Here is the find command I'm using. I don't see any .svn directories in the output:

find ~/Documents -type d ( -name .svn ) -prune -o -print

But when I pipe the output to rsyncrypto I see lots of .svn directories getting encrypted.

find ~/Documents -type d ( -name .svn ) -prune -o -print | rsyncrypto -vc --trim=3 --filelist - /tmp/Documents/ Documents.keys backup.crt

rewrite the command to exclude from rsyncrypto any files/folders that have .svn in their path?

View 1 Replies View Related

General :: Piping Output Of List To Cp?

May 16, 2011

I have the following code

Code:

ls ~/ | grep ^[[:lower:]]

and would like to take the result of this output and use this as the basis for a cp command to move these files to another folder.

View 3 Replies View Related

General :: Redirecting Or Piping 'somecommand?

Oct 31, 2010

kernel 2.6, slackware 12.0mkisofs 2.01If I do 'ls --help|more' all's well. 'mkisofs --help' outputs its help screen, and I can use Shift+PgUp/PgDn to scroll through it. But I can neither pipe it to more or to less, nor redirect it to some file. more is simply ignored. Less, gets into less but only the last screenful is seen. Redirection, i.e. 'mkisofs --help>john.txt' produces an empty file (size= 0).

View 2 Replies View Related

General :: Determine The Actual Command That Is Piping?

Feb 11, 2011

Let's say I have a bash script called log.sh. In this script, I want to read in input from a pipe, but I also want to know the command used to pipe input into me. Example:

tail -f /var/log/httpd/error | log.sh

In the shell script, I want to know the command tail -f /var/log/httpd/error.

View 2 Replies View Related

General :: Piping Video Device Over SSH Or Tcptunnel ?

Aug 11, 2011

I want to attach an analog camera to an old linux computer and directly pipe the /dev/video0 to another computer, where I can use it as a device again (so /dev/video0 should go to /dev/remote0, for example)

(Reason for doing this is that the computer does not have enough power to encode the video)

Is that possible? I've seen people can pipe the data directly from the device over ssh into mplayer, but I need to have some sort of reference point for Zoneminder.

View 2 Replies View Related

Ubuntu :: Piping The Output Of The Shell To Notify-osd?

Apr 30, 2010

how would you go about piping the output of the shell to notify-osd?

View 5 Replies View Related

General :: Details On Piping Information Into Command

Feb 15, 2011

I am sure this has been covered before, however I do not know which terms to sue for searching for this, so I will try and explain it.

I have a program that I run at startup to connect me to my work VPN, specifically the Cisco VPN client. When running the program, it prompts me for my username and password. I would like to be able to automate the login process by piping the username and password into the program everytime it starts up (username and password cannot be passed as arguments to the program)

Something like echo username | echo password | vpn_script

View 2 Replies View Related

General :: Piping Data To Multiple Outputs?

Mar 29, 2011

I remember there was a command that would allow me to pipe data to an app and the use the | operator to pipe it into yet another app.

foo fooArg | Iforget app1 | app2

I forget what this command is but it pipes the data from foo into app1 and app2.

View 3 Replies View Related

Server :: Sendmail Piping From A Text File

Jan 7, 2011

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.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.

View 7 Replies View Related

Software :: Alternative To Cat For Piping Dvb Output To File?

May 12, 2010

I am looking for an alternative to cat for streaming the output (ATSC) of a dvb card to a file. cat works fine for a bit but there is some internal variable that reaches a size limit and stops it. As evident by the c error "variable has reached size limit" (sorry for the paraphrase I do not have the error in front of me.) That is ok, a co worker who knows c told me the best thing to do is to find some other utility to do this. cat /dev/dvb/adapter0 > test.mpg is what I am looking to replace. how to pipe this into some sort of compression utility.

View 4 Replies View Related

Ubuntu :: Piping Command Output Into Grep As Search Term?

Nov 11, 2010

I want to pipe the output of a command into grep as the search TERM, rather than the text to be searched, like this for example

Code:

cat /var/log/auth.log | grep date "&b &d"

so that I only see the lines in auth.log for the current day...but obviously that line doesn't work.... is there a way to do this with grep, or even another command?

View 4 Replies View Related

Ubuntu Networking :: Capturing Data On .pcap File And Piping It

Jun 22, 2011

I have a GPS device which sends in data on port number 5000, i am able to capture the data into a pcap file using tcpdump. Now my problem is, i need to pipe the data into a text file as and when data arrives into the pcap file continuously.I did extensive search, but to no avail. been trying to solve this for the past 3 days. I use the following commands to capture and pipe the data, but that happens only once when i issue the command. I want this to happen continuously as and when the data arrives.

View 1 Replies View Related

General :: Procmail: Forwarding Just Does Not Work?

Mar 13, 2011

I've spent pretty much the whole night trying to figure out how I can achieve the following: If a certain Keyword, say [key], is in the subject line, then the email is forwarded to a list of people.

My recipe (now) looks like this:

Code:
:0
* ^Subject: .*[key].*
! my-email@gmail.com
The (verbose) procmail logfile gives me this:

[Code]....

Is my recipe wrong in any way? I pretty much copied it from available ones.
It's a university server, so I'm no admin, just a user. How can I figure out whether some setting that the admin made prevents procmail from calling sendmail or whatever?

View 3 Replies View Related

Server :: Communigate Pro With Procmail Integration?

Feb 4, 2010

I want to know if I can you communigate Pro with procmail integration?

I have read and seen that, CommuniGate Pro has some nice features so I want to use it.

Or is there a way I can do email filtering in CommuniGate with out procmail?

View 1 Replies View Related

Server :: How To Setup Zimbra With Procmail

Mar 3, 2011

Have any one been able to setup zimbra with procmail? Procmail as the filter for zimbra I mean.

View 1 Replies View Related

Ubuntu :: Building A Dictionary With A Bash Script - Piping The Output To A File

Sep 5, 2010

i'm building a dictionary with a bash script. it works perfect except i'd prefer something faster. btw i'm just piping the output to a file.

[Code]...

View 1 Replies View Related

General :: Procmail Executing Perl Script

Jan 13, 2011

I have procmail parsing the subject line of incoming e-mail and depositing individual files in a folder that match the procmail recipe.I want to have that recipe spawn a perl script to parse the file to pull out specific information. I've googled this and found many examples but none of them work.When it finds a matching inbound message it logs it correctly in the charge.log file, writes the message in charges/new/xxx but skips the /home/rowan/billing.pl script.

View 2 Replies View Related

Server :: MailBox Quota With Sendmail & Procmail

Dec 13, 2009

I am using sendmail-8.13 & procmail as an MDA. Now as our mail users are increasing I need to put up mailbox quota limit for every user. I have gone through the search engine but could not found any effective help to configure mailbox quota with sendmail & procmail.

View 7 Replies View Related

Server :: Configure Procmail For Sendmail But Its Not Working?

May 12, 2010

I'm trying to configure procmail for sendmail but its not working. I added these 2 lines to sendmail.mc:

define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
FEATURE(local_procmail)dnl

So my question is, where do I put .procmailrc? An examples I found on the net has the procmailrc in the users mail directory, but there are no user mail directories on the sendmail server. It is used purely to relay mail to the Exchange server.

View 1 Replies View Related

Server :: Integrate Procmail With Qmail Using Webmin?

Feb 17, 2010

How to integrate procmail with qmail using the webmin?

View 7 Replies View Related

Software :: Procmail - Filtering Out Emails With Attachments

Apr 11, 2011

I am trying to filter out attachment emails using procmail. I have tried this:
Code:
#Config:
SHELL=/bin/sh
PATH=/bin:/usr/bin:/usr/bin
MAILDIR="/var/mail/root"
LOGFILE=/var/log/procmail.log
LOGABSTRACT=ALL
VERBOSE=ON
:0
*^Content-Transfer-Encoding: base64$ {
| echo $LASTFOLDER }
[/code]

As you can probably guess, this line "Content-Transfer-Encoding: base64" appears when emails come with attachments, but the result of this filter is:
Code:
procmail: No match on "^Content-Transfer-Encoding: base64"
procmail: Skipped "| echo $LASTFOLDER"
procmail: Assigning "echo"
procmail: Skipped "| $LASTFOLDER"
procmail: Assigning "LASTFOLDER=/var/mail/root/msg.OFT"
procmail: Opening "/var/mail/root/msg.OFT"
procmail: Acquiring kernel-lock
procmail: Notified comsat: "root@0:/var/mail/root/msg.OFT"
From root Mon Apr 11 01:23:37 2011
Subject:
Folder: /var/mail/root/msg.OFT 26051

The result showed as if there was no match, futhermore, the bash code that I am trying to run:
echo "$LASTFOLDER" seemed not to be ran as bash? And does anyone know how I can test my procmail filter on some testing platform sandbox so I don't have to send a bunch of emails everytime I change the file and waste time and disk space testing new filters?

View 7 Replies View Related

CentOS 5 Server :: Procmail + Sendmail Configuration On 5.2?

Aug 5, 2009

I have been trying to get procmail working on CentOS 5.2. I don't need anything fancy, just an auto reply for a "noreply@" account. Looking at the sendmail configuration, it appears procmail is the MDA. I have looked at many different tutorials and how-tos, but most are old, and/or the locations/paths and setups are markedly different from the defaults on my system. Can anyone recommend a good CentOS-based tutorial on Procmail w/ recipes? (I have an RHEL book and it's no help either.) Thank you for your time and consideration.

View 1 Replies View Related

CentOS 5 :: Procmail As Mail Delivery Agent?

Aug 12, 2009

Recently we are receiving lots of spam email specially ( Viagra). I want to use spamassassen to filter the spams so I need to configure procmail as local mail delivery agent.At the moment I am using prosfix for mail delivery agent and our server is Centos 5. I did google it but couldn't find a good instruction.

View 3 Replies View Related

CentOS 5 :: Setup Spamassassin With Postfix And Procmail?

Nov 17, 2010

I have Centos 5.5 and using Postfix, procmail and Dovecot for sending and receiving emails. I have spamassassin installed too but not configured. I am getting lots of spams. I googled a lot to find if there is any configuration but I couldn't find.how to setup spamassassin to filter emails for spams.

View 1 Replies View Related

General :: Running Procmail On Rented Server Space

Feb 26, 2010

I am trying to set up mutt with fetchmail and procmail on server space that's not mine. I have access to /home/myusername but not to /var/spool/myusername. Everything seems to work well, but I have no idea where fetchmail (or procmail) is dropping off my mail.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved