Re: Routing solution on mail servers with all domain pointing at the same externel IP

Stephen Liu <[email protected]>
Newsgroups gmane.mail.perdition.user
Message-ID <[email protected]>
--- Gustavo Luiz Duarte <[email protected]> wrote:


- snip -


> >> No need for stopping you MySQL.
> >>
> >> If everything is wright (I haven't tested, I can have skipped
> >> something), you can point your mail clients to the hostname where
> >> perdition is installed and use it normally.
> >
> >
> > Sorry I can't resolve how can the mail client (Evolution) find its
> > server over Internet with following settings;
> 
> The mail client doesn't know wich server to use. It always use the
> routing server. The routing server redirects it to the correct imap
> server. Make sure your are using the right protocol imap4 or imap4s.


Noted with thanks.


- snip -


> >> Note that perdition's default protocol is pop3. To use imap suply
> the
> >> option -P IMAP4
> >
> >
> > xen11:~# /etc/init.d/perdition start
> > /usr/sbin/perdition.pop3 already running.
> > Starting /usr/sbin/perdition.pop3s...
> > Starting /usr/sbin/perdition.imap4...
> > Starting /usr/sbin/perdition.imaps...
> 
> How are you configuring perdition? Have you modified your
> /etc/init.d/perdition script to contain the correct parameters?


No, only configure /etc/default/perdition
RUN_PERDITION=yes
POP3=yes
POP3S=yes
IMAP4=yes
IMAP4S=yes


> > xen11:~# hostname
> > xen11.satimis.com
> >
> >
> > pop3 is already running.  I have to manually run
> /etc/init.d/perdition
> > to start pop3s, imap4 and imaps
> >
> >
> >> You can use nc to test it:
> >> $ echo "tag login username password" | nc perdition_host 143
> >> In username and password you use valid username and password for
> your
> >> real imap server.
> >
> >
> > I suppose running above command on the routing mail server where
> > perdition is installed.
> >
> >
> > # echo "tag login satimis mypassword" | nc xen11.satimis.com 143
> > * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE
> > THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5
> > AUTH=CRAM-SHA1 IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready.
> > Copyright 1998-2005 Double Precision, Inc.  See COPYING
> fordistribution
> > information.
> > tag NO Login failed.
> >
> >
> >> For pop3:
> >> $ echo -e "user username\npass password | nc perdition_host 110
> >
> > xen11:~# echo -e "user satimis\npass x11satimis | nc
> xen11.satimis.com
> > 110
> >>
> > waiting for input
> 
> You can look at perdition logs to find information about what is
> going on.


On the routing server;

xen11:~# cat /var/log/mail.log | grep perdition
.......
.......
Dec  3 16:31:22 xen11 perdition[3138]: version=1.17, add_domain="",
authenticate_in=off, bind_address="", capability="IMAP4 IMAP4REV1",
client_server_specification=off,
config_file="/etc/perdition/perdition.conf", connection_limit=0,
connection_logging=off, connect_relog=300, debug=off,
domain_delimiter="@", explicit_domain="", group="nogroup",
inetd_mode=off, listen_port="143", log_facility="mail",
login_disabled=off, lower_case="",
map_library="/usr/lib/libperditiondb_gdbm.so.0", map_library_opt="",
no_bind_banner=off, no_daemon=off, no_lookup=off,
nodename="xen11.satimis.com", ok_line="You are so in",
outgoing_port="143", outgoing_server="",
pid_file="/var/run/perdition.imap4/perdition.imap4.pid",
protocol="IMAP4", server_resp_line=off, strip_domain="", timeout=1800,
username="nobody", username_from_database=off, query_key="", quiet=off,
ssl_mode="", ssl_ca_file="",
ssl_ca_path="/etc/perdition/perdition.ca/",
ssl_ca_accept_self_signed="off",
ssl_cert_file="/etc/perdition/perdition.crt.pem", ssl_cert_accept
Dec  3 16:31:22 xen11 perdition[3138]: Fatal error listening for
connections. Exiting.
Dec  3 16:31:22 xen11 perdition[3135]: Error loading certificate chain
file "/etc/perdition/perdition.crt.pem"
Dec  3 16:31:22 xen11 perdition[3135]: Fatal error establishing SSL
context for listening
Dec  3 16:31:22 xen11 perdition[3141]: Error loading certificate chain
file "/etc/perdition/perdition.crt.pem"
Dec  3 16:31:22 xen11 perdition[3141]: Fatal error establishing SSL
context for listening
Dec  3 16:41:47 xen11 imapd: LOGIN: ip=[::ffff:220.232.213.178],
username=perdition
Dec  3 16:41:47 xen11 imapd: LOGIN: ip=[::ffff:220.232.213.178],
password=perdition
Dec  3 16:41:47 xen11 authdaemond: SQL query: SELECT id, "", clear,
uid, gid, home, concat(home,'/',maildir), "", name, "" FROM users WHERE
id = "perdition" AND (enabled=1)
Dec  3 16:41:47 xen11 imapd: LOGIN FAILED, user=perdition,
ip=[::ffff:220.232.213.178]
Dec  3 16:42:08 xen11 imapd: LOGIN: ip=[::ffff:220.232.213.178],
username=perdition
Dec  3 16:42:08 xen11 imapd: LOGIN FAILED, user=perdition,
ip=[::ffff:220.232.213.178]
* end *



Tried again


Evolution -> Preference -> Receiving mail


IMAP4rev1


1)
Test-1:-
Server: x11.satimis.com (the routing mail server)
Username: [email protected]


Remark: 
satimis is the user of;
mail server : xen10.satimis.com (hostname/servername)
mail server : xen08.satimis.changeip.net (hostname/servername)
mail server : xen09.satimis.dnsalias.com (hostname/servername)
the routing mail server: x11.satimis.com (hostname/servername)


Login with password.  Fail.

Evolution Error:
Error while Scanning folders in "IMAP server xen11.satimis.com".
IMAP4 server xen11.satimis.com unexpectedly disconnected: Invalid
argument


On the routing mail server
# tail /var/log/mail.log
Dec  3 14:08:33 xen11 imapd: LOGIN: ip=[::ffff:192.168.0.110],
[email protected]
Dec  3 14:08:33 xen11 imapd: LOGIN: ip=[::ffff:192.168.0.110],
password=mypasswd_1
Dec  3 14:08:33 xen11 authdaemond: received auth request, service=imap,
authtype=login
Dec  3 14:08:33 xen11 authdaemond: authmysql: trying this module
Dec  3 14:08:33 xen11 authdaemond: SQL query: SELECT id, "", clear,
uid, gid, home, concat(home,'/',maildir), "", name, "" FROM users WHERE
id = "[email protected]" AND (enabled=1)
Dec  3 14:08:33 xen11 authdaemond: zero rows returned
Dec  3 14:08:33 xen11 authdaemond: no password available to compare
Dec  3 14:08:33 xen11 authdaemond: authmysql: REJECT - try next module
Dec  3 14:08:33 xen11 authdaemond: FAIL, all modules rejected
Dec  3 14:08:33 xen11 imapd: LOGIN FAILED,
[email protected], ip=[::ffff:192.168.0.110]


2)
Test-2:-
Server: x11.satimis.com (the routing mail server)
Username: satimis

Fail.  Warning
Error while Scanning folders in "IMAP server xen11.satimis.com"


