LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   howto sendmail with redirected port (http://www.linuxquestions.org/questions/linux-networking-3/howto-sendmail-with-redirected-port-4175424885/)

mfoley 08-30-2012 11:08 PM

howto sendmail with redirected port
 
I have a fairly vanilla sendmail setup I've used before, but is not working now. I think the difference is that the IP address for the mail server and MX record resolves to a router which forwards port 25 to an machine with a LAN IP of 192.168.2.100. I think this is messing things up, but I don't know how to fix it. Here is my .mc file:

include(`../m4/cf.m4')
VERSIONID(`$Id: fluxrunner.mc,v 1.0 2009/08/08 11:07:18 root Exp root $')dnl
OSTYPE(`linux')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confTO_IDENT', `0')dnl
define(`confBAD_RCPT_THROTTLE',`1')dnl
define(`confCONNECTION_RATE_THROTTLE',`3')dnl
define(`confDEAD_LETTER_DROP',`/dev/null')dnl
define(`confDOUBLE_BOUNCE_ADDRESS',`nobody')dnl
define(`confDF_BUFFER_SIZE',`16384')dnl
define(`confXF_BUFFER_SIZE',`16384')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`lookupdotdomain')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`dnsbl', `dul.dnsbl.sorbs.net')dnl
FEATURE(`delay_checks',`friend',`n')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`redirect')dnl
MASQUERADE_AS(`cantleysauto.com')
FEATURE(`masquerade_envelope')
FEATURE(`masquerade_entire_domain')
FEATURE(`relay_entire_domain')dnl
EXPOSED_USER(`root')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl

Here is the /etc/maillog info after trying to send from a local user account to my account at a remote location:


Aug 29 19:59:49 mail sm-mta[1797]: gethostbyaddr(192.168.2.100) failed: 1
Aug 29 19:59:49 mail sm-mta[1798]: starting daemon (8.14.4): SMTP+queueing@00:25:00
Aug 29 19:59:53 mail sm-msp-queue[1801]: starting daemon (8.14.4): queueing@00:25:00
Aug 29 20:00:05 mail sm-mta[2256]: q7U005LQ002256: cpe-76-181-75-238.columbus.res.rr.com [76.181.75.238] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Aug 29 20:06:09 mail sm-mta[1799]: q7TNv2Gs028575: to=<mfoley@novatec-inc.com>, ctladdr=<mfoley@mail> (1000/100), delay=00:09:04, xdelay=00:06:19, mailer=esmtp, pri=120466, relay=inbound.novatec-inc.com.netsolmail.net. [205.178.149.7], dsn=4.0.0, stat=Deferred: Connection timed out with inbound.novatec-inc.com.netsolmail.net.
Aug 29 20:10:05 mail sm-mta[6129]: q7U0A5n5006129: cpe-76-181-75-238.columbus.res.rr.com [76.181.75.238] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Aug 29 20:20:05 mail sm-mta[10008]: q7U0K5e5010008: cpe-76-181-75-238.columbus.res.rr.com [76.181.75.238] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA


Notice the "gethostbyaddr(192.168.2.100) failed: 1" error.

I added 192.168.2.100 to my /etc/hosts file and got the following in maillog:

Aug 30 12:55:02 mail sm-mta[1792]: starting daemon (8.14.4): SMTP+queueing@00:25:00
Aug 30 12:55:02 mail sm-msp-queue[1795]: starting daemon (8.14.4): queueing@00:25:00
Aug 30 12:55:03 mail sm-mta[1793]: q7UGoA45005574: to=<mfoley@mail.cantleysauto.com>, ctladdr=<mfoley@mail.cantleysauto.com> (1000/100), delay=00:04:51, xdelay=00:00:00, mailer=local, pri=150678, dsn=2.0.0, stat=Sent
Aug 30 13:00:02 mail sm-mta[3804]: q7UH02Fu003804: cpe-76-181-75-238.columbus.res.rr.com [76.181.75.238] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Aug 30 13:01:24 mail sm-mta[1793]: q7UGoA45005574: to=<mfoley@novatec-inc.com>, ctladdr=<mfoley@mail.cantleysauto.com> (1000/100), delay=00:11:12, xdelay=00:06:21, mailer=esmtp, pri=150678, relay=inbound.novatec-inc.com.netsolmail.net. [205.178.149.7], dsn=4.0.0, stat=Deferred: Connection timed out with inbound.novatec-inc.com.netsolmail.net.
Aug 30 13:01:24 mail sm-mta[1793]: q7UGYUBH031628: to=<mfoley@novatec-inc.com>, ctladdr=<mfoley@mail.cantleysauto.com> (1000/100), delay=00:26:53, xdelay=00:00:00, mailer=esmtp, pri=210509, relay=inbound.novatec-inc.com.netsolmail.net., dsn=4.0.0, stat=Deferred: Connection timed out with inbound.novatec-inc.com.netsolmail.net.
Aug 30 13:10:02 mail sm-mta[7669]: q7UHA2Rk007669: cpe-76-181-75-238.columbus.res.rr.com [76.181.75.238] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Aug 30 13:20:02 mail sm-mta[11533]: q7UHK2RI011533: cpe-76-181-75-238.columbus.res.rr.com [76.181.75.238] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Aug 30 13:26:23 mail sm-mta[11534]: q7UGoA45005574: to=<mfoley@novatec-inc.com>, ctladdr=<mfoley@mail.cantleysauto.com> (1000/100), delay=00:36:11, xdelay=00:06:19, mailer=esmtp, pri=240678, relay=inbound.novatec-inc.com.netsolmail.net. [205.178.149.7], dsn=4.0.0, stat=Deferred: Connection timed out with inbound.novatec-inc.com.netsolmail.net.
Aug 30 13:26:23 mail sm-mta[11534]: q7UGYUBH031628: to=<mfoley@novatec-inc.com>, ctladdr=<mfoley@mail.cantleysauto.com> (1000/100), delay=00:51:52, xdelay=00:00:00, mailer=esmtp, pri=300509, relay=inbound.novatec-inc.com.netsolmail.net., dsn=4.0.0, stat=Deferred: Connection timed out with inbound.novatec-inc.com.netsolmail.net.
Aug 30 13:30:02 mail sm-mta[15397]: q7UHU2QO015397: cpe-76-181-75-238.columbus.res.rr.com [76.181.75.238] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA

No more gethostbyaddr error, but still not working. I suspect the problem is that 192.168.2.100 does not correspond to the real external MX IP address, but if that's the case, I don't know how to fix it. Help?


All times are GMT -5. The time now is 05:51 AM.