?
Solved

Sendmail and Qpopper help - backup server config

Posted on 2003-03-09
11
Medium Priority
?
351 Views
Last Modified: 2010-03-18
I have sendmail and qpopper setup on my main box primary.mydomain.com and would like to setup secondary.mydomain.com to relay mail when primary is down, so I am guessing what needs to be done is to setup e-mail fwding on the second server to the first server. So in the end I want my mail to be sent to the main server, if main server down send to second server. Second server relays mail to main server once back up.
Thanks in advance.
0
Comment
Question by:JesNoFear
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 3

Accepted Solution

by:
naccad earned 200 total points
ID: 8100097
u have box1 working, right?

on box2, add your domain name to /etc/mail/relay-domains
and in /etc/mail/mailertable put

mydomain.com smtp:[primary.mydomain.com]

and then run makemap to create the database

makemap hash mailertable < /etc/mail/mailertable

stop and start sendmail and you're on your way

dont forget to put secondary.domain.com as as MX record in
you DNS

tc
-nick
0
 
LVL 2

Author Comment

by:JesNoFear
ID: 8108288
I am having some issues with testing this out.
Once i disable the internet interface (ifconfig eth0 down) the e-mails are not going through the second server. One problem i am getting is that the e-mails are being put on hold till the server is back up, another issue i don't understand that only happned once was it went to my third servers ip, which is not in the list of NS's in the domain list. i have ns1 that goes to my primary server and ns2 that goes to my second server. i have configured mail.mydomain.com going to primary server and mail2.mydomain.com going to my secondary server.
In the MX Record it is listed as
A IN 10 mail.mydomain.com
A IN 11 mail2.mydomain.com

now i am not 100% sure the dns is configured on the second server correctly, i was up till 3 am this morning trying alot of diffrent things. so right now i have secondary setup to be the slave, and primary setup as master.

here is my /etc/named.conf on primary
acl ns { 127.0.0.1 ; xxx.xxx.xxx.xx4 ; xxx.xxx.xxx.xx5 ; } ;
options {
         directory "/var/named";
         query-source address * port 53;
         transfer-source * port 53;
         allow-transfer { ns ; } ;
};

### normal addin's for localhost
zone "mydomain.com" {
type master;
file "mydomain.com.zone" l
allow-update { none; }l
};

here is my /var/named/mydomain.com.zone
$TTL 86400
$ORIGIN mydomain.com.
1D IN SOA @ root (
42
3H
15M
3H
3H )
IN NS ns1.mydomain.com.
IN NS ns2.mydomain.com.
IN MX 10 mail.mydomain.com.
IN MX 11 mail2.mydomain.com.
IN A xxx.xxx.xxx.xx4
ns1 IN A xxx.xxx.xxx.xx4
ns2 IN A xxx.xxx.xxx.xx5
primary IN A xxx.xxx.xxx.xx4
secondary IN A xxx.xxx.xxx.xx5
mail IN A xxx.xxx.xxx.xx4
mail2 IN A xxx.xxx.xxx.xx5
www IN CNAME primary
pop3 IN CNAME primary
smtp IN CNAME primary

The /etc/named.conf on secondary is as fallows
acl ns { 127.0.0.1 ; xxx.xxx.xxx.xx4 ; xxx.xxx.xxx.xx5 ; } ;
options {
         directory "/var/named";
         query-source address * port 53;
         transfer-source * port 53;
         allow-transfer { ns ; } ;
};

### normal addin's for localhost
zone "secondary.mydomain.com" {
type slave;
file "shstars.com.zone" ;
masters {
xxx.xxx.xxx.xx4
};
};

And /var/named/shstars.com.zone is non-existant. It was there when I started and was removed when added slave.

Could you help me please. :o)
- JES
0
 
LVL 2

Author Comment

by:JesNoFear
ID: 8109187
YES IT WORKS!
Some minor adjustments and TIME, and talking to a few people. i got it to work!
thanks!
- JES
0
How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

 
LVL 2

Author Comment

by:JesNoFear
ID: 8124944
Now I have an error. Server 2 (Secondary) is denying e-mails. why is this?
here is the error message i get.
Mar 12 22:40:48 primary sendmail[12252]: h2D3emQ12252: from=<email@workdomain.com>, size=1118, class=0, nrcpts=1, msgid=<004601c2e912$2ece4b70$0602a8c0@mycomputername>, proto=ESMTP, daemon=MTA, mech=LOGIN, relay=h-xxx-xxx-xxx-242.XXXXXXXX.isp.net [xxx.xxx.xxx.242]
Mar 12 22:40:48 primary sendmail[12254]: h2D3emQ12252: to=<email@mydomain.com>, ctladdr=<email@workdomain.com> (503/504), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=31118, relay=mail2.domainname.com. [xxx.xxx.xxx.245], dsn=4.0.0, stat=Deferred: Connection refused by mail2.domainname.com.
0
 
LVL 3

Expert Comment

by:naccad
ID: 8125011
hmmm

server2 is not denying emails, the connection is refused
meaning that there is nothing listening on port 25 on the
external interface of that box.

either sendmail is not running or it is not bound to the
right interface.

in your sendmail.cf look for a line that looks like this

O DaemonPortOptions=Port=smtp, Name=MTA, Address=127.0.0.1

that line should either NOT have the Address=127.0.0.1
or you should have multiple lines easch with Address=
every ip address you want to recive emails.

tc
-nick
0
 
LVL 2

Author Comment

by:JesNoFear
ID: 8125480
ok, sendmail problem fix, now error with usernames,
----- The following addresses had permanent fatal errors -----
<jesnofeaer@mydomain.com>
    (reason: 550 5.1.1 <jesnofear@mydomain.com>... User unknown)
do the user account halfto exits on each server?

- JES
0
 
LVL 3

Expert Comment

by:naccad
ID: 8127495
NO
a backup mailserver should only RELAY emails to the primary.

hmmm
on the backup server do this:

sendmail -bt
> 3,0 jesnofear@mydomain.com


it SHOULD give you an output saying that it will send it
via smtp to the primany server

give it a try and tell me what goes

tc
-nick
0
 
LVL 2

Author Comment

by:JesNoFear
ID: 8127797
> 3,0 jesnofear@mydomain.com
canonify           input: jesnofear @ mydomain . com
Canonify2          input: jesnofear < @ mydomain . com >
Canonify2        returns: jesnofear < @ mydomain . com . >
canonify         returns: jesnofear < @  mydomain . com . >
parse              input: jesnofear < @ mydomain . com . >
Parse0             input: jesnofear < @ mydomain . com . >
Parse0           returns: jesnofear < @ mydomain . com . >
ParseLocal         input: jesnofear < @ mydomain . com . >
ParseLocal       returns: jesnofear < @ mydomain . com . >
Parse1             input: jesnofear < @ mydomain . com . >
Parse1           returns: $# local $: jesnofear
parse            returns: $# local $: jesnofear

This all ment nouthing to me. and E-mails are still being denyed.
0
 
LVL 3

Expert Comment

by:naccad
ID: 8128257
that means that sendmail is not reading the mailertable
or that you put "mydomain.com" in the local-host-names
files.

can you check those files?

your domain name should not be in local-host-names because
this is not the last hop for that domain, i.e. it is not
"local" to this machine

make sure there is that line in mailertable

mydomain.com    smtp:[primary.mydomain.com]

and the recreate the mailertable db as i mentioned in my
very 1st post.

another test to see if the mailertable is working:

sendmail -bt
> /map mailertable mydomain.com

it should return

map_lookup: mailertable (mydomain.com) returns smtp:[primary.domain.com] (0)

tc
-nick


0
 
LVL 2

Author Comment

by:JesNoFear
ID: 8128480
> /map mailertable mydomain.com
map_lookup: mailertable (mydomain.com) returns smtp:primary.mydomain.com (0)

That returned as you sayed.
I removed mydomain.com from local-host-names and rebuilt the mailertable db as instructed from your first post.
E-mails are still bouncing back saying user unknown.
here is the e-mail i get back.
The original message was received at Thu, 13 Mar 2003 10:22:36 -0500
from xx.xxxxxx.client.atlantech.net [xxx.xxx.xxx.xxx]

   ----- The following addresses had permanent fatal errors -----
<jesnofear@mydomain.com>
    (reason: 550 5.1.1 <jesnofear@mydomain.com>... User unknown)

   ----- Transcript of session follows -----
... while talking to mail2.mydomain.com.:
>>> RCPT To:<jesnofear@mydomain.com>
<<< 550 5.1.1 <jesnofear@mydomain.com>... User unknown
550 5.1.1 <jesnofear@mydomain.com>... User unknown
0
 
LVL 3

Expert Comment

by:naccad
ID: 8128816
ok, just to clear this off my chest

the brackets in the mailertable "[" are important, if you
just didnt type them in the post its ok. if they are not in
mailertable put them there.

im really at loss as what to say, i have this exact setup
working on 3 diff ISPs (i set them up personally, so I know
it works)

email me off EE to discuss this further.

tc
-nick
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question