12-09-2008
hi vbe -
i'll check that out. in the meantime, i tried changing the charset in the emails themselves from us-ascii to utf-8 (which i think would accomplish pretty much the same thing), with no effect.
i also realized that i could've provided a little more info - sorry, folks. the accounts all have .mdir mailboxes (as opposed to .mbox) - so each message is its own rfc 822-compliant textfile. that means the script is plowing through sometimes hundreds of files per account, and pulling only what it needs (in this case, from, subject, and a couple of other things that are irrelevant to this problem).
for each message, it takes that info and writes it all to one line in a temp file, then moves on to the next. when it's processed all the messages for that account, it reads back the file it just finished writing (which consists of the from & subject lines plus that other info, like a from name and its spam score), one line at a time, and clunks those bits of info into the body of the summary email.
i guess it's a little more complicated than i remembered - but again, the mechanics are working fine; it's just this charset thing that's broken.
thanks again to anyone with a tip,
-john.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi, I'm using putty and when I try to write ü it writes | (or when I try to write é , it writes i)
I tried to change settings/translation of putty but with no success
I have KSH
# locale
LANG=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"... (3 Replies)
Discussion started by: palmer18
3 Replies
2. Shell Programming and Scripting
Hi,
I'm trying to strip all lines between two headers in a file:
### BEGIN ###
Text to remove, contains all kinds of characters
...
Antispyware-Downloadserver.com (Germany)=http://www.antispyware-downloadserver.c
om/updates/
Antispyware-Downloadserver.com #2... (3 Replies)
Discussion started by: Trones
3 Replies
3. Shell Programming and Scripting
Hi ,
I have a typical situation. I have 4 files and with different headers (number of headers is varible ).
I need to make such a merged file which will have headers combined from all files (comman coluns should appear once only).
For example -
File 1
H1|H2|H3|H4
11|12|13|14
21|22|23|23... (1 Reply)
Discussion started by: marut_ashu
1 Replies
4. Shell Programming and Scripting
Hi experts,
I have a gz file from other system(solaris), which is ftped to our system(solaris).
After gunzip, the file is a xml file and we are using ORACLE built in xml transformiing tool ORAXSL to transform XML to TXT.
Now the issue is we come accross issue regarding UTF8 as below:... (1 Reply)
Discussion started by: summer_cherry
1 Replies
5. Shell Programming and Scripting
Hi,
I am beginner to Unix.
My requirement is to validate the encoding used in the incoming file(csv,txt).If it is encoded with UTF-8 format,then the file should remain as such otherwise i need to chnage the encoding to UTF-8.
Please advice me how to proceed on this. (7 Replies)
Discussion started by: cnraja
7 Replies
6. Shell Programming and Scripting
Hi ,
I have a sql query in the unix script ,whose output is shown below.I want to convert this output to HTML table format & send email from unix with this table as email body.
p_id src_system amount
1 A 100
2 B 200
3 C ... (3 Replies)
Discussion started by: jagadeeshn04
3 Replies
7. UNIX for Dummies Questions & Answers
Hi All
I am working on AIX 7.1 and I am trying to show an output that I get from "cat" a log file to email. However in email I get the below output:
In the script I have defined the colors as:
#!/bin/sh
echo "\033
Below is the script I have created to send this output:
... (9 Replies)
Discussion started by: Bubs
9 Replies
8. UNIX for Dummies Questions & Answers
I'm trying to pick up some Unix SysAdmin skills on my own outside of work through the use of the "Unix and Linux System Administrators Handbook." I've found the exercises to be very beneficial, until I came to this.... "What path did the email take? To Whom was it addressed, and to whom was it... (0 Replies)
Discussion started by: ksmarine1980
0 Replies
9. UNIX for Dummies Questions & Answers
Hi all
I need help converting a text file into a html table in bash and I need to email this table. The text file looks like the below. Two columns with multiple rows. Top row being header.
Application Name Application Status
Application 1 Open
Application 2 ... (2 Replies)
Discussion started by: hitmanjd
2 Replies
10. Solaris
Hi all!!
I´m using command file -i myfile.xml to validate XML file encoding, but it is just saying regular file . I´m expecting / looking an output as UTF8 or ANSI / ASCII
Is there command to display the files encoding?
Thank you! (2 Replies)
Discussion started by: mrreds
2 Replies
LEARN ABOUT DEBIAN
mailexec
mailexec(1) Mail Avenger 0.8.3 mailexec(1)
NAME
mailexec - run program on messages in mbox file or maildir
SYNOPSIS
mailexec [-nvFR] mailbox program [arg ...]
DESCRIPTION
mailexec runs a program over every message in mailbox, which must be an mbox-format mail file or maildir directory. For each message
encountered, mailexec executes program with the specified arguments, supplying the message as standard input. mailexec synthesizes a
"From " line and a "Return-Path:" header field for each message if the message does not already contain one. (This behavior can be
modified by the -F and -R flags, described below.)
When parsing mbox format files, mailexec unescapes "From " lines. If a line begins with one or more ">" characters followed by "From ",
mailexec deletes one of the ">" characters. If you do not want this unescaping behavior, see the formail(1) utility, which has a -s flag
that performs a similar function to mailexec.
OPTIONS
-n When processing a maildir, causes mailexec to look exclusively at "new" messages that have not yet been moved to the cur directory.
-v Turns on verbose mode. If mailbox is a maildir, mailexec prints out the name of each file it processes inside the maildir. If mailbox
is an mbox format file, mailexec prints the message-id of each message it processes (as long as messages have a message-id header).
-F Suppresses printing of the initial "From " line at the beginning of each message.
-R Suppresses printing of initial "Return-Path:" lines.
EXAMPLES
To get the same behavior as the Unix from(1) command on a mail directory dir, you can run either of the following two commands:
mailexec -n dir head -1
mailexec -n dir sed -ne 1p
To convert an mbox-format file mbox into a maildir directory dir, you can run:
mailexec mbox deliver dir/
Conversely, to convert maildir dir into an mbox-format file mbox, run:
mailexec dir deliver mbox
To train the spamassassin filter on a mail folder called spam containing unwanted messages, run:
mailexec spam sa-learn --spam
Note that this works whether spam is an mbox format file or a maildir directory.
If you have an old mbox file or maildir directory box and wish to "import" the old mail into your web mail account, say example@gmail.com,
you can run:
mailexec -F box sendmail example@gmail.com
Note again that this works whether box is an mbox format file or a maildir directory.
SEE ALSO
avenger(1), deliver(1), dotlock(1), avenger.local(8)
The Mail Avenger home page: <http://www.mailavenger.org/>.
BUGS
When reading from a maildir and synthesizing a "From " line, mailexec guesses the delivery date of the message based on the name of the
file, which works in practice but could be considered dangerous since file names in maildirs are supposed to be opaque. Thus, while
generally mailexec places sensible dates in "From " lines and processes maildir messages in order of delivery, it might be unwise to rely
on this behavior.
mailexec generates the time for the "From " line in the local time zone, as is customary on Unix. This could lead to loss of information
when transferring mailboxes across time zones or combining mailboxes created in different timezones. Moreover, this practice is
incompatible with qmail, which uses GMT in the "From " line.
mailexec expects that if there is a "Return-Path:" header field, it will be the first header field in the message (possibly after the
initial "From " line, which is not itself a header field).
There are many different variants of the mbox message format. mailexec expects the "mboxrd" variant, in which each message is delimited by
a "From " line at the beginning and a blank line at the end, and every line beginning with either "From " or one or more ">" characters
followed by "From " is escaped by adding another ">" character. In particular, this means mailexec will incorrectly parse System V
"mboxcl2" files, which use "Content-Length:" header fields to determine message boundaries rather than "From " lines.
mailexec attempts to lock mbox format files, but will execute anyway even if it cannot obtain the lock. This allows it to work on read-
only files, but if you are highly unlucky could result in the last message being truncated.
There is no locking for maildir files. If a maildir is modified while mailexec is running over it, mailexec could miss messages. If you
are concurrently manipulating the maildir with a mail reader, maildir could even miss old messages that just happen to have been moved from
the new to the cur directory. mailexec will issue a warning if it fails to open a file that it had previously seen when scanning the
directory.
AUTHOR
David Mazieres
Mail Avenger 0.8.3 2012-04-05 mailexec(1)