LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-20-2014, 02:19 PM   #1
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Rep: Reputation: Disabled
Postfix setup


I am completely new to using postfix and can't figure out what to do to fix my problem by reading the manual. I tested my postfix mail server by sending some test mails:

[Reply from my helpful host site: some users don't exist and the tester.inwtx.net is not configured:]

rcpt to: key@inwtx.net
550 5.1.1 key@inwtx.net: Recipient address rejected: User unknown in local recipient table
rcpt to: tester@info.inwtx.net
554 5.7.1 tester@info.inwtx.net: Relay access denied
rcpt to: tester@info.inwtx.net
554 5.7.1 tester@info.inwtx.net: Relay access denied

rcpt to: root@inwtx.net
250 2.1.5 Ok


All mail goes into the same mailbox called mbox.

As far as I can see, root@inwtx.net is the only test mail that made it through. Through deduction, it seems that I have to setup postfix to accept info.inwtx.net somewhere. Should this also be in the 'mydestination =' line?

Secondly, it seems like I have to place 'Recipient address' somewhere to keep them from rejecting (key in key@inwtx.net).

Can someone point me to the right files/parameters for this?
Thanks.

Last edited by battles; 04-21-2014 at 05:33 AM.
 
Old 04-22-2014, 12:58 AM   #2
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 31
First I would recommend to check you relay_domains settings.
 
Old 04-22-2014, 06:05 AM   #3
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
To answer my own question

The postfix manual is quite technical and if you don't already know a lot about mail systems, you can get lost easily. Examples on the web are sparse. This is what I discovered through experimentation:

In the /etc/postfix/main.cf file:
1. The myhostname line must be changed to 'myhostname = mail.yourFQDN.net' or whatever name you gave your MX record.
2. The mydestination line must be changed to 'mydestination = yourFQDN.net, localhost, localhost.localdomain, localhost, info.yourFQDN.net'

Any email name you intend to allow your system to service must have the email name placed into the /etc/aliases file:
name1: root
name2: root

Now mail to name1.yourFQDN.net and name1.info.yourFQDN.net will be accepted and accessible on your system. A name3 to both yourFQDN.net, info.yourFQDN.net, and wrong.yourFQDN.net will be bounced back to the sender.

The problem I was having was because I wasn't doing the following commands after the above mods:

sudo cp /etc/aliases /etc/postfix/aliases
sudo postalias /etc/aliases
sudo postalias /etc/postfix/aliases
sudo postfix upgrade-configuration
sudo postfix reload
 
Old 04-22-2014, 07:55 AM   #4
Rawcous
Member
 
Registered: Jan 2014
Location: Farnborough, Hampshire - UK
Distribution: SCO UNIX -> Fedora (Core) -> CentOS -> RedHat
Posts: 128

Rep: Reputation: 48
Hello Battles,

1. root@inwtx.net - worked because it is a valid user account.
2. key@inwtx.net - failed because I am guessing user account key does not exist locally on your mail server.
3. What is the reason for using @info.inwtx.net as part of the domain rather simply inwtx.net? Thus surely you should be using tester@inwtx.net rather than tester@info.inwtx.net


Because relaying works for local user account root this would suggest to me that your config as it stands is correct....
Simply ensure that you create local user account "key" and this should work also....

Using Sendmail rather than Postfix here I could be wrong but -

Quote:
Any email name you intend to allow your system to service must have the email name placed into the /etc/aliases file:
name1: root
name2: root
Entries should only need to be placed in the /etc/aliases file if you are using "virtual" accounts or you wish mail from one account to be redirected to another, therefore in theory you should not need to include an entry in the aliases file for every active account receiving mail.


Regards,

Rawcous!
 
Old 04-22-2014, 08:09 AM   #5
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
Needed

Thanks for the reply. I really am not sure if what I am doing is correct, but if the name1 is not in /etc/aliases, a mail to name1 is rejected and bounced back to my ISP. The name1 possibly needs to be put elsewhere, but I don't know where else to put it to get it to work.

Rereading you post, "ensure that you create local user account "key" and this should work also" is interesting. I will try that. Shows my unfamiliarity with linux. What I was going to try to do was get the mail over to user key by putting 'key: key' in the aliases file. This is because I am going to have to point several key type names to a single user.

Last edited by battles; 04-22-2014 at 08:11 AM.
 
Old 04-22-2014, 08:40 AM   #6
Rawcous
Member
 
Registered: Jan 2014
Location: Farnborough, Hampshire - UK
Distribution: SCO UNIX -> Fedora (Core) -> CentOS -> RedHat
Posts: 128

Rep: Reputation: 48
Battles,

It looks like our "setups" differ slightly. I completely host my domain at home complete with mailserver (thus any emails addressed to my domain are sent directly to my mailserver without going through a specific ISP) whereas it appears that you are using a postfix mailserver to download mail from user accounts hosted by your ISP (hope I have explained the difference clearly enough..), so perhaps in your case maybe an entry is required in your aliases file - however as mentioned previously the alias file is typically used for "virtual" accounts and mail redirection i.e. postmaster -> root

When running "sendmail" having made amendments to the aliases file the "newaliases" command needs to be executed to rebuild the index - a quick check reveals that the "postalias" command also does the same.

The reason mail is not bounced back to the ISP if an entry exists in the alias file is that you are possibly redirecting that email to another account. If you wish user "key" to be able to read the email specifically addressed to them (rather than it being sent to root) you will need to create a local account.

I still recommend creating the accounts locally on your postfix server and making the amendment as per my previous post - point.3

Rawcous!
 
Old 04-22-2014, 08:52 AM   #7
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
"you are using a postfix mailserver to download mail from user accounts hosted by your ISP"

No, my server is at DigitalOcean and everything is being done there.

The way I am going to try to handle incoming mail is to create a user called 'mainin'. Then mainin needs to get certain mail, such as bob@inwtx.net, jane@inwtx.net, etc. The only thing I know to do (and haven't tried yet) is to make entries into the root aliases file as:

bob: mainin
jane: mainin

This, I hope, will direct mail to them in their user account 'mainin'. I don't want or need to set up users for everyone. Does this make sense? Any other suggestions on setting this up differently?

Thanks.
 
Old 04-22-2014, 09:01 AM   #8
Rawcous
Member
 
Registered: Jan 2014
Location: Farnborough, Hampshire - UK
Distribution: SCO UNIX -> Fedora (Core) -> CentOS -> RedHat
Posts: 128

Rep: Reputation: 48
Battles,

Quote:
The way I am going to try to handle incoming mail is to create a user called 'mainin'. Then mainin needs to get certain mail, such as bob@inwtx.net, jane@inwtx.net, etc. The only thing I know to do (and haven't tried yet) is to make entries into the root aliases file as:

bob: mainin
jane: mainin
That should do it. Just remember that when user "mainin" receives the mail:

1. The mail will appear in "mainin's" mailbox BUT addressed to bob, jane,.....
2. If mainin attempts to reply to email addressed to bob, jane,... because these are aliased / virtual accounts then they will appear as if they have been sent from the "mainin" account.

Rawcous!

Last edited by Rawcous; 04-23-2014 at 08:18 AM. Reason: Rookie error on point 2... :(
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix setup help - smoothwall fedora postfix godaddy crecker Linux - Newbie 2 01-10-2009 12:06 AM
How to setup postfix cosmosedat Linux - Software 18 07-27-2006 08:58 AM
Postfix setup help Charles Daniel Linux - Security 4 10-31-2004 12:24 PM
Postfix setup vladimir-dk Linux - Newbie 9 04-20-2004 08:56 PM
Postfix Setup Help shaggystyle Linux - Networking 1 12-22-2003 01:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration