Mailing List Archive

tcp.smtp and qmail-smtpd/run script question
People,

These are the last lines I have in my qmail-smtpd/run script:

/usr/local/bin/tcpserver -v -R -H -l "$LOCAL" \
-x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
/usr/local/bin/spamdyke -f /etc/spamdyke.conf \
/var/qmail/bin/qmail-smtpd 2> /var/log/spamdyke.log

Now spamdyke is not allowing mail to be relayed from local machines -
physical, virtual and Docker containers.

I am wondering if there is some scripting magic for this run file which
will cause the ip addresses that are allowed to relay (ie the ones which
appear in tcp.smtp) to be skipped by the spamdyke check somehow? - some
sort of "if then / else / fi" thing?

Thanks,

Phil.
--
Philip Rhoades

PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au
Re: tcp.smtp and qmail-smtpd/run script question [ In reply to ]
Philip Rhoades <phil@pricom.com.au> wrote:
>
> /usr/local/bin/tcpserver -v -R -H -l "$LOCAL" \
> -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
> -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
> /usr/local/bin/spamdyke -f /etc/spamdyke.conf \
> /var/qmail/bin/qmail-smtpd 2> /var/log/spamdyke.log
>
> Now spamdyke is not allowing mail to be relayed from local machines -
> physical, virtual and Docker containers.
>
> I am wondering if there is some scripting magic for this run file which will
> cause the ip addresses that are allowed to relay (ie the ones which appear
> in tcp.smtp) to be skipped by the spamdyke check somehow? - some sort of "if
> then / else / fi" thing?

Sure. Write your own shellscript wrapper around spamdyke that basically
checks whether RELAYCLIENT is set; if so, it skips invoking spamdyke and just
executes the rest of the command line.

Then call that shellscript in place of spamdyke in the above command.

Charles
--
--------------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at: http://pyropus.ca/software/
Read http://pyropus.ca/personal/writings/12-steps-to-qmail-list-bliss.html
--------------------------------------------------------------------------
Re: tcp.smtp and qmail-smtpd/run script question [ In reply to ]
Charles,


On 2018-06-04 13:00, Charles Cazabon wrote:
> Philip Rhoades <phil@pricom.com.au> wrote:
>>
>> /usr/local/bin/tcpserver -v -R -H -l "$LOCAL" \
>> -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
>> -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
>> /usr/local/bin/spamdyke -f /etc/spamdyke.conf \
>> /var/qmail/bin/qmail-smtpd 2> /var/log/spamdyke.log
>>
>> Now spamdyke is not allowing mail to be relayed from local machines -
>> physical, virtual and Docker containers.
>>
>> I am wondering if there is some scripting magic for this run file
>> which will
>> cause the ip addresses that are allowed to relay (ie the ones which
>> appear
>> in tcp.smtp) to be skipped by the spamdyke check somehow? - some sort
>> of "if
>> then / else / fi" thing?
>
> Sure. Write your own shellscript wrapper around spamdyke that
> basically
> checks whether RELAYCLIENT is set; if so, it skips invoking spamdyke
> and just
> executes the rest of the command line.
>
> Then call that shellscript in place of spamdyke in the above command.


Just what I wanted! Thanks for that - actually I worked out a quick and
dirty way too - I ran another copy of tcpserver without spamdyke but
using port 2525 instead. Tt works when testing with telnet and swaks
(simulating the relay clients) but there is yet still a another problem
with my Discourse Docker container talking to the host which I have to
chase up in another forum . .

Regards,

Phil.
--
Philip Rhoades

PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au