Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i just recently got a new cell phone (nokia 3650) and am already geeking the crap out of it. :-)
anyway... the camera is real cool and being able to send pictures to people is awesome. but what i want to do is be able to email them to a specific account and then have a perl script i wrote auto-generate thumbnails and pretty much photo album it and make available online.
pretty much the only thing standing in my way is actually executing the perl script when the email is received (through sendmail on a slack8 box). i'm wondering if anyone has any suggestions of how to execute a perl script whenever an email is received?
I have had a look at the sendmail config files on my redhat system - I'm not sure of the default setup on slack but my aliases file is /etc/aliases and is defined that way in the config file.
1) Backup your /etc/sendmail.cf file
cp /etc/sendmail.cf /etc/sendmail.cf.bak
2) Modify your /etc/mail/sendmail.mc file to allow aliases
3) Build it into sendmail.cf using:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
4) Copy sendmail.cf to /etc
cp /etc/mail/sendmail.cf /etc/
Sorry I'm not sure about the paths in slack but that should get you started.
everything's working fine as far as sendmail's concerned. aliases is being used correctly in sendmail.cf and what have you. i've made changes to the config file many times before, so i'm reasonably sure everything is working how it's supposed to be. with the minor exception, of course, of this problem.
what would really help is if i could track down the point of failure. the mail seems to go through fine, but obviously the script isn't being executed.
As far as I can remember it also creates a file called dead.letter (not sure of the case) that contains all messages that could not be processed.
I take it that your script is not being run at all - you could put a command like this near the top of the script:
system("echo `date` > /tmp/scriptcheck");
Then at the end
system("echo `date` >> /tmp/scriptcheck");
This should just print the start and end time that the script is run into a temporary file called "/tmp/scriptcheck".
I take it that the permissons on the file are OK? I'm not sure which user the script will be run as so you may want to give it 755 permissions.
ok, i got the result i'm looking for through .procmailrc in the ~/ directory of the user. however, i'm unable to access the data inside the cgi/perl script. here's the syntax of .procmailrc:
:0
| "/home/images/email.album.pl" $1
the script is executed upon receiving an email, however i'm unable to access the data which should be passed into the script. i've tried @ARGV and %ENV but neither contains the data.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.