Sponsored Content
Top Forums UNIX for Advanced & Expert Users use email subject line as shell command Post 61232 by Neo on Monday 31st of January 2005 11:23:24 PM
Old 02-01-2005
Quote:
Originally Posted by mskarica
I want to use the text in the subject field to invoke a shell script, so basically I need to find a way that I can automatically forward the subject line to the unix command prompt. Any ideas??

My other problem is that these emails will have attachments. I want these attachments to be saved to the home directory (or any other directory) automatically when the email is received.

Any help will be greatly appreciated.
This is a somewhat easy problem to solve with procmail.

www.procmail.org

That is what I use for all these types of solutions. After you get familar with procmail, you can do many things you would never dream of using mail as an input to a filter Smilie

Neo
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

create email w/ ASCII attachment via command-line

All, I need to email an ASCII data file to a business partner, and intended on creating a Korn Shell script to create an email message (minimal text), and attach the ASCII data file to the email. It seems this is not as easy as I had thought it might be. sendmail does not support... (3 Replies)
Discussion started by: jwperry
3 Replies

2. Shell Programming and Scripting

Run a script based on the subject line of the email

Hi, I need help in running a script that would pull info from an email subject line and run a script (foo.sh). I'm pretty sure after a bit of googling that this is possible in several ways. but none was pretty clear on how to accomplish it. The part that I really need help with is getting the... (5 Replies)
Discussion started by: satekn
5 Replies

3. Shell Programming and Scripting

executing/including command in mailx subject line

Hi, Is it possible for me to include the results from a command in the subject line? What I am looking to do is get the file count and include it into the subject line as well as the list of files in the body. Example Subject line: Currently 25 files in directory My Code: #!/bin/ksh cd... (2 Replies)
Discussion started by: ozifer
2 Replies

4. Shell Programming and Scripting

help with script to send email and if subject line match is found

Help with script that will check log, then find a match is found, add that as the subject line. 1. The script will always run as a deamon.. and scan the event.log file 2. when a new 101 line is added to the event.log file, have the script check position 5,6 and 7 which is the job name, which... (2 Replies)
Discussion started by: axdelg
2 Replies

5. Ubuntu

Command line email help needed

Hi, having some problems getting commandline mail to work for root user in ubuntu. Ive installed the following packages - msmtp & mailx and the cert for gmail. I've created 3 files: mailrc and msmtprc in /home/username directory and /etc/exim4/passwd.client mailrc ------ set... (0 Replies)
Discussion started by: ziggycat
0 Replies

6. Shell Programming and Scripting

Subject line of an email

Hi all, I am trying to automate a process in which at the end of the process the script should send an email to the user saying this process is completed. I have done everything but the problem now is the subject line of the email... the subject line looks like this.. where abc xyz is a... (4 Replies)
Discussion started by: smarty86
4 Replies

7. UNIX Desktop Questions & Answers

Send Email from command line in Ubuntu 11.10

Have problem to send email from command line according to the posts like this one: To have the ability to send email from the command line, you will need to install the mailutils and postfix packages with the following commands. apt-get install mailutils apt-get install postfix Now... (1 Reply)
Discussion started by: yifangt
1 Replies

8. Shell Programming and Scripting

Sending sql output to email body with conditional subject line

hi , i have written below piece of code to meet the requirement but i am stuck in the logic here. the requirement are: 1) to send the sql out put to email body with proper formatting. 2) if count_matching = Yes then mail should triggered with the subject line ... (10 Replies)
Discussion started by: itzkashi
10 Replies

9. UNIX for Beginners Questions & Answers

Variable not displaying in subject line of mailx email

Hi Newbie here with first post. I've got a shell script (ksh) whereby I run a SQL*Plus script and output the results to a file. I then check the output file in an if statement that looks like this: if ]; then export GAPNUM=`awk '{print $4}' $OUTFILE` if ] then mailx -s... (10 Replies)
Discussion started by: ltzwoman
10 Replies
GPGMAILTUNL(1p) 					User Contributed Perl Documentation					   GPGMAILTUNL(1p)

NAME
gpgmailtunl - Encrypts an email message into the body of another email. SYNOPSIS
gpgmailtunl [options] --encrypt | --decrypt DESCRIPTION
gpgmailtunl is a filter program that either encrypts an email message using the Gnu Privacy Guard and sends it to another recipient or decrypt an email message and forwards unencrypted to another destination. It can be used to exchange emails across an open network betweeen two trusted systems. TYPICAL USAGE
This program is intended to run from program like procmail or sendmail to create an email tunnel between two systems. Of course this is not as secure as using gpg as an end user program, it may be convenient in certain case. ENCRYPTION
To encapsulates an email within another you pipe the message to gpgmailtunl. OPTIONS GetOptions( \%opt, "encrypt", "decrypt", "sign", "secret-file=s", "from=s", "to=s", "subject=s", "homedir=s", "local-user=s", "recipient=s", ) or usage; to This is the address to which the encrypted message will be sent. This is the only required fields. recipient This sets the keyid that will be used to encrypt the outgoing message. If unset, gpgmailtunl will try to find a key matching the to option. subject Sets the subject of the outgoing message. This defaults to "Encrypted mail". from Sets the From header line of the outgoing message which will contains the encrypted one. sendmail will provides a default one if this is not set. sign If this option is used, the outgoing message will be signed. In this case you should probably use to local-user and secret-file options. secret-file File from which the secret to unlock the private used to sign the message can be read. local-user The keyid of the user that should sign the outgoing message. The default user will be used if not specified. homedir Sets an alternate gpg home directory. (This is where the keyrings are stored.) DECRYPTION
To extract an email to be forwarded to the final user you pipe the encrypted email to gpgmailtunl using the decrypt switch. Once decrypted, the encapsulated email message will be sent to the original destinator of the message. OPTIONS homedir Sets an alternate gpg home directory. (This is where the keyrings are stored.) secret-file File from which the secret to unlock the private used to decrypt the message can be read. AUTHOR
Francis J. Lacoste <francis.lacoste@iNsu.COM> COPYRIGHT
Copyright (c) 1999, 2000 iNsu Innovations Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SEE ALSO
gpg(1) gpgmailtunl(1) GnuPG(3) perl v5.14.2 2011-11-22 GPGMAILTUNL(1p)
All times are GMT -4. The time now is 02:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy