newbie config main.cf to send mail thru router to internet

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie config main.cf to send mail thru router to internet

Owen Townsend
subject: newbie config main.cf to send mail thru router to internet

Hope someone can help me with the postfix configuration file.

I want to  mail from Linux logged in user accounts to the internet
and more importantly from Korn shell scripts to the internet.
so scripts running by cron could email error situations to people at home.
I do not want to receive any email from the internet to linux logged on
users
via postfix. (postfix mail between users logged on to the RH linux works OK)
I use Thunderbird for my email from internet.

I installed postfix from my Red Hat release disc:
mount /dev/cdrom /mnt
rpm -ivh /mnt/Server/postfix-2.3.3-2.x86_64.rpm

I have uploaded my main.cf & /var/log/maillog files from 2 tests
trying to email to owen@uvsoftware (my mail adrs at my ISP webfaction.com)
See 4 files in postfix/ subdir on my website:

1. www.uvsoftware.ca/postfix/main.cf        <-- my postfix config file
2. www.uvsoftware.ca/postfix/maillog1       <-- /var/log/maillog test1
3. www.uvsoftware.ca/postfix/maillog2       <-- /var/log/maillog test2
4. www.uvsoftware.ca/postfix/postfix_chk_ps <-- chklevels & ps for postfix

The only thing I changed in /etc/postfix/main.cf was relayhost about
line 320
relayhost=[74.55.86.74]     <-- smtp.webfaction.com

I am using a router to get to the internet & my ISP
- router gateway adress to the internet is 192.168.0.1
- my linux Red Hat computer is 192.168.0.4

For each test I did following:
1. service postfix stop
2. > /var/log/maillog
3. service postfix start
4. mail owen@uvsoftware    <-- my email adrs at my ISP webfaction.com
5. service postfix stop
6. capture 1st test log as maillog1 & 2nd as maillog2

In maillog1 I saw 'No route to host (port 25)'
and thought my router firewall might be blocking,
so I set my router to DMZ for my linux computer 192.168.0.4
& ran test2 to create maillog2, but I still see 'No route to host (port
25)'
- not sure what is causing this ?

Note - I saw 'sendmail' msgs on some of the maillog lines (mostly 'postfix)
     - to prove sendmail is NOT running and 'postfix' is running,
       I captured results from 'ps' & 'chkconfig' into the 'postfix_chk_ps'
       (ps/grep for sendmail & postfix, chkconfig --list sendmail & postfix)

Hope you can help me with the postfix configuration.

Thanks, Owen

Reply | Threaded
Open this post in threaded view
|

Re: newbie config main.cf to send mail thru router to internet

Charles Marcus
On 10/7/2009, Owen Townsend ([hidden email]) wrote:
> In maillog1 I saw 'No route to host (port 25)'
> and thought my router firewall might be blocking,
> so I set my router to DMZ for my linux computer 192.168.0.4
> & ran test2 to create maillog2, but I still see 'No route to host (port 25)'
> - not sure what is causing this ?

Is this a home network? If so, most likely your ISP is blocking outbound
port 25, as they should...

You can fix this by setting relayhost = [smtp.myisp.com]

> Note - I saw 'sendmail' msgs on some of the maillog lines (mostly 'postfix)
>     - to prove sendmail is NOT running and 'postfix' is running,

If 'sendmail' is shoing in the logs, it is running, simply uninstall it...

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: newbie config main.cf to send mail thru router to internet

Stan Hoeppner
Charles Marcus put forth on 10/7/2009 1:32 PM:

> You can fix this by setting relayhost = [smtp.myisp.com]

If they're blocking outbound TCP 25 from his CPE, how is changing from a
dotted decimal address in relayhost to an fqdn going to help?  _It won't_.

What he's going to need to do is one (or more) of the following:

1.  Request ISP remove TCP 25 block from his account
2.  Install/configure SASL red hat libraries -- sry no help here, Google
for "rad hat SASL library"
3.  Configure Postfix to send via SASL over either TCP 25 or 587

Create /etc/postfix/sasl_passwd
smtp.webfaction.com [hidden email]:password

Then execute:
postmap /etc/postfix/sasl_passwd

Add the following to /etc/postfix/main.cf

relayhost = [smtp.webfaction.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

--
Stan
Reply | Threaded
Open this post in threaded view
|

Re: newbie config main.cf to send mail thru router to internet

Charles Marcus
On 10/7/2009, Stan Hoeppner ([hidden email]) wrote:
> If they're blocking outbound TCP 25 from his CPE, how is changing from a
> dotted decimal address in relayhost to an fqdn going to help?  _It won't_.

Right, sorry, I read too quickly, I thought webfaction was his domain,
not his ISP...

Owen... what Stan said...

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: newbie config main.cf to send mail thru router to internet

mouss-4
In reply to this post by Owen Townsend
Owen Townsend a écrit :

> subject: newbie config main.cf to send mail thru router to internet
>
> Hope someone can help me with the postfix configuration file.
>
> I want to  mail from Linux logged in user accounts to the internet
> and more importantly from Korn shell scripts to the internet.
> so scripts running by cron could email error situations to people at home.
> I do not want to receive any email from the internet to linux logged on
> users
> via postfix. (postfix mail between users logged on to the RH linux works
> OK)
> I use Thunderbird for my email from internet.
>
> I installed postfix from my Red Hat release disc:
> mount /dev/cdrom /mnt
> rpm -ivh /mnt/Server/postfix-2.3.3-2.x86_64.rpm
>
> I have uploaded my main.cf & /var/log/maillog files from 2 tests
> trying to email to owen@uvsoftware (my mail adrs at my ISP webfaction.com)
> See 4 files in postfix/ subdir on my website:
>
> 1. www.uvsoftware.ca/postfix/main.cf        <-- my postfix config file
> 2. www.uvsoftware.ca/postfix/maillog1       <-- /var/log/maillog test1
> 3. www.uvsoftware.ca/postfix/maillog2       <-- /var/log/maillog test2
> 4. www.uvsoftware.ca/postfix/postfix_chk_ps <-- chklevels & ps for postfix
>
> The only thing I changed in /etc/postfix/main.cf was relayhost about
> line 320
> relayhost=[74.55.86.74]     <-- smtp.webfaction.com
>
> I am using a router to get to the internet & my ISP
> - router gateway adress to the internet is 192.168.0.1
> - my linux Red Hat computer is 192.168.0.4
>
> For each test I did following:
> 1. service postfix stop
> 2. > /var/log/maillog
> 3. service postfix start
> 4. mail owen@uvsoftware    <-- my email adrs at my ISP webfaction.com
> 5. service postfix stop
> 6. capture 1st test log as maillog1 & 2nd as maillog2
>
> In maillog1 I saw 'No route to host (port 25)'
> and thought my router firewall might be blocking,
> so I set my router to DMZ for my linux computer 192.168.0.4
> & ran test2 to create maillog2, but I still see 'No route to host (port
> 25)'
> - not sure what is causing this ?

may be a firewall is droping traffic?

- try pinging the relay host
- if that works, test with telnet:
telnet smtp.yourisp.example 25



> Note - I saw 'sendmail' msgs on some of the maillog lines (mostly 'postfix)
>     - to prove sendmail is NOT running and 'postfix' is running,
>       I captured results from 'ps' & 'chkconfig' into the 'postfix_chk_ps'
>       (ps/grep for sendmail & postfix, chkconfig --list sendmail & postfix)
>
> Hope you can help me with the postfix configuration.
>
> Thanks, Owen
>