View previous topic :: View next topic |
Author |
Message |
mntlcase n00b

Joined: 02 Jan 2005 Posts: 5
|
Posted: Thu Feb 10, 2005 11:01 pm Post subject: SMTP Smarthost Gateway for LAN? |
|
|
Hello all,
I am looking for a simple HOWTO on configuring my Gentoo server box to act as an SMTP server (sending only), that will allow me to use my ISP SMTP server as a smarthost.
I don't need receive capabilities and I had my W2K3 server configured for this, but I have since installed Gentoo on the box.
I have found several "home mail server" HOWTO's, but they are overly complex, involving configuring both the sending and receiving aspect.
I just need to point my LAN email clients to the Gentoo box as their SMTP server, then have the Gentoo box relay the email to my ISPs SMTP server.
Any help would be wonderful! |
|
Back to top |
|
 |
GordSki Guru


Joined: 18 Oct 2004 Posts: 329
|
Posted: Thu Feb 10, 2005 11:10 pm Post subject: |
|
|
Do you have a preference for the MTA to use?
EDIT: I know how to set it up in sendmail and postfix.
G. |
|
Back to top |
|
 |
mntlcase n00b

Joined: 02 Jan 2005 Posts: 5
|
Posted: Thu Feb 10, 2005 11:31 pm Post subject: |
|
|
GordSki wrote: | Do you have a preference for the MTA to use?
EDIT: I know how to set it up in sendmail and postfix.
G. |
Nope, since it won't be accessible from the internet, any MTA will be fine.
Thanks! |
|
Back to top |
|
 |
GordSki Guru


