Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to setup special smtp port

Status
Not open for further replies.

chiuhong

Technical User
Jun 28, 2000
26
0
0
HK
Hi,
anyone knows how to setup qmail server a special smtp port other than port 25(ex.port 1025 ..) which allow users send out the mail as port 25 blocked their ISP?

Thanks
 
First, most ISP's have an arrangement to permit port 25 to a known IP or IPs if you just ask them.

That said, you need to edit the script typically created in /var/qmail/supervise/qmail-smtpd/run

in the middle of the file is typically a reference to either "smtp" or "25", this is the port assignment for the script to listen on...

you could either make a copy and add it is as another service or modify your one-an-only to run on the new port.

D.E.R. Management - IT Project Management Consulting
 
Thanks thedaver for you kindly help.
Some ISP like in China, they will blocked port 25.
I am just not sure if you can help give me a example where & how to add for, also if available concurrent port? like 1025 and 2525 ? do I have change or add port to /etc/service ?

#!/bin/sh
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
exec /usr/local/bin/softlimit -m 2000000
/usr/local/bin/tcpserver -v -p -x /etc/tcp.smtp.cdb
-c “$MAXSMTPD” -u “$QMAILDUID” -g “$NOFILESGID” 0 smtp /var/qmail/bin/qmail-smtpd 2>&1


Thanks & Best Regards
chiuhong
 
smtp" in your last line of sample code is the parameter.

Currently, it IS using the /etc/services lookup against service defined as smtp

You can directly change from "smtp" to "1025" in your run file and obtain the desired outcome.

D.E.R. Management - IT Project Management Consulting
 
a question, is that means no qmail server can be build up if our ISP blocked port 25(smtp)? ((office(user send the message from their outlook) -----> through qmail server ----> through internet ----> to third person)). or any way if ISP provided a smtp address:smtp.isp.com, can we use this smtp address to send out the message from the qmail server?

P.S. I was built up a qmail server (ISP blocked smtp), I sent a message from outlook through qmail server outside internet.(qmail server with outlook client). i saw a message hold on the qmail server's queue and never outside the internet.

Thanks & Best Regards
Calvin Wong
 
If you have a business account with your provider, chances are they automatically remove any port 25 filters. Most of them will not for non-business accounts though. If you don't want to deal with all of that, your best solution might be to sign up for No-Ip.com's mail redirector solution, which allows your smtp server to send mail to them on an alternate port, and they send mail addressed to you back to your server on that same alternate port. Its designed for situations exactly like the one your facing.
 
Thanks slylos for your quick respond.
Yes, I do have a smtp with an alternate port(ex. smtp.isp.com 1025) which allow us to send out the message without through our ISP's. So you have any idea how to setup this smtp address on the qmail server?


Thanks & Best Regards
 
ok I think I found the answer how:

qmail-remote-auth
by Jay Soffian, modified by tom@tomclegg.net

Add SMTP authentication support (AUTH LOGIN) to qmail-remote. This is useful for relaying outgoing mail to a smarthost which requires authentication.

My modifications:

This version sends base64-encoded username/password (Jay's version sends plain username/password).
Jay's version expects the server to say "AUTH=LOGIN\n"; this version will also accept "AUTH=LOGIN ". This is necessary for servers which say (for example) "AUTH=LOGIN PLAIN".
This version recognizes "AUTH LOGIN" as well as "AUTH=LOGIN" (recommended by David DeHaven, using an SBC mail server).
This version recognizes "AUTH PLAIN LOGIN" (recommended by Fernando Lemes da Silva, using paramonga.terra.com.br and smtp.koho.com.br).
Obviously this part of the code should be rewritten to handle the general case instead of the three preceding exceptions, but I haven't done that yet.
You need to install qmail-smtpd-auth as well, just because this patch needs base64.c and base64.h (and the attendant patches to Makefile).

To install:

cd /src/qmail-1.03
fetch patch < qmail-remote-auth.patch
make qmail-remote
install -m 711 qmail-remote /var/qmail/bin/qmail-remoteTo relay outgoing mail for "example.com" to an SMTP server at 10.9.8.7 port 2500 with username "foo" and password "bar":

echo example.com:10.9.8.7:2500 foo bar >>/var/qmail/control/smtproutesTo relay all outgoing mail to an SMTP server at 10.9.8.7 port 25 with username "foo" and password "bar":

echo :10.9.8.7 foo bar >>/var/qmail/control/smtproutes
 
Have you tried talking to your ISP? If your not trying to send out spam, I don't see why you would feel the need to get qmail sending email out to a smarthost on an alternate port. We use Bellsouth at work, and they removed all port 25 filters because its a business account. But we personally called them and spoke with them about it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top