[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: postfix can't send and receive mails



--- tôba <toba@tsepa.net> wrote:

> On Wed, 12 Nov 2008 14:57:54 +0800 (CST)
> Stephen Liu <satimis@yahoo.com> wrote:
> 
> > 
> > --- lee <lee@yun.yagibdah.de> wrote:
> > 
> > > On Tue, 11 Nov 2008 12:59:10 +0800 (CST)
> > > Stephen Liu <satimis@yahoo.com> wrote:
> > > 
> > > > Nov 11 02:41:55 xen05 postfix/smtpd[3445]: NOQUEUE: reject:
> RCPT
> > > from
> > > > unknown[121.34.170.57]: 554 5.7.1 <mail@satimis.com>: Relay
> access
> > > > denied; from=<mail@satimis.com> to=<mail@satimis.com>
> proto=ESMTP
> > > > helo=<57.170.34.121.broad.sz.gd.dynamic.163data.com.cn>
> > > > Nov 11 02:41:55 xen05 postfix/smtpd[3445]: lost connection
> after
> > > RCPT
> > > > from unknown[121.34.170.57]
> > > > Nov 11 02:41:55 xen05 postfix/smtpd[3445]: disconnect from
> > > > unknown[121.34.170.57]
> > > 
> > > > I have been googling a while without solution discovered.  The
> > > cause
> > > > is supposed to be no relay_domains defined.
> > > 
> > > > mysql> SELECT * from domains;
> > > > +------+-----------------------+-----------+---------+
> > > > | pkid | domain                | transport | enabled |
> > > > +------+-----------------------+-----------+---------+
> > > > |    1 | localhost             | virtual:  |       1 |
> > > > |    2 | localhost.localdomain | virtual:  |       1 |
> > > > |    3 | satimis.com.tld       | virtual:  |       1 |
> > > > +------+-----------------------+-----------+---------+
> > > > 3 rows in set (0.00 sec)
> > > > 
> > > > 
> > > > Whether it just needs "satimis.com" dropping
> > > ".tld"-top_level_domain ?
> > > 
> > > That seems about right. I don't know postfix, but it seems that
> > > postfix
> > > on <localhost> rejected to relay mail from <mail@satimis.com> to
> > > <mail@satimis.com> and dropped the SMTP connection after the
> > > recipient
> > > (RCPT) was transmitted because the domain satimis.com is not one
> of
> > > the
> > > domains you configured postfix to relay mail for.
> > 
> > 
> > Hi lee,
> > 
> > 
> > # grep relayhost /etc/postfix/main.cf
> > relayhost =
> > 
> > 
> > > <Localhost>, I guess, is xen05.satimis.com, though I didn't see
> > > where you allow postfix to handle mail for <localhost> other than
> in
> > > "mydestination". If you have several hosts in the domain
> satimis.com
> > > and
> > > want postfix to relay mail for them, you will need to configure
> > > postfix
> > > to do so.
> > > 
> > > What I don't understand is why localhost, localhost.localdomain
> and
> > > xen05.satimis.com are also listed as virtual mailbox domains:
> These
> > > domains are not virtual?
> > 
> > 
> > comment out that line 'mydestination';
> > 
> > 
> > # grep mydestination /etc/postfix/main.cf
> > #mydestination = xen05.satimis.com, localhost.satimis.com, ,
> localhost
> > 
> > 
> > Incoming mails are still rejected;
> 
> 
> Commenting mydestination was a bad idea.
> Insead of commenting, you should add satimis.com or replace
> xen05.satimis.com and localhos.satimis.com by satimis.com.
> Your log show relay access denied to mail@satimis.com. One of the
> causes is that satimis.com is not in mydestination.
> 
> relayhost is used if you want route all mail to a server (eg your
> FAI's
> server) and that server will route it to the mx. So, I suggest you to
> put your FAI smtp server if you have home connection and your server
> do
> not have a fqdn.
> 
> Hope it will help.


Hi Tôba,


I don't have FAI server here.


What I'm trying to build is a mail server running postfix virtual
having multiple domains.  Each domain has its own users.  This is a
test only enable me to learn how to build it.


This mail server is running as guest on a Xen box which is also for
testing purpose.  There are several guests built on this Xen box.  All
of them are mail servers, either working or not finished building yet. 
But they are not running without being started, just sitting there. 
They can be started running simultaneously.


What I'm trying to achieve is;

1)
to have several domains installed on this mail server, each domain
having its own users

2)
data of domains and their users are retain on maildb running on mysql 

3)
all outgoing/incoming mails are directed to /var/spool/mail/virtual/


# ls -l /var/spool/mail/virtual/
total 0

It is now empty.


Now I have only one domain 'satimis.com' added to the maildb and
several users created including 3 tables;


mysql> USE maildb;
mysql> show tables;
+------------------+
| Tables_in_maildb |
+------------------+
| aliases          |
| domains          |
| users            |
+------------------+



mysql> SELECT * from domains;
+------+-----------------------+-----------+---------+
| pkid | domain                | transport | enabled |
+------+-----------------------+-----------+---------+
|    1 | localhost             | virtual:  |       1 |
|    2 | localhost.localdomain | virtual:  |       1 |
|    3 | satimis.com.tld       | virtual:  |       1 |
+------+-----------------------+-----------+---------+


On users-table;

mysql> SELECT * from users;
+---------------------+---------+------+------+-------------------------+----------+---------+-----------------+------------+---------------+-------+------------+----------------+
| id                  | name    | uid  | gid  | home                   
| maildir  | enabled | change_password | clear      | crypt         |
quota | procmailrc | spamassassinrc |
+---------------------+---------+------+------+-------------------------+----------+---------+-----------------+------------+---------------+-------+------------+----------------+
| root@localhost      | root    | 5000 | 5000 | /var/spool/mail/virtual
| root/    |       1 |               1 | x05root    | sdtrusfX0Jj66 |  
    |            |                |
| satimis@satimis.com | Stephen | 5000 | 5000 | /var/spool/mail/virtual
| Stephen/ |       1 |               1 | x05satimis | sdtrusfX0Jj66 |  
    |            |                |
+---------------------+---------+------+------+-------------------------+----------+---------+-----------------+------------+---------------+-------+------------+----------------+
2 rows in set (0.00 sec)


User 'satimis' has been added with mails delivered to Stephen/ folder. 
I create the same manually.  However all incoming mails to
satimis@satimis.com are now delivered/added on /var/spool/mail/satimis
file.


If commenting out the line "mydestination = $myhostname,
localhost.$mydomain, localhost, satimis.com" on main.cf all incoming
mails are rejected.  Whether I have to create 
/var/spool/mail/virtual/Stephen manually.  The same won't be created
automatically on the arrival of the 1st incoming mail?


Regarding root account no root folder has been added on users-table. 
Is there any way adding it?  If YES what mysql command I have to run? 
Thanks.


On aliases-table;

mysql> SELECT * from aliases;
+------+----------------------------+--------------------------+---------+
| pkid | mail                       | destination              |
enabled |
+------+----------------------------+--------------------------+---------+
|    1 | postmaster@localhost       | root@localhost           |      
1 |
|    2 | sysadmin@localhost         | root@localhost           |      
1 |
|    3 | webmaster@localhost        | root@localhost           |      
1 |
|    4 | abuse@localhost            | root@localhost           |      
1 |
|    5 | root@localhost             | root@localhost           |      
1 |
|    6 | @localhost                 | root@localhost           |      
1 |
|    7 | @localhost.localdomain     | @localhost               |      
1 |
|    8 | @satimis.com.tld           | satimisowner@satimis.com |      
1 |
|    9 | postmaster@satimis.com.tld | postmaster@satimis.com   |      
1 |
|   10 | abuse@satimis.com.tld      | abuse@satimis.com        |      
1 |
|   11 | stephen@satimis.com        | soduer@satimis.com       |      
1 |
+------+----------------------------+--------------------------+---------+
11 rows in set (0.00 sec)



B.R.
Stephen

Send instant messages to your online friends http://uk.messenger.yahoo.com 


Reply to: