Sponsored Content
Top Forums Shell Programming and Scripting Split email message with procmail Post 302821455 by DGPickett on Friday 14th of June 2013 02:17:42 PM
Old 06-14-2013
You want to forge a remote sender? I just wanted a recipient and subject.

In my experience, a time stamp somewhere in the subject is nice, for selecting email by subject, perhaps for sorting, too, "<General_topic>-Hostname-YYYY-MM-DD_HH:MM".

So, in awkish, you need to collect all lines of the block in a body variable and collect bits for the subject and recipient in two or more variables, and the after collecting the Created line, spit out the mail command and input data and maybe clean your variables. Or you can clear your variables on the first line of the block. If your recipient variable ends up empty, you might want to send to a default address with a 'DefectiveBlock:' prefixed subject.

Last edited by DGPickett; 06-14-2013 at 03:24 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

email attachment, with a message using mailx

Hi, I am trying to include a message along with an attachment with an email using mailx on AIX. uuencode Test.dat Test.dat| mailx -s 'Testing' mymail@yahoo.com < MESGFILE This only gives me the contents of MESGFILE as my message. If I remove the < FILE I recieve the attachment. What... (4 Replies)
Discussion started by: edog
4 Replies

2. UNIX for Dummies Questions & Answers

Split-Email-removing files

Friends, I have a datafile that have unknown a number of CHARACTERS. if the datafile have more than 1 character and less than 20 email me the file rm datafile if the datafile have more than 20 characters split the datafile into 20 characters in each file email datafileaa email... (4 Replies)
Discussion started by: bobo
4 Replies

3. UNIX for Dummies Questions & Answers

Procmail 3.22 install error message

I'm trying to install : Procmail 3.22 onto a : E10K domain running : Solaris 2.6 Generic_105181-35 I untar the file to /stage/procmail-3.22. When I run the command: /usr/ccs/bin/make install I get the following message, then the install aborts: License Error : Cannot find license... (2 Replies)
Discussion started by: antalexi
2 Replies

4. Shell Programming and Scripting

error-when trying to send the message thru email.

Hi All, I want to send a message through email. I have written below code. But it is not worling. Anybody has idea, why it is not working?. export $file1=$home1/pip1.$$ mailx -s "This Message from unix" abc@yahoo.com< $file1 thanks,Mary. (5 Replies)
Discussion started by: MARY76
5 Replies

5. Shell Programming and Scripting

how to send contents of a file to email as a message

i have a file new1.txt i want to send the contents of that file as a message to email ali@sms.com i m using ksh script......... plz help me (5 Replies)
Discussion started by: ali560045
5 Replies

6. Shell Programming and Scripting

Email alert doesnt contain any message

I have created a script which will monitor disk space in unix, it will send an email alert that will notify the specified receipients. I used echo in the mailx command but the email doesnt contain any message. I have used printf to store the message ($message2) and when tried to display on the... (2 Replies)
Discussion started by: lscanaleta
2 Replies

7. UNIX for Dummies Questions & Answers

How to get failure notice message when email is not sent.

I am using mailx command to send emails from the Unix command prompt. Whenever email is not sent it is not giving me any message "Email not sent" or failure delivery notice for the wrong email addresses. When I give correct email address I am able to receive them correctly. Can anyone please... (0 Replies)
Discussion started by: szc0025
0 Replies

8. UNIX and Linux Applications

Ssmtp -t < /path/to/the/message.txt (How to format message.txt for html email)

ssmtp has been running well under Kubuntu 12.04.1 for plain text messages. I would like to send html messages with ssmtp -t < /path/to/the/message.txt, but I cannot seem to get the message.txt file properly formatted. I have tried various charsets, Content-Transfer-Encoding, rearranging the... (0 Replies)
Discussion started by: Ronald B
0 Replies

9. Shell Programming and Scripting

Message Body while sending an email

I am making use of the following code to display the results of my txt file in an email: mail -s 'Count Validation Test Comparison Results' Ronit@XYZ.com < Count_Validation_Results_`date +%m%d%Y`.txt Email Output: ----------Query 1 Count Validation Results-------- Source count is 4 Target... (7 Replies)
Discussion started by: ronitreddy
7 Replies
DMAIL(1)						      General Commands Manual							  DMAIL(1)

NAME
dmail - procmail Mail Delivery Module SYNOPSIS
dmail [-D] [-f from_name] [-s] [-k keyword_list] [user][+folder] DESCRIPTION
dmail delivers mail to a user's INBOX or a designated folder. dmail may be configured as a drop-in replacement for binmail(1), mail.local(1) for use with a mail delivery filter such as procmail(1). Because of security considerations (see below) dmail is not intended to be used for direct delivery by the mailer daemon; tmail(1) is the preferred tool for this purpose. If dmail is used for mailer daemon delivery, the mailer daemon must invoke dmail with the dmail process' user id set to the recipient's user id. When dmail exits, it returns exit status values to enable procmail(1) to determine whether a message was delivered successfully or had a temporary (requeue for later delivery) or permanent (return to sender) failure. If the user name is present, it must be the same as the logged-in user name. If the +folder extension is included in the user argument (or appears by itself if there is no user argument), dmail will attempt to deliver to the designated folder. If the folder does not exist or the extension is not included, the message is delivered to the user's INBOX. If delivery is to INBOX and no INBOX currently exists, dmail will create a new INBOX. dmail recognizes the format of an existing INBOX or folder, and appends the new message in that format. The -D flag specifies debugging; this enables additional message telemetry. The -f or -r flag is used to specify a Return-Path. The header Return-Path: <from_name> is prepended to the message before delivery. The -s flag specifies that the message will be flagged as being "seen". The -k flag is used to specify delivery keywords, which are set on the message at delivery time if and only if the keywords are already defined in the mailbox. Multiple keywords can be specified by using a quoted string, e.g., dmail -k "$Junk Discard" +junkbox RESTRICTIONS
Absolute pathnames and ~user specifications are not permitted in +folder extensions. SECURITY CONSIDERATIONS
Unlike tmail you can use dmail to deliver to IMAP4 namespace names via +folder extensions. This means that it is possible to deliver to mh(1) format mailboxes. However, this can also include such namespaces as #shared, #public, and #ftp. In most cases, it is undesirable to allow anybody sending mail to the user to deliver to these namespaces. Consequently, there needs to be a rule in place in the configuration of either sendmail(8) or procmail(1) to prevent such abuse. AUTHOR
Mark Crispin, MRC@CAC.Washington.EDU SEE ALSO
binmail(1) procmail(1) June 18, 2007 DMAIL(1)
All times are GMT -4. The time now is 09:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy