dotqmail problem

This is a discussion on dotqmail problem within the alt.comp.mail.qmail forums, part of the Mail Servers and Related category; Hello you all, I manage my company e-mail servers and I've a little problem, better a little question, ...


Go Back   Usenet Forums > Mail Servers and Related > alt.comp.mail.qmail

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-21-2008
silvietta
 
Posts: n/a
Default dotqmail problem

Hello you all,

I manage my company e-mail servers and I've a little problem, better a
little question, about dotqmail.

If I have my e-mail address, say silvia@mycompany.it and I want to use
an alias, say silvietta@mycompany.it, I have just to create a
dotqmail file, say .qmail-silvietta, writing in it just
silvia@mycompany.it to get on silvia account any e-mail sento to
silvietta.

But if I want forwarded only some e-mail, say only e-mail from
root@myserver.mycompany.it, how can I do? I've found on the internet
that is possible to insert | statemets in qmail (http://
http://www.giunchi.net/wp-content/up...l-howto-3.html) so my question
is:

is it possible to have a,say, .qmail-silvia containing something like
"| /home/silvia/redirect " where redirect is a shell script in which I
tell to read the FROM field (with a cat or something else) and if it
contains the word "root" to redirect the e-mail to an external address
(like silvia@external.com)?

Thank you in advance and best regards,

Silvia Z.
Reply With Quote
  #2 (permalink)  
Old 01-22-2008
silvietta
 
Posts: n/a
Default Re: dotqmail problem

> :
> : Yes. I have a large number of dotqmail files doing mail to netnews
> : gating by way ov a pipe to python scripts for further processing, for ex
> :
> : |preline $HOME/mail2news.py
> :
> :
> : as the only line in the dotqmail for the mailing list "subscriber"
>
> But note that this only works for an address like
> myusername-whatever and the dotqmail file is .qmail-whatever
>
> You'll need to play with aliases for your other forms of redirection
> which are not dotqmail based


Thank you Howard!
I was thinking about a shell script to process the FROM field of
incoming mail lookimg for "root" word (I need to receive on one of my
cellphone-manageables e-mail accounts LDAP messages coming from a
script when I'm nor at job neither at home or in a place where I can
log over the internet ... like when I go to the mountains ;-) ).
I'll try and I'll let you know.

Sil

Reply With Quote
  #3 (permalink)  
Old 01-24-2008
silvietta
 
Posts: n/a
Default Re: dotqmail problem

On 22 Gen, 09:11, silvietta <sylvie.labruy...@gmail.com> wrote:
> > :
> > : Yes. I have a large number of dotqmail files doing mail to netnews
> > : gating by way ov a pipe to python scripts for further processing, for ex
> > :
> > : |preline $HOME/mail2news.py
> > :
> > :
> > : as the only line in the dotqmail for the mailing list "subscriber"

>
> > But note that this only works for an address like
> > myusername-whatever and the dotqmail file is .qmail-whatever

>
> > You'll need to play with aliases for your other forms of redirection
> > which are not dotqmail based

>
> Thank you Howard!
> I was thinking about a shell script to process the FROM field of
> incoming mail lookimg for "root" word (I need to receive on one of my
> cellphone-manageables e-mail accounts LDAP messages coming from a
> script when I'm nor at job neither at home or in a place where I can
> log over the internet ... like when I go to the mountains ;-) ).
> I'll try and I'll let you know.
>
> Sil


Sorry, another problem is rising now:

suppose my primary e-mail address (managed by qmail) is
silvia@mydomain.it and suppose I want to receive messages from
root@ldap.mydomain.it (sent from cron to silvia@mydomain.it) also in,
say, silvia@gmail.com, I must create a .qmail-silvia file this way:

/home/vpopmail/domains/mydomain/D/silvia/Maildir/ # this way I
get normally all my messages
| /home/silvia/copymsgs #
where copymsgs is a shell script to forward root@ldap... 's messages
to silvia@gmail.com

right?

The problem now is how to write the script itself; I try to better
explain: I was thinking to write something like this (1st thing that
came to my mind):

cat <message> | grep root@ldap > root.txt
if [ -s root.txt ] then <forward>
fi
rm -f root.txt

but ... how tell the script on which file doing the cat command?
and ... how to tell qmail to forward if the test doesn't fail?

Thank you and best regards,

Sil

Reply With Quote
  #4 (permalink)  
Old 01-29-2008
silvietta
 
Posts: n/a
Default Re: dotqmail problem


>
> Maybe with multiple elif conditionals? May I suggest checking out
> something like maildrop or procmail to handle your inbound message
> processing? You can pipe from /var/qmail/aliases/blahs or dotqmails
> to one of those packages and do some very cool stuff with much less
> pain.


Thank you again, Howard! I'll keep your suggestions in mind and I'll
try to set up something working.

For the moment, since the reason that made me thinking about
forwarding only root messages was a frivolous one (just to be able
checking my mail via cellphone when I'm at the mountain ... my domain
hasn't a wap frontend but gmail has), I've resolved (bypassed???) my
problem in another way.

I've been sick in these deays and had a lot of time to think, so it
came to my mind simply to create a .qmail-fakesilvia this way:

silvia@mydomain.it
sylvie.labruyere@gmail.com

and modified the script in cron to send root messages to
fakesilvia@mydomain.it

I know that is a bad way to solve similar problems, but it's also the
easiest ;-)

Best regards and thank you again

Sil
Reply With Quote
  #5 (permalink)  
Old 03-29-2008
Andreas F. Borchert
 
Posts: n/a
Default Re: dotqmail problem

On 2008-01-21, silvietta <sylvie.labruyere@gmail.com> wrote:
> is it possible to have a,say, .qmail-silvia containing something like
> "| /home/silvia/redirect " where redirect is a shell script in which I
> tell to read the FROM field (with a cat or something else) and if it
> contains the word "root" to redirect the e-mail to an external address
> (like silvia@external.com)?


Yes, using the dot-qmail-utils [1], you are free to write this:

condredirect silvia@external.com ifheader -r '^From.*root'

Andreas.

[1] http://dotqmailutils.sourceforge.net/
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:25 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0