Scan all mail messages through the server and save a copy into file system following a rule


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Scan all mail messages through the server and save a copy into file system following a rule
# 1  
Old 04-09-2012
Java Scan all mail messages through the server and save a copy into file system following a rule

In our company we work for our customer with a job# philosophy, managing all the informations about a job in a share with directories whose name is starting with job number. Under this entry point we have a standard structure of folders, comprising a "communications" folder.
When we send emails concerning a job, in the subject we put first of all 4 digits representing the job number. I need to save automatically a copy of these messages into the correct place, despite of sender or destination/s.

Now, I know the first step has to be the management of messages passing the smtp (postfix) analizing the subject to find the four digits. First idea could be modify the spamassassin filters/rules to get the work done, but something is telling me it's not a so good idea. So, here the first question: what's the correct place to interact with postfix having the message dubbing? Also thought about aliases, but I'm not sure it's possible messages dubbing instead of redirecting.

After this, a perl or php script can surely do what I need, but this will be next novel.

Thanks to anyone could be interested in this trial.

Ciao, Roberto
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to scan the disks and make file system

Hi What I'm trying to do(manually) is logging into the server and running the below mentioned commands ls /sys/class/scsi_device/ | while read i; do echo "- - -" > /sys/class/scsi_device/$i/device/rescan;done lsblk echo -e "o\nn\np\n1\n\n\nw" | fdisk /dev/sdd partx -a /dev/sdd1... (7 Replies)
Discussion started by: James0806
7 Replies

2. Red Hat

Scan for new LUN and create a new file system

Hi Please I dont have a lot of redhat skills, but I need some help on creating a file system. I need to rescan for this new LUN, so I try to check existing LUNs: fdisk -l Disk /dev/sda: 299.4 GB, 299439751168 bytes 255 heads, 63 sectors/track, 36404 cylinders Units = cylinders of... (8 Replies)
Discussion started by: fretagi
8 Replies

3. Shell Programming and Scripting

Shell script to copy a file from one server to anther server and execute the binary

Hi , Is there any script to copy a files (weblogic bianary + silent.xml ) from one server (linux) to another servers and then execute the copy file. We want to copy a file on multiple servers and run the installation. Thanks (1 Reply)
Discussion started by: Nawrajesh
1 Replies

4. UNIX Desktop Questions & Answers

Outlook Mail Rule issue- not reaching the unix server

Hi All, I' m having a pretty strange issue, when I sent an outlook email that is forwarded by rule for example (email sent every day at certain time) to the server is not going through, i cant see it arriving at the Maildir or i have also a procmail rule log that also not reaching... could... (0 Replies)
Discussion started by: Skyline88
0 Replies

5. UNIX for Dummies Questions & Answers

Copy the newest file from a different server to your home server.

Hi all, So I am on server 1, and I want to grab the newest file from a particular directory on server 2, and place this in a directory on server 1. I am trying to use: ls -tr | tail -1 This works, and gets me the newest file in a particular directory. Using svn `ls -tr | tail -1` etc I... (1 Reply)
Discussion started by: Lexx87
1 Replies

6. Shell Programming and Scripting

How to copy mail content in a file in Unix

Hi Guys I want to write a script which search mail with subject line and after that I want the mail content in a file please help guys. Thanks Atul Singh (3 Replies)
Discussion started by: atul9806
3 Replies

7. UNIX and Linux Applications

Copy mail traffic to several server for a domain

Hello, everybody! I have a MX server (sendmail) and old pop3 server, I installed a zimbra server and I want to receive mail traffic to several mail server (old and Zimbra). How I do it on Postfix(Zimbra if will be a MX for my domain) or Sendmail? (0 Replies)
Discussion started by: Rezonans
0 Replies

8. Shell Programming and Scripting

Copy files from one folder to another with rule

Hello! Please, help me to find or write this simple bash-script. I have first folder /tmp/work/folder1 with such files: name1.txt name2.txt.1 name2.txt.2 name3.txt name4.txt name4.txt.1 name4.txt.2 name4.txt.3 etc.. I need to copy all files from folder1 to folder... (1 Reply)
Discussion started by: optik77
1 Replies

9. UNIX for Dummies Questions & Answers

how to copy from vi and save it on another file

Hi I am newbie for unix. I want to copy few line opened in vi editor (not whole file) and save it some where else. It is like copy and paste but data is quite big . Is there any command i can use in vi to copy data and save it somewhere else. Thanks ukadmin (3 Replies)
Discussion started by: ukadmin
3 Replies
Login or Register to Ask a Question
mailq(1)						      General Commands Manual							  mailq(1)

NAME
mailq - prints the mail queue SYNOPSIS
DESCRIPTION
prints a summary of the mail messages queued for future delivery. The first line printed for each message shows the internal identifier used on this host for the message, the size of the message in bytes, the date and time the message was accepted into the queue, and the envelope sender of the message. The second line shows the error message that caused this message to be retained in the queue; it will not be present if the message is being processed for the first time. The status characters are: to indicate that the job is being processed to indicate that the load is too high to process the job to indicate that the job is too new in the queue to process. The output lines that follow the second line show the message recipients, one per line. is identical to Options The supported options are: Show the mail submission queue specified in the file instead of the MTA queue specified in the file. Show the lost items in the mail queue instead of normal queue items. Show the quarantined items in the mail queue instead of the normal queue items. Limit processed jobs to those containing substr as a substring of the queue ID or not when is specified. Limit processed jobs to quarantined jobs containing substr as a substring of the quarantine reason or not when is specified. Limit processed jobs to those containing substr as a substring of one of the recipients or not when is specified. Limit processed jobs to those containing substr as a substring of the sender or not when is specified. Print verbose information. This adds the priority of the message and a single character indicator or blank) indicating whether a warning message has been sent on the first line of the message. In addition, extra lines may be intermixed with the recipients indicating the `controlling user' information. This shows who owns the programs that are executed on behalf of this message and the name of the alias this command expanded from, if any. RETURN VALUE
The utility exits with 0 on success, and >0 if an error occurs. AUTHOR
was developed by the University of California, Berkeley, and originally appeared in 4.0BSD. FILES
mail queue files for SEE ALSO
sendmail(1M). mailq(1)