- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to forward large mailbox
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2000 04:17 AM
09-18-2000 04:17 AM
Can I use one of my UX machines (or Linux) to forward these emails to the correct email addresses? How? Please help me to do this quickly.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2000 04:44 AM
09-18-2000 04:44 AM
Re: how to forward large mailbox
If you can, provide more information eg. What OS and sendmail version does your ISP use (because different versions of unix store mails in different formats); a sample header of the mailbox file will also be helpful. Essentially what needs to be done is to write an awk script that will parse the large mailbox for individual messages and mail them off based on the To: field.
but in order to be able to come up with such a script, we need to know how each message starts; and what extension parts it has.
A typical message may be of the form:
From $user $date
Recieved: from ( $user@$hostname) by $thishost $more_sendmail_info
Date: $date
From: $sender
Message-Id: <$messageID>
To: $receipient
Subject: $subject_of_message
$Otherheaders
$BODY_OF_MESSAGE
From $user $date
Recieved: from ( $user@$hostname) by $thishost $more_sendmail_info
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2000 05:22 AM
09-18-2000 05:22 AM
Re: how to forward large mailbox
It sounds to me that you have a good idea there; I think that might work.
I am not sure what our ISP is using, one of the problems is communication between them and us (not just datacomms!)
I think am sure it is some sort of unix, and I have heard them talk about qmail.
I have been able to open this mailbox file with mutt; that is how I know how many emails are in there.
I attach a sample of the contents of the mailbox file.
Thanks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2000 07:57 AM
09-18-2000 07:57 AM
Re: how to forward large mailbox
Can the text as I see it in the mailbox file be used as input to a mailer (mailx) or do I save each email in a file in a particular directory to it queue for processing?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2000 11:35 AM
09-18-2000 11:35 AM
Re: how to forward large mailbox
sorry about the delay.. here is something quick and dirty ( you might have to look it over and modify accordingly eg., deal with the subject line, use elm, etc...) This is just to give you an idea...
you could invoke the script with:
awk -f remail.awk mailfilefromISP
#!/usr/bin/awk
#
#
BEGIN { FS="n" }
total_lines=0
if ( match ($0, /^From /)) {
processoldrecord ( record, totallines )
else
record[totallines++]=$0
}
function processoldrecord (record, totallines) {
if ( totallines == 0 ) { return}
print > "temp.out"
for ( counter = 0 ; counter < totallines ; counter++ ) {
print record[counter] >> "temp.out"
if ( match($0, /"^To: "/ )) {
toaddr=extractaddress($0)
}
system ( "mail " toaddr "< temp.out" )
}
function extractaddress (inline) {
z = split ( inline, array, " ")
for (i = 1 ; i <= z ; ++i ) {
if ( match(array[i], /[a-zA-Z0-9.]+@[a-zA-Z0-9.]+/ ) return array[i]
return array[z] # if no @ sign, assume last parameter is address
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2000 01:12 AM
09-19-2000 01:12 AM
Re: how to forward large mailbox
Thanks, that is very helpfull, but...
I think some \ (backslashes) are missing.
I spotted one in the FS, which I am assuming is supposed to be a new-line.
But I also get syntax errors problems on the line:
if ( match ($0, /^From /)) { ....
I have not used the built-in function match before, so I don't know what may be wrong there
Could you attach your example awk srcipt as a file, please
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2000 05:37 AM
09-19-2000 05:37 AM
Solutiongremlins ahoy!! :-)
here you are with the awk script... I tested this in my environment and it seemed to work - I have commented out the part that mails out (so that you do not have it firing off e-mails ... you might want to test some parts of it first)
the match() is supposed to return the value of the first match of a regular expression in a string.
I have identified some to do's which you may want to look at...
lets know how it goes - I am in and out today, so it might be delayed.