Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

procmail & formail

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


mohsen at pahlevanzadeh

May 17, 2009, 11:45 AM

Post #1 of 13 (1645 views)
Permalink
procmail & formail

Dear all,
i have a mail server & vpopmail.
Now, i want to copy from each message to a directory.i find a way to do
it.
i put following line in .qmail-default :
|formail -X "" > ~/text.txt
Of course above line is test.Given line doesn't retrieves Return* header
field.
My question:
How i retrieve entire email same itslef?
Yours,
Mohsen


lists-qmail at maexotic

May 18, 2009, 9:47 AM

Post #2 of 13 (1556 views)
Permalink
Re: procmail & formail [In reply to]

On Sun, May 17, 2009 at 11:15:11PM +0430, Mohsen Pahlevanzadeh wrote:
> Now, i want to copy from each message to a directory.i find a way to do
> it.

I am not sure I really understand what you want to do ... but how about

# maildirmake /path/to/dir
# chown -R vpopmail_user:vpopmail_group /path/to/dir
# echo "/path/to/dir/" >> .qmail-default

\Maex


mohsen at pahlevanzadeh

May 19, 2009, 5:34 PM

Post #3 of 13 (1545 views)
Permalink
Re: procmail & formail [In reply to]

Oh thank you.You solved my problem.
i need to append one line to given email.How i do it?

On Mon, 2009-05-18 at 18:47 +0200, Markus Stumpf wrote:
> On Sun, May 17, 2009 at 11:15:11PM +0430, Mohsen Pahlevanzadeh wrote:
> > Now, i want to copy from each message to a directory.i find a way to do
> > it.
>
> I am not sure I really understand what you want to do ... but how about
>
> # maildirmake /path/to/dir
> # chown -R vpopmail_user:vpopmail_group /path/to/dir
> # echo "/path/to/dir/" >> .qmail-default
>
> \Maex


mohsen at pahlevanzadeh

May 19, 2009, 7:49 PM

Post #4 of 13 (1543 views)
Permalink
Re: procmail & formail [In reply to]

Oh, my means is append to end of file same :
echo "something" >> myfile
Not end of body or end of header.
Now, my file is a file in the my maildir.i need to add it.

On Wed, 2009-05-20 at 15:04 +0200, Markus Stumpf wrote:
> On Wed, May 20, 2009 at 05:04:02AM +0430, Mohsen Pahlevanzadeh wrote:
> > Oh thank you.You solved my problem.
>
> Fine :-)
>
> > i need to append one line to given email.How i do it?
>
> It is a big difference if you want to append the line to the header
> or the body.
> Adding to the header is somewhat easier.
>
> Appending to the body is non-trivial.
> - imagine a simple case where the body is a mime message with
> Content-type: image/png. Where would you append the line to? You'd
> have to totally restructure the MIME part, making it multipart/mixed,
> and add a text/plain part.
> - imagine another simple case with an email body in multipart/alternative
> (text/plain and text/html).
> Adding the line to the body will eventually break the correct mime encoding
> and the line will not be visible. So you would have to append it to the
> text/plain part and also correctly insert it in the HTML part (simply
> adding is not sufficient as it will not be displayed if it is outside
> the <body>...</body> structure.
> - to make things even worse think of signed or encrypted messages (PGP or
> S/MIME). Adding text to those messages will destroy the checksum and
> invalidate the signature.
>
> \Maex
>


mohsen at pahlevanzadeh

May 19, 2009, 8:47 PM

Post #5 of 13 (1535 views)
Permalink
Re: procmail & formail [In reply to]

Dear all,
i need to copy from each message to the specific mailbox.Of course,i
need to deliver name of receiver message.I have 400 domain.
Do you have idea?
Mohsen
On Wed, 2009-05-20 at 17:00 +0200, Markus Stumpf wrote:
> On Wed, May 20, 2009 at 07:19:26AM +0430, Mohsen Pahlevanzadeh wrote:
> > Oh, my means is append to end of file same :
> > echo "something" >> myfile
> > Not end of body or end of header.
> > Now, my file is a file in the my maildir.i need to add it.
>
> A file in the Maildir is a mail.
> Append a line to such a file is append a line to the message body.
> This may result in a lot of problems (see my previous mail).
>
> Why don't you tell us what you REALLY want to do and what kind of line
> you want to add and where to?
> Asking precise question will result in precise answers and save us all
> some precious time.
>
> You have already said that you know how to append a line to a file:
> echo "something" >> myfile
> You can do that from a .qmail file like
> |echo "something" >> myfile
> but this may fail if there are two deliveries at the same time.
> So you probably want to use some kind of locking, like with setlock
> from the daemontools package.
> http://cr.yp.to/daemontools/setlock.html
>
> \Maex


mohsen at pahlevanzadeh

May 19, 2009, 11:47 PM

Post #6 of 13 (1532 views)
Permalink
Re: procmail & formail [In reply to]

Dear Markus,
I have a Mail server with 400 domain.Qmail+vpopmail+mysql+dovecot
My boss wants to see incoming messages.(for everybody)
I need to copy from each email & name of receiver's email to a specific
maildir.
Do you have an idea that i can copy email along with its receiver?
Yours,
Mohsen

On Wed, 2009-05-20 at 20:21 +0200, Markus Stumpf wrote:
> On Wed, May 20, 2009 at 08:17:27AM +0430, Mohsen Pahlevanzadeh wrote:
> > i need to copy from each message to the specific mailbox.Of course,i
> > need to deliver name of receiver message.I have 400 domain.
> > Do you have idea?
>
> I totally do not understand what you want to do.
> Even if it is hard, try to give an example and write more than one
> or two sentences about a problem you consider so complex that
> you cannot solve it on your own.
>
> Also, qmail comes with a full set of man pages. Read them! Especially
> qmail-control
> dot-qmail
> qmail-command
> qmail-send
> qmail-users
> qmail-local
>
> And ... as you are using vpopmail (as you wrote) read the documentation.
> IMHO this will solve all the problems you currently have. It is made for
> managing domains and users and delivering emails to mailboxes.
>
> \Maex


lists-qmail at maexotic

May 20, 2009, 6:04 AM

Post #7 of 13 (1544 views)
Permalink
Re: procmail & formail [In reply to]

On Wed, May 20, 2009 at 05:04:02AM +0430, Mohsen Pahlevanzadeh wrote:
> Oh thank you.You solved my problem.

Fine :-)

> i need to append one line to given email.How i do it?

It is a big difference if you want to append the line to the header
or the body.
Adding to the header is somewhat easier.

Appending to the body is non-trivial.
- imagine a simple case where the body is a mime message with
Content-type: image/png. Where would you append the line to? You'd
have to totally restructure the MIME part, making it multipart/mixed,
and add a text/plain part.
- imagine another simple case with an email body in multipart/alternative
(text/plain and text/html).
Adding the line to the body will eventually break the correct mime encoding
and the line will not be visible. So you would have to append it to the
text/plain part and also correctly insert it in the HTML part (simply
adding is not sufficient as it will not be displayed if it is outside
the <body>...</body> structure.
- to make things even worse think of signed or encrypted messages (PGP or
S/MIME). Adding text to those messages will destroy the checksum and
invalidate the signature.

\Maex


lists-qmail at maexotic

May 20, 2009, 8:00 AM

Post #8 of 13 (1541 views)
Permalink
Re: procmail & formail [In reply to]

On Wed, May 20, 2009 at 07:19:26AM +0430, Mohsen Pahlevanzadeh wrote:
> Oh, my means is append to end of file same :
> echo "something" >> myfile
> Not end of body or end of header.
> Now, my file is a file in the my maildir.i need to add it.

A file in the Maildir is a mail.
Append a line to such a file is append a line to the message body.
This may result in a lot of problems (see my previous mail).

Why don't you tell us what you REALLY want to do and what kind of line
you want to add and where to?
Asking precise question will result in precise answers and save us all
some precious time.

You have already said that you know how to append a line to a file:
echo "something" >> myfile
You can do that from a .qmail file like
|echo "something" >> myfile
but this may fail if there are two deliveries at the same time.
So you probably want to use some kind of locking, like with setlock
from the daemontools package.
http://cr.yp.to/daemontools/setlock.html

\Maex


lists-qmail at maexotic

May 20, 2009, 11:21 AM

Post #9 of 13 (1533 views)
Permalink
Re: procmail & formail [In reply to]

On Wed, May 20, 2009 at 08:17:27AM +0430, Mohsen Pahlevanzadeh wrote:
> i need to copy from each message to the specific mailbox.Of course,i
> need to deliver name of receiver message.I have 400 domain.
> Do you have idea?

I totally do not understand what you want to do.
Even if it is hard, try to give an example and write more than one
or two sentences about a problem you consider so complex that
you cannot solve it on your own.

Also, qmail comes with a full set of man pages. Read them! Especially
qmail-control
dot-qmail
qmail-command
qmail-send
qmail-users
qmail-local

And ... as you are using vpopmail (as you wrote) read the documentation.
IMHO this will solve all the problems you currently have. It is made for
managing domains and users and delivering emails to mailboxes.

\Maex


ar-djblists at acrconsulting

May 20, 2009, 12:48 PM

Post #10 of 13 (1532 views)
Permalink
Re: procmail & formail [In reply to]

On Wednesday 20 May 2009, Mohsen Pahlevanzadeh wrote:
> Dear Markus,
> I have a Mail server with 400 domain.Qmail+vpopmail+mysql+dovecot
> My boss wants to see incoming messages.(for everybody)
> I need to copy from each email & name of receiver's email to a
> specific maildir.
> Do you have an idea that i can copy email along with its receiver?

If I've understood your question correctly, you'll find the answer in
the FAQ (file within qmail's source) - question 8.2.

I agree with Maex, it's a shame you're not making more effort to use
the resources provided with qmail and vpopmail (and Google, the list
archives etc.) to research your problem: On the list we like to help
people with queries, but it's silly if the answers to the questions
are easily found by looking in obvious places first. Therefore please
treat the list with due respect by (1) researching your issues first,
and if that doesn't help (2) asking here, but take the time to frame
your questions properly first.

Given you appear to have a moderately large mail system to manage, I'd
also recommend one or more qmail books to help you understand your
system in greater depth. Find a list of these on qmail.org; in
addition there's Kyle Wheeler's "Qmail Quickstarter" which isn't shown
on qmail.org but is also worthwhile.

Andrew.
--
======================================================================
* Custom email solutions * Systems Administration * Networking
http://www.acrconsulting.co.uk/email/qmail.html
====================================================================


lists-qmail at maexotic

May 20, 2009, 1:13 PM

Post #11 of 13 (1540 views)
Permalink
Re: procmail & formail [In reply to]

On Wed, May 20, 2009 at 12:22:37PM -0700, Mike Wright wrote:
> from ~alias/.qmail-log.

And, as I am sure this will be the next question in a couple of
hours/days:
DO NOT FORWARD a message from this account.
Do a direct delivery to a Mailbox/Maildir.

Why? A forward will also be forwarded to the "log" account again
(as it will go through the queue again). Thus causing the message
to be delivered to the "log" account again, will be forwarded and logged
and forwarded and logged and ...

\Maex


jeff at m2

May 20, 2009, 1:40 PM

Post #12 of 13 (1532 views)
Permalink
Re: procmail & formail [In reply to]

If you're logging all incoming message for each user in each of 400
domains, you'd better make sure your Terms Of Service is well written,
well vetted, and well communicated to all of those users. Don't know
about Iran, but doing this in some other countries would be a really
easy way to run afoul of the law. IANAL, of course.

Mohsen Pahlevanzadeh wrote:
> Dear Markus,
> I have a Mail server with 400 domain.Qmail+vpopmail+mysql+dovecot
> My boss wants to see incoming messages.(for everybody)
> I need to copy from each email & name of receiver's email to a specific
> maildir.
> Do you have an idea that i can copy email along with its receiver?
> Yours,
> Mohsen
>
> On Wed, 2009-05-20 at 20:21 +0200, Markus Stumpf wrote:
>
>> On Wed, May 20, 2009 at 08:17:27AM +0430, Mohsen Pahlevanzadeh wrote:
>>
>>> i need to copy from each message to the specific mailbox.Of course,i
>>> need to deliver name of receiver message.I have 400 domain.
>>> Do you have idea?
>>>
>> I totally do not understand what you want to do.
>> Even if it is hard, try to give an example and write more than one
>> or two sentences about a problem you consider so complex that
>> you cannot solve it on your own.
>>
>> Also, qmail comes with a full set of man pages. Read them! Especially
>> qmail-control
>> dot-qmail
>> qmail-command
>> qmail-send
>> qmail-users
>> qmail-local
>>
>> And ... as you are using vpopmail (as you wrote) read the documentation.
>> IMHO this will solve all the problems you currently have. It is made for
>> managing domains and users and delivering emails to mailboxes.
>>
>> \Maex
>>
>
>

__________________________________________________________
Scanned by Google Message Security - Leaving Seaman Paper
Attachments: jeff.vcf (0.17 KB)


mohsen at pahlevanzadeh

May 20, 2009, 11:33 PM

Post #13 of 13 (1488 views)
Permalink
Re: procmail & formail [In reply to]

Thank you, i read it.Dear Mike,by this way, i can't save name of
receiver. Do you have an idea?
Yours,
Mohsen
On Wed, 2009-05-20 at 12:22 -0700, Mike Wright wrote:
> Mohsen Pahlevanzadeh wrote:
> > Dear Markus,
> > I have a Mail server with 400 domain.Qmail+vpopmail+mysql+dovecot
> > My boss wants to see incoming messages.(for everybody)
> > I need to copy from each email & name of receiver's email to a specific
> > maildir.
> > Do you have an idea that i can copy email along with its receiver?
>
>
> Maybe this will help. It is from "http://cr.yp.to/qmail/faq/admin.html"
>
> ----------------
> How do I keep a copy of all incoming and outgoing mail messages?
>
> Answer: Set QUEUE_EXTRA to "Tlog\0" and QUEUE_EXTRALEN to 5 in extra.h.
> Recompile qmail. Put ./msg-log into ~alias/.qmail-log.
>
> You can also use QUEUE_EXTRA to, e.g., record the Message-ID of every
> message: run
>
> | awk '/^$/ { exit } /^[mM][eE][sS][sS][aA][gG][eE]-/ { print }'
>
> from ~alias/.qmail-log.

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.