Skip to content

Commit

Permalink
d-remote.c: initialize use_regex variable before use
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhangui committed Feb 2, 2025
1 parent 61c1ec2 commit e9b9fbb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
3 changes: 3 additions & 0 deletions indimail-mta-x/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Release 3.1-1.1 Start 26/12/2024 End XX/XX/XXXX
Requires
- 22/01/2025
04. Fix errors when using GCC14
- 02/00/2025
05. test-recipients.c: Fix gcc14 warnings
06. rd-remote.c: initialize use_regex variable before use

* Tue Dec 24 2024 20:28:14 +0000 Manvendra Bhangui <[email protected] 3.0.9-1.1%{?dist}
Release 3.0.9-1.1 Start 08/08/2024 End 24/12/2024
Expand Down
23 changes: 9 additions & 14 deletions indimail-mta-x/rd-remote.8
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,28 @@ optional. The control file format is discussed below.

.EX
\fIaddr\fR:\fItype\fR:\fIdest\fR[:\fIprefix\fR]
.EE

\fIaddr\fR is destination domain when \fItype\fR is the letter '\fBd\fR'.
\fIaddr\fR is the recipient address when \fItype\fR is the letter '\fBr\fR'.
\fIaddr\fR is the sender address when \fItype\fR is the letter '\fBs\fR'.
Here \fIaddr\fR is destination domain when \fItype\fR is the
letter '\fBd\fR'. \fIaddr\fR is the recipient address when \fItype\fR is
the letter '\fBr\fR'. \fIaddr\fR is the sender address when \fItype\fR is
the -letter '\fBs\fR'.

\fIdest\fR can be an email address or a Maildir. When \fIdest\fR is an
email address, the mail is delivered to the address using
\fBqmail-remote\fR. When \fIdest\fR is a maildir, the mail is directly
delivered to the Maildir \fIdest\fR using \fBmaildirdeliver\fR(1).
\fIprefix\fR is optional. If given \fBrd-remote\fR uses prefix-recip as the
value for the \fBDelivered-To\fR header. If not given, sender-recip is used
as the value for the \fBDelivered-To\fR header.
.EE

Here \fIaddr\fR is destination domain when \fItype\fR is the letter
'\fBd\fR'. \fIaddr\fR is the recipient address when \fItype\fR is the
letter '\fBr\fR'. \fIaddr\fR is the sender address when \fItype\fR is the
letter '\fBs\fR'.

\fIaddr\fR can be an exact match, wildcard or a regular expression (if
\fBQREGEX\fR environment variable is defined and is non-zero). So if
\fIaddr\fR is .*@example.com, it will match all addresses belonging to
examplecom (for type 'r' or 's'). When type is 'd', you can use the
regex .*example.com for \fIaddr\fR to match all address with example.com as
the domain name.

\fIprefix\fR is optional. If given \fBrd-remote\fR uses prefix-recip as the
value for the \fBDelivered-To\fR header. If not given, sender-recip is used
as the value for the \fBDelivered-To\fR header.

You can set \fBQREMOTE=/usr/sbin/rd-remote\fR for \fBspawn-filter\fR(8) to
make it use \fBrd-remote\fR for remote deliveries and deliver the mail
locally.
Expand Down
7 changes: 5 additions & 2 deletions indimail-mta-x/rd-remote.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: rd-remote.c,v 1.5 2025-01-22 00:30:35+05:30 Cprogrammer Exp mbhangui $
* $Id: rd-remote.c,v 1.6 2025-02-02 11:50:57+05:30 Cprogrammer Exp mbhangui $
*/
#include <unistd.h>
#include <env.h>
Expand Down Expand Up @@ -161,7 +161,7 @@ addrmangle(stralloc *saout, const char *sender)
int
main(int argc, char **argv)
{
int r, use_regex, lcount, len, nullflag, count, wstat,
int r, use_regex = 0, lcount, len, nullflag, count, wstat,
match;
int pipefd[2], errpipe[2];
unsigned long size;
Expand Down Expand Up @@ -380,6 +380,9 @@ main(int argc, char **argv)

/*
* $Log: rd-remote.c,v $
* Revision 1.6 2025-02-02 11:50:57+05:30 Cprogrammer
* initialize use_regex
*
* Revision 1.5 2025-01-22 00:30:35+05:30 Cprogrammer
* Fixes for gcc14
*
Expand Down

0 comments on commit e9b9fbb

Please sign in to comment.