Manually reinject mails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Manually reinject mails

Peter Tselios
Dear all,
        I have a Postfix/dspam/clamav (maildir format) SMTP gateway configured for a
company (I do not work for that company, I simply install the Linux servers).
For a strange reason, dspam stopped to reinject mails back to postfix. Thus,
all mails were stored in file /var/spool/dspam.
I managed to separate the messages from dspam, using the mb2ml tool. Now, I
wan to manually insert those files in a postfix queue, and to be delivered to
my user's mailboxes. How can I do that?
I tried by copying files to various queues (incoming, hold, bounce, etc) but
mailq reports an empty queue.
A real example of the extracted filename is:

1215675821.59608112197.server.domain.com
Please help.
Thank you
Peter

Reply | Threaded
Open this post in threaded view
|

Re: Manually reinject mails

Ralf Hildebrandt
* s91066 <[hidden email]>:

> Dear all,
> I have a Postfix/dspam/clamav (maildir format) SMTP gateway configured for a
> company (I do not work for that company, I simply install the Linux servers).
> For a strange reason, dspam stopped to reinject mails back to postfix. Thus,
> all mails were stored in file /var/spool/dspam.
> I managed to separate the messages from dspam, using the mb2ml tool. Now, I
> wan to manually insert those files in a postfix queue, and to be delivered to
> my user's mailboxes. How can I do that?
> I tried by copying files to various queues (incoming, hold, bounce, etc) but
> mailq reports an empty queue.
> A real example of the extracted filename is:
>
> 1215675821.59608112197.server.domain.com

sendmail -i recipient < 1215675821.59608112197.server.domain.com

--
Ralf Hildebrandt ([hidden email])          [hidden email]
Postfix - Einrichtung, Betrieb und Wartung       Tel. +49 (0)30-450 570-155
http://www.arschkrebs.de
And others again have been told what a Unix would be and how it is
working. If this people are extraterrestrial or an ancient
mainframe-team of IBM (the difference is not that big), and they then
try to build a Unix, you will get a AIX 2 and 3 - a hybride monster
with green blood which will not kill you maybe, but when you look at
the innwards you wish you where dead afterwards.
Reply | Threaded
Open this post in threaded view
|

Re: Manually reinject mails

Peter Tselios
In reply to this post by Peter Tselios
Nobody?
Please, I really need some help here. I have over 1300 emails that needs to be
delivered to users until tommorow!

> Dear all,
> I have a Postfix/dspam/clamav (maildir format) SMTP gateway configured for
> a company (I do not work for that company, I simply install the Linux
> servers). For a strange reason, dspam stopped to reinject mails back to
> postfix. Thus, all mails were stored in file /var/spool/dspam.
> I managed to separate the messages from dspam, using the mb2ml tool. Now, I
> wan to manually insert those files in a postfix queue, and to be delivered
> to my user's mailboxes. How can I do that?
> I tried by copying files to various queues (incoming, hold, bounce, etc)
> but mailq reports an empty queue.
> A real example of the extracted filename is:
>
> 1215675821.59608112197.server.domain.com
> Please help.
> Thank you
> Peter

Reply | Threaded
Open this post in threaded view
|

Re: Manually reinject mails

Magnus Bäck
On Friday, July 11, 2008 at 00:07 CEST,
     S <[hidden email]> wrote:

> Nobody?
> Please, I really need some help here. I have over 1300 emails that
> needs to be delivered to users until tommorow!

You received an answer from Ralf Hildebrandt only minutes after you
posted the question.

--
Magnus Bäck
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Manually reinject mails

Jose Ildefonso Camargo Tolosa
On Fri, Jul 11, 2008 at 5:57 PM, Magnus Bäck <[hidden email]> wrote:
> On Friday, July 11, 2008 at 00:07 CEST,
>     S <[hidden email]> wrote:
>
>> Nobody?
>> Please, I really need some help here. I have over 1300 emails that
>> needs to be delivered to users until tommorow!
>
> You received an answer from Ralf Hildebrandt only minutes after you
> posted the question.

Yup... pretty fast, I must say.  He said:

sendmail -i recipient < 1215675821.59608112197.server.domain.com

Off course, running that one by one would make no sense, so you should
construct a simple shell script that run that command for each mail
file.

c-ya!

Ildefonso Camargo.
Reply | Threaded
Open this post in threaded view
|

Re: Manually reinject mails

MrC-7
In reply to this post by Magnus Bäck

> On Friday, July 11, 2008 at 00:07 CEST,
>      S <[hidden email]> wrote:
>
>> Nobody?
>> Please, I really need some help here. I have over 1300 emails that
>> needs to be delivered to users until tommorow!
>
> You received an answer from Ralf Hildebrandt only minutes after you
> posted the question.
>

The OP wasn't happy about the answer, and posted the same question over
at linuxquestions.org :