On the routing mail server
xen11:~# tail /var/log/mail.log
Dec  3 13:55:34 xen11 imapd: LOGIN: ip=[::ffff:192.168.0.110],
username=satimis
Dec  3 13:55:34 xen11 imapd: LOGIN: ip=[::ffff:192.168.0.110],
password=mypasswd_2
Dec  3 13:55:34 xen11 authdaemond: received auth request, service=imap,
authtype=login
Dec  3 13:55:34 xen11 authdaemond: authmysql: trying this module
Dec  3 13:55:34 xen11 authdaemond: SQL query: SELECT id, "", clear,
uid, gid, home, concat(home,'/',maildir), "", name, "" FROM users WHERE
id = "satimis" AND (enabled=1)
Dec  3 13:55:34 xen11 authdaemond: zero rows returned
Dec  3 13:55:34 xen11 authdaemond: no password available to compare
Dec  3 13:55:34 xen11 authdaemond: authmysql: REJECT - try next module
Dec  3 13:55:34 xen11 authdaemond: FAIL, all modules rejected
Dec  3 13:55:34 xen11 imapd: LOGIN FAILED, user=satimis,
ip=[::ffff:192.168.0.110]


Still fail.


B.R.
Stephen L








> >> No special configuration is need for your pop/imap servers. Just
> >> assure that they are listening on standard ports.
> >
> >
> > I have only ONE external IP.  All ports are forwarded to the
> routing
> > mail server except port 53.
> >
> >
> > B.R.
> > Stephen L
> >
> >
> >
> >> []'s
> >> Gustavo Duarte
> >>
> >> >
> >> >
> >> > B.R.
> >> > Stephen
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >>
> >> >> USING MYSQL:
> >> >> You have some alternatives:
> >> >> 1. Continue with your tblPerdition and populate it, so that
> user
> >> >> column has the domain, hostname column has the localIP and port
> >> >> column
> >> >> you leave empty (supposing your real pop/imap servers listen to
> >> >> standard ports).
> >> >>
> >> >> Then you would do (supposing you have mysql perdition library
> in
> >> >> /usr/lib):
> >> >>
> >> >> perdition -M /usr/lib/libperditiondb_mysql.so.0 --query_key
> "\d"
> >> -m
> >> >>
> "<dbhost>:<dbport>:dbPerdition:tblPerdition:perdition:perdition"
> >> >>
> >> >> (substituting <dbhost> and <dbport> by you db hostname and
> port)
> >> >>
> >> >>
> >> >> 2. Modify your transport table so that the string smtp and
> localIP
> >> >> are
> >> >> in diferent columns. Then you create a view concatenating them
> for
> >> >> the
> >> >> postfix query. A bit more complicated but easier to maintain
> when
> >> you
> >> >> have lots of domains and servers.
> >> >>
> >> >> []'s
> >> >> Gustavo Duarte
> >> >>
> >> >> On Wed, Dec 3, 2008 at 02:28, Stephen Liu <[email protected]>
> >> wrote:
> >> >> > Hi Gustavo,
> >> >> >
> >> >> >
> >> >> >> The URL I sent you has information about using mysql as
> lookup
> >> >> >> library:
> >> >> >> http://www.vergenet.net/linux/perdition/perditiondb.5.shtml
> >> >> >
> >> >> >
> >> >> > I suppose you're referring to following section;
> >> >> >
> >> >> >
> >> >> > MYSQL
> >> >> > This map library can be used by specifying the full path to
> the
> >> >> library
> >> >> > using the -M|--map_library command line option or
> configuration
> >> >> file
> >> >> > option.
> >> >> >
> >> >> > E.g.
> >> >> > perdition -M /usr/lib/libperditiondb_mysql.so.0
> >> >> > ......
> >> >> >
> >> >> >
> >> >> > I'll start from there.
> >> >> >
> >> >> >
> >> >> > I suppose the name of this database is "dbPerdition" to be
> >> created
> >> >> on
> >> >> > MySQL
> >> >> >
> >> >> >
> >> >> > mysql> create database dbPerdition;
> >> >> >
> >> >> >
> >> >> > mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
> >> >> >    -> ON dbPerdition.* TO 'perdition' IDENTIFIED by
> 'perdition';
> >> >> >
> >> >> > the 1st "perdition" on above second line is "database user".
> >> The
> >> >> 2nd
> >> >> > "perdition" is "database password".
> >> >> >
> >> >> >
> >> >> > mysql> CREATE TABLE `tblPerdition` (
> >> >> >    -> `user` varchar(128), null '' default '',
> >> >> >    -> `servername` varchar(255) null '' default '',
> >> >> >    -> `port` varchar(8) YES NULL,
> >> >> >    -> PRIMARY KEY (`user`),
> >> >> >    -> ) ;
> >> >> >
> >> >> >
> >> >> > Afterwards I'll edit data on 'tblPerdition" table.
> >> >> >
> >> >> >
> >> >> >> The table you've shown doesn't have information about the
> >> >> >> hostnames/localIPs. Where is it? In the transport table?
> >> >> >
> >> >> >
> >> >> > Yes.
> >> >> >
> >> >> > mysql> SELECT * from transport;
> >> >> >
> >> >>
> >> >
> >>
> >
>
+------+----------------------+--------------------+-----------+---------+
> >> >> > | pkid | domain               | hostname           |
> transport |
> >> >> > enabled |
> >> >> >
> >> >>
> >> >
> >>
> >
>
+------+----------------------+--------------------+-----------+---------+
> >> >> > |    1 | satimis.dnsalias.com | smtp:192.168.0.209 | :[]     
>  |
> >> >> > 1 |
> >> >> > |    2 | satimis.changeip.net | smtp:192.168.0.208 | :[]     
>  |
> >> >> > 1 |
> >> >> > |    3 | satimis.com          | smtp:192.168.0.210 | :[]     
>  |
> >> >> > 1 |
> >> >> >
> >> >>
> >> >
> >>
> >
>
+------+----------------------+--------------------+-----------+---------+
> >> >> > 3 rows in set (0.00 sec)
> >> >> >
> >> >> >
> >> >> > # cat /etc/postfix/mysql_transport_maps.cf
> >> >> > user=mail
> >> >> > password=mypassword
> >> >> > dbname=maildb
> >> >> > table=transport
> >> >> > select_field=hostname
> >> >> > where_field=domain
> >> >> > hosts=127.0.0.1
> >> >> > additional_conditions = and enabled = 1
> >> >> > * end *
> >> >> >
> >> >> >
> >> >> >> I've never used mysql to do it, so I don't know  the details
> >> and
> >> >> how
> >> >> >> flexible it is. Maybe you'll need to create a view in your
> >> >> database
> >> >> >> for the perdition lookup with the domain as key and the
> localIP
> >> as
> >> >> >> value.
> >> >> >>
> >> >> >> Unfortunately I don't have any example. But the two URLs I
> sent
> >> >> you
> >> >> >> have all information you need. In particular, look at
> >> --query_key
> >> >> >> option and mysql database access library.
> >> >> >
> >> >> >
> >> >> > Whether you meant "--query_key FORMAT[,FORMAT...]:" on;
> >> >> >
> >> >> > http://www.vergenet.net/linux/perdition/perdition.8.shtml
> >> >> >
> >> >> >
> >> >> > Thanks
> >> >> >
> >> >> >
> >> >> > B.R.
> >> >> > Stephen L
> >> >> >
> >> >> > Send instant messages to your online friends
> >> >> http://uk.messenger.yahoo.com
> >> >> > ______________________________________________
> >> >> > Perdition-users mailing list
> >> >> > [email protected]
> >> >> > http://lists.vergenet.net/listinfo/perdition-users
> >> >> >
> >> >>
> >> >
> >> >
> >> > Send instant messages to your online friends
> >> http://uk.messenger.yahoo.com
> >> > ______________________________________________
> >> > Perdition-users mailing list
> >> > [email protected]
> >> > http://lists.vergenet.net/listinfo/perdition-users
> >> >
> >>
> >
> >
> > Send instant messages to your online friends
> http://uk.messenger.yahoo.com
> > ______________________________________________
> > Perdition-users mailing list
> > [email protected]
> > http://lists.vergenet.net/listinfo/perdition-users
> >
> 


Send instant messages to your online friends http://uk.messenger.yahoo.com 
______________________________________________
Perdition-users mailing list
[email protected]
http://lists.vergenet.net/listinfo/perdition-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.