Script to print email from defined sender.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Script to print email from defined sender.
# 1  
Old 11-15-2011
Script to print email from defined sender.

Hello all!

I'm looking to setup some sort of script so that when a an email comes in from a specific address the message and/or attachments are automatically printed.

Any ideas on where to start?

Thanks for the help.
# 2  
Old 11-16-2011
Can you please provide some additional details - what mail agent are you using? O/S version?
# 3  
Old 11-16-2011
I was hoping to set this up on a mail server so I didn't need a larger program but if need be I could use thunderbird. This will be running on Ubuntu 11.10 32-bit.
# 4  
Old 11-16-2011
You could use the fetchmail utility to automatically retrieve mail from a mailbox at intervals. Or if you have your own mailserver, just have the mail delivered into a maildir for your script to check.

Once there, mail files are text. Printing text mail isn't too difficult, pipe it into your mail daemon. Filter it as you please to get the fields you want.

Attachments are a little harder. What about .jpg? what about .wmv? what about excel spreadsheets?

You might need to narrow the problem a little.
# 5  
Old 11-16-2011
Ok, here is the problem I'm trying to solve. Mom has Blackberry that she gets her work email on and the way she has me printing the messages/attachments now is sending the email to her personal email and then having me print them out. I want to have her send it to an email server setup on this box or pulled from an outside source. I don't have a lot of experience in the scripting department so I will need help with that.
# 6  
Old 11-16-2011
Thanks for being clear.

Again, though -- what sort of attachments? If she's wanting you to print ecards full of embedded pictures and dancing baloney I don't think much but a full-out GUI app could handle them.

There's the blackberry remote print app, but if she's sending things to you I suppose her blackberry can't understand them anyway...
# 7  
Old 11-16-2011
The attachments would most likely be doc docs xls xlsx jpg PNG and PDF.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[Solved] Variable defined in .bashrc not intializing in script

I have the variable defined in .bashrc BIN_DIR="/usr/local/dw" and in my shell script i am using below. #!/bin/bash echo "Bin Dir: ${BIN_DIR}" . "${BIN_DIR}"/dwh_Loadfuncs.sh Output: Bin Dir: /usr/local/dw/dwh_LoadXMLFileIntoStage.sh: line 7: /dwh_Loadfuncs.sh: No such file or... (3 Replies)
Discussion started by: Ariean
3 Replies

2. Shell Programming and Scripting

Preventing script from being replicated on a defined number of hosts

ok. i have an extensive program written predominantly in borne shell. i have to give an "evaluation" copy of this program to a user so she can test it out and see if she wants it. problem is, i dont have an evaluation copy. and even if i did, im worried the evaluation copy can be edited to... (8 Replies)
Discussion started by: SkySmart
8 Replies

3. UNIX for Dummies Questions & Answers

fake email sender

Hi, I am using the below command to send the email. mailx -s "test from `hostname`" email@gmail.com < attachment.txt id uid=870(wlsuser) gid=641(wlsgrp) I recieve the email as "From: wlsuser@hostname Can I somehow have any string instead of wlsuser, if that grows too complex to... (4 Replies)
Discussion started by: shifahim
4 Replies

4. Shell Programming and Scripting

Print the 2nd line everytime after defined pattern is found.

Hi, I have a text file similar to the example below and I want to print the second line every time after the "--------------------------" pattern is found. The pattern is a fixed length of - characters. Example of input; 1 -------------------------- 2 3 39184018234 4 ... (10 Replies)
Discussion started by: lewk
10 Replies

5. Red Hat

How to change sender email address in mail -s command

Just having trouble trying to figure out what the option is. When I do mail -s "Subject" someuser@example.com I can't seem to specify "from" or "sender" option as I need it for my task. I tried using --f or -f though it didn't work. Can someone please tell me what other option... (0 Replies)
Discussion started by: rockf1bull
0 Replies

6. Shell Programming and Scripting

Changing the sender Email address to Alias

Hi All, I want to change the email address of the sender to some alias for eg: FROM:noreplyecommerce@test.com needs to be changes to TEST Please help me. (3 Replies)
Discussion started by: sithara
3 Replies

7. Shell Programming and Scripting

how do I change the email sender if I donot have the -r option?

Hey, after I check the man page for mail and mailx, I did not find the -r option. But, I have to change the email sender, how can I do it? Send Mode mailx address... Receive Mode mailx -e mailx mailx -f ... (0 Replies)
Discussion started by: freelong
0 Replies

8. Shell Programming and Scripting

Finding Variable Value defined in a Script

Hi , I had a script in which there is a variable $LOG defined and I want to check where that variable is getting value from, is there a way I can check for that variable and it's value if it is defined in some other script function or script . I checked using command env and also export... (1 Reply)
Discussion started by: somu_june
1 Replies

9. Shell Programming and Scripting

Sender email address has to changes

I am sending email with attachment using mail and uuencode command. Ex: (echo "$EMAIL_BODY"; uuencode $FILE ATTACH.TXT) || mail "$EMAIL_ID" -s "$EMAIL_SUB" I am getting email from "applmgr@rigelapp01.us.dell.com". I want to change this email address into... (1 Reply)
Discussion started by: balajiora
1 Replies

10. SCO

Print to Email

Hello I hope someone can help me. As part of an acquisition I have inherited a ERP system running on a SCO 5 server, unfortunately I don't have much Unix knowledge. I have been asked to configure a script so that when users print a report from the ERP software it runs a script that sends the... (1 Reply)
Discussion started by: fishbone56
1 Replies
Login or Register to Ask a Question