Joined: 18 Oct 2004 Posts: 329
|
Posted: Thu Feb 10, 2005 11:49 pm Post subject: |
|
|
For postfix, edit this section of /etc/postfix/main.cf:
Code: |
# INTERNET OR INTRANET
# The relayhost parameter specifies the default host to send mail to
# when no entry is matched in the optional transport(5) table. When
# no relayhost is given, mail is routed directly to the destination.
#
# On an intranet, specify the organizational domain name. If your
# internal DNS uses no MX records, specify the name of the intranet
# gateway host instead.
#
# In the case of SMTP, specify a domain, host, host:port, [host]:port,
# [address] or [address]:port; the form [host] turns off MX lookups.
#
# If you're connected via UUCP, see also the default_transport parameter.
#
#relayhost = $mydomain
#relayhost = [gateway.my.domain]
#relayhost = [mailserver.isp.tld]
#relayhost = uucphost
#relayhost = [an.ip.add.ress]
|
For sendmail stick an entry in /etc/mail/sendmail.mc like this:
Code: |
define(`SMART_HOST', `smtp:mail.trash.net')dnl
|
Then run the following in /etc/mail:
Code: |
m4 sendmail.mc > sendmail.cf
|
By the way, my preference is for postfix, much nicer
G. |
|
Back to top |
|
 |
GordSki Guru


Joined: 18 Oct 2004 Posts: 329
|
Posted: Fri Feb 11, 2005 12:12 am Post subject: |
|
|
I forgot to tell you that you'll need to allow relay from your local network.
Here's how on postfix, again in main.cf:
Code: |
# Alternatively, you can specify the mynetworks list by hand, in
# which case Postfix ignores the mynetworks_style setting.
#
# Specify an explicit list of network/netmask patterns, where the
# mask specifies the number of bits in the network part of a host
# address.
#
# You can also specify the absolute pathname of a pattern file instead
# of listing the patterns here. Specify type:table for table-based lookups
# (the value on the table right-hand side is not used).
#
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks
#mynetworks = hash:/etc/postfix/network_table
|
for sendmail stick something like the following in /etc/mail/access:
note: the above will allow relay for machines in 192.168.0.0/255.255.255.0
Good luck!
G. |
|
Back to top |
|
 |
mntlcase n00b

Joined: 02 Jan 2005 Posts: 5
|
Posted: Sat Feb 12, 2005 1:03 am Post subject: |
|
|
I tried postfix and sendmail, and this is the error I get with sendmail:
Feb 11 16:00:31 [sendmail] j1BL0Uqx001285: to=root, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=34050, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
I give up...  |
|
Back to top |
|
 |
GordSki Guru


Joined: 18 Oct 2004 Posts: 329
|
Posted: Sat Feb 12, 2005 4:45 pm Post subject: |
|
|
Can you post the changes you made to the postfix config?
I just tested the changes I describe above on my own network and it works fine........
G. |
|
Back to top |
|
 |
mntlcase n00b

Joined: 02 Jan 2005 Posts: 5
|
Posted: Sat Feb 12, 2005 11:49 pm Post subject: |
|
|
GordSki wrote: | Can you post the changes you made to the postfix config?
I just tested the changes I describe above on my own network and it works fine........
G. |
Uh oh, after I unmerged sendmail, remerged postfix, I am getting this error:
* Caching service dependencies...
* Service 'sendmail' already provide 'mta'!;
* Not adding service 'postfix'...
Regardless, I made the changes you listed above to my postfix files, but kept getting a [!!] when I tried to start postfix, so I added this line:
# INTERNET HOST AND DOMAIN NAMES
#
# The myhostname parameter specifies the internet hostname of this
# mail system. The default is to use the fully-qualified domain name
# from gethostname(). $myhostname is used as a default value for many
# other configuration parameters.
#
myhostname = dopamine
That allowed me to start postfix, but I still get this error with Outlook when I add the IP of my Gentoo box as the SMTP server:
Send test email message: Unable to send test email message. Please verify the email address field.
For brevity's sake, here are the actual changes I made.
# Alternatively, you can specify the mynetworks list by hand, in
# which case Postfix ignores the mynetworks_style setting.
#
# Specify an explicit list of network/netmask patterns, where the
# mask specifies the number of bits in the network part of a host
# address.
#
# You can also specify the absolute pathname of a pattern file instead
# of listing the patterns here. Specify type:table for table-based lookups
# (the value on the table right-hand side is not used).
#
mynetworks = 192.168.1.0/24, 127.0.0.0/8
# The relayhost parameter specifies the default host to send mail to
# when no entry is matched in the optional transport(5) table. When
# no relayhost is given, mail is routed directly to the destination.
#
# On an intranet, specify the organizational domain name. If your
# internal DNS uses no MX records, specify the name of the intranet
# gateway host instead.
#
# In the case of SMTP, specify a domain, host, host:port, [host]:port,
# [address] or [address]:port; the form [host] turns off MX lookups.
#
# If you're connected via UUCP, see also the default_transport parameter.
#
#relayhost = $mydomain
relayhost = pop-server.triad.rr.com
I hope this helps and again, I thank you for your help trying to get this working! |
|
Back to top |
|
 |
GordSki Guru


Joined: 18 Oct 2004 Posts: 329
|
Posted: Sun Feb 13, 2005 2:15 pm Post subject: |
|
|
mntlcase wrote: |
Uh oh, after I unmerged sendmail, remerged postfix, I am getting this error:
* Caching service dependencies...
* Service 'sendmail' already provide 'mta'!;
* Not adding service 'postfix'...
|
Did you add sendmail to the default runlevel with rc-update?
You might need to remove it again:
Code: |
rc-update del sendmail
|
It sounds like postfix might not be running......
Use 'top' or 'ps' to see the postfix process is running. There might be more info in '/var/log/messages'.
G. |
|
Back to top |
|
 |
kozmic n00b

Joined: 29 Oct 2002 Posts: 33
|
Posted: Mon Feb 14, 2005 5:16 pm Post subject: |
|
|
Quote: |
Caching service dependencies...
* Service 'sendmail' already provide 'mta'!;
* Not adding service 'postfix'...
|
I have the same issue, sendmail is unemerged and I get this message.
Sendmail is not in any default runlevel:
Quote: |
root # rc-update del sendmail
* sendmail not found in any of the specified runlevels.
|
Anyone got a clue what makes it say sendmail already provides mta? |
|
Back to top |
|
 |
langthang Retired Dev

Joined: 27 Nov 2003 Posts: 620
|
Posted: Mon Feb 14, 2005 5:28 pm Post subject: |
|
|
Q:
Code: | Caching service dependencies...
* Service 'sendmail' already provide 'mta'!;
* Not adding service 'postfix'... |
A:
Code: | # rm /etc/init.d/sendmail |
_________________ Gentoo users' map |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|