Ryan Duda wrote:
>
> Sean,
>
> Ah, that did the trick. Thanks for you help.
>
> Just on a side note I had a double alias like this for testing:
> +-------+---------+---------------+
> | alias | domain | valias_line |
> +-------+---------+---------------+
> | test | domain.com | &[EMAIL PROTECTED] |
> | rpd | domain.com | &[EMAIL PROTECTED] |
> +-------+---------+---------------+
>
> Which would of course cause looping if mail was sent to [EMAIL PROTECTED]
> When you do this with .qmail files it understands that a loop is there on
> and reports: failure:
> This_message_is_looping:_it_already_has_my_Delivered-To_line
Do you have any code to check for looping? You are right. There is no
looping check code, and there needs to be. This is a dDOS problem.
>
> This is not the case with the valias, it just continues to send over and
> over again until the loop is removed manually.
We might want to add loop checking code to the valias_insert comand.
And add header checking to vdelivermail. I think qmail detects a loop
by checking if a matching Delivered-To: myemailaddress exists.
That should be fairly simple.
How about this in main just after it gets the user and domain:
/* check for looping */
sprintf(msgbuf, "%sDelivered-To: %s@%s\n",
getenv("RPLINE"), TheUser, TheDomain);
if ( check_for_looping(msgbuf) != 0 ) {
printf("This message is looping: it already has my Delivered-To
line\n");
exit(100);
}
Where:
/* Check for a looping message
* This is done by checking for a matching line
* in the email headers for Delivered-To: which
* we put in each email
*
* Return -1 if looping
* Return 0 if not looping
*/
int check_for_looping( char *delivered_to )
{
int bytes;
lseek(0,SEEK_SET,0L);
while ((bytes=read(0,loop_buf,sizeof(loop_buf)))>0){
if (strstr(delivered_to, loop_buf)!= 0 ) {
lseek(0,SEEK_SET,0L);
return(-1);
}
}
return(0);
}
>
> Thanks,
> -Ryan
>
> At 03:09 PM 5/18/2001 -0500, Sean C Truman wrote:
> >Compiling 4.10.3 on a development machine, Here are the command line alias
> >inserts.
> >
> >./valias -i "&[EMAIL PROTECTED]" [EMAIL PROTECTED]
> >./valias -i "&[EMAIL PROTECTED]" [EMAIL PROTECTED]
> >
> >Here is the "select * from valias;"
> >| alias | domain | valias_line |
> >| rpd | rifelist.org | &[EMAIL PROTECTED] |
> >| struman | rifelist.org | &[EMAIL PROTECTED] |
> >
> >Works perfectly.
> >
> >Sean
> >
> >
> >----- Original Message -----
> >From: "Ryan Duda" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Cc: "Sean C Truman" <[EMAIL PROTECTED]>
> >Sent: Thursday, May 17, 2001 2:45 PM
> >Subject: Re: valias command under 4.10.3
> >
> >
> > > Sean,
> > >
> > > I attempted to try adding &[EMAIL PROTECTED] instead of just
> >[EMAIL PROTECTED],
> > > I am seeing the same results. Pretty sure ./valias would of added the "&"
> > > if it was required at the time of issuing ./valias command. echo
> > > "&[EMAIL PROTECTED]" > .qmail-sales, works fine but it would be nice to be
> > > able to eliminate the need for the .qmail files.
> > >
> > > If anyone can verify that the proper syntax is:
> > >
> > > ./valias -i alias user@domain
> > >
> > > That would be helpful.
> > >
> > > Thanks,
> > > -Ryan
> > >
> > >
> > > At 02:01 AM 5/18/2001 -0500, you wrote:
> > > >Ryan,
> > > >
> > > > Someone correct me if I am wrong, but the alias_line need to comply
> >with
> > > >.qmail standards. &[EMAIL PROTECTED] to forward and if you wish to deliver
> >to
> > > >Maildir just use /home/vpopmail/domains/domain.com/test/Maildir
> > > >
> > > >Sean
> > > >
> > > >
> > > >----- Original Message -----
> > > >From: "Ryan Duda" <[EMAIL PROTECTED]>
> > > >To: <[EMAIL PROTECTED]>
> > > >Sent: Thursday, May 17, 2001 1:29 PM
> > > >Subject: valias command under 4.10.3
> > > >
> > > >
> > > > > Hi,
> > > > >
> > > > > I installed 4.10.3 last night with
> >"--enable-mysql=y --enable-valias=y".
> > > > > Then tried issuing the ./valias command:
> > > > >
> > > > > ./valias
> > > > > must supply alias email address
> > > > > valias: usage: [options] email_address
> > > > > options: -v ( display the vpopmail version number )
> > > > > -s ( show aliases )
> > > > > -d ( delete alias )
> > > > > -i alias_line (insert alias line)
> > > > > -
> > > > > My current user is [EMAIL PROTECTED], so I wanted to add an alias,
> > > > > [EMAIL PROTECTED] and point to [EMAIL PROTECTED]
> > > > >
> > > > > ./valias -i sales [EMAIL PROTECTED]
> > > > > -
> > > > > select * from valias;
> > > > > +-------+---------+-------------+
> > > > > | alias | domain | valias_line |
> > > > > +-------+---------+-------------+
> > > > > | test | domain.com | sales |
> > > > > +-------+---------+-------------+
> > > > > -
> > > > >
> > > > > Alright, from my understanding I should be able to send mail to
> > > > > [EMAIL PROTECTED] which will then redirect the mail into the
> > > >[EMAIL PROTECTED]
> > > > > account.
> > > > > -
> > > > >
> > > > > May 17 14:23:34 secure qmail: 990123814.611502 starting delivery 3:
> >msg
> > > > > 436484 to local [EMAIL PROTECTED]
> > > > > May 17 14:23:34 secure qmail: 990123814.612775 status: local 1/10
> >remote
> > > >0/20
> > > > > May 17 14:23:34 secure qmail: 990123814.713287 delivery 3: failure:
> > > > > Sorry,_no_mailbox_here_by_that_name._vpopmail_(#5.1.1)/
> > > > > May 17 14:23:34 secure qmail: 990123814.745175 status: local 0/10
> >remote
> > > >0/20
> > > > > May 17 14:23:34 secure qmail: 990123814.756276 bounce msg 436484 qp
> >333
> > > > > -
> > > > >
> > > > > I guess my question is, what is valias command used for then?
> > > > >
> > > > > Thanks,
> > > > > -Ryan
> > > > >
> > > > >
> > >
> > >