> Today, 08:26 AM
> All mails of July 8,2008 are stored in file /var/spool/dspam (and we are
> talking about 1300 emails). I managed to extract messages from dspam to
> files, as I use maildir, using the mb2ml tool. Now, I want to manually
> insert those files in a postfix queue, in order to be delivered to my
> user's mailboxes. How can I do that?
> I tried by copying files to various queues (incoming, hold, bounce, etc) but
> mailq reports an empty queue. A real example of the extracted filename is:
> 1215675821.59608112197.server.domain.com
>
> Please help.
> Thank you
> Peter

to which I responded...

> Today, 10:55 AM
> No, you can't copy the files into postfix queues. Those are postfix
> private, and the contents is undocumented (because it is private).
>
> You can reintroduce into the post content_filter smtpd port with
> something like mini_sendmail. If you don't care that the mail goes
> through the content filter again, you can reintroduce into the before
> content_filter smtpd process. For this you can use even sendmail
> (sendmail -i recipient < mail_file).

and the OP replied...

> Today, 01:40 PM
> The recipient is not known! Of course I can find it with a simple grep,
> but that will be very insecure...
>
> Anyway, are you sure that I cannot simply copy them to a queue dir?

so I insisted...

> Today, 01:44 PM
> You *absolutely* cannot copy them into any queue directory.
>
> man mini_sendmail
> ...
>
> -t Read message for recipients. To:, Cc:, and Bcc: lines will be
> scanned for recipient addresses. The Bcc: line will be deleted
> before transmission.


Reply | Threaded
Open this post in threaded view
|

Re: Manually reinject mails

Noel Jones-2
MrC wrote:

>> On Friday, July 11, 2008 at 00:07 CEST,
>>      S <[hidden email]> wrote:
>>
>>> Nobody?
>>> Please, I really need some help here. I have over 1300 emails that
>>> needs to be delivered to users until tommorow!
>> You received an answer from Ralf Hildebrandt only minutes after you
>> posted the question.
>>
>
> The OP wasn't happy about the answer, and posted the same question over
> at linuxquestions.org :
>
>> Today, 08:26 AM
>> All mails of July 8,2008 are stored in file /var/spool/dspam (and we are
>> talking about 1300 emails). I managed to extract messages from dspam to
>> files, as I use maildir, using the mb2ml tool. Now, I want to manually
>> insert those files in a postfix queue, in order to be delivered to my
>> user's mailboxes. How can I do that?
>> I tried by copying files to various queues (incoming, hold, bounce, etc) but
>> mailq reports an empty queue. A real example of the extracted filename is:
>> 1215675821.59608112197.server.domain.com
>>
>> Please help.
>> Thank you
>> Peter
>
> to which I responded...
>
>> Today, 10:55 AM
>> No, you can't copy the files into postfix queues. Those are postfix
>> private, and the contents is undocumented (because it is private).
>>
>> You can reintroduce into the post content_filter smtpd port with
>> something like mini_sendmail. If you don't care that the mail goes
>> through the content filter again, you can reintroduce into the before
>> content_filter smtpd process. For this you can use even sendmail
>> (sendmail -i recipient < mail_file).
>
> and the OP replied...
>
>> Today, 01:40 PM
>> The recipient is not known! Of course I can find it with a simple grep,
>> but that will be very insecure...
>>
>> Anyway, are you sure that I cannot simply copy them to a queue dir?
>
> so I insisted...
>
>> Today, 01:44 PM
>> You *absolutely* cannot copy them into any queue directory.
>>
>> man mini_sendmail
>> ...
>>
>> -t Read message for recipients. To:, Cc:, and Bcc: lines will be
>> scanned for recipient addresses. The Bcc: line will be deleted
>> before transmission.
>
>


Caution! Using the -t option for already-queued mail will
misdirect and loose mail.  This option is only appropriate for
original mail submission where you control who is in the headers.

Hopefully the messages have a Delivered-To: header or other
information that shows the actual recipient.  OP will need a
script to extract this information and inject the mail into
sendmail or mini_sendmail.

The advice from all the others is correct... there is no way
to directly move these files into a postfix queue.  The only
ways to get mail into postfix is via the sendmail(1) command,
or via SMTP or QMQP

--
Noel Jones
Reply | Threaded
Open this post in threaded view
|

Re: Manually reinject mails

Ralf Hildebrandt
In reply to this post by Peter Tselios
* S <[hidden email]>:

> Nobody?

No, I answered. Try reading your mails.

--
Ralf Hildebrandt ([hidden email])          [hidden email]
Postfix - Einrichtung, Betrieb und Wartung       Tel. +49 (0)30-450 570-155
http://www.arschkrebs.de
Windows is the answer, but only if the question was 'what is the
intellectual equivalent of being a galley slave?'
Reply | Threaded
Open this post in threaded view
|

Re: Manually reinject mails

Peter Tselios
I did, I found nothing after a lot of hours and then I reposted.
Anyway, a possible error on my side, but I got the answer, eventually.
I will create the script and report the results, for any possible future
reference. Post the script too?

Thank you all,

> * S <[hidden email]>:
> > Nobody?
>
> No, I answered. Try reading your mails.