setup sendmail

Discuss Applications

Postby Void Main » Thu May 31, 2007 3:30 pm

Basher52 wrote:
Void Main wrote:No, log in as basher52 and use any mail program (mail, pine, evolution, etc). The actual mbox file containing the incoming mail would be named /var/spool/mail/basher52.


and by this you mean that I can use the command 'mail' as I used to do for checking mails for root, like the logwatch and such?
The other ones you're talkng about, pine evolution I don't have installed


You can use the "mail" command, but understand that root and basher52 are two different accounts. If you wanted to check basher52's mail you would have to either be logged in as basher52 or if you are logged in as root you would execute mail with "mail -u basher52". I never log in as root personally. In fact I redirect all of root's mail to my voidmain account. You can do that by putting this in the /etc/aliases file:

Code: Select all
root:    basher52


and then running the "newaliases" command. I never log in as root.

btw.. what did you change in the files I download, I just saw some minor things, but that can't be it now can it?


The biggest thing was to comment out the line that causes it to only bind to your loopback (127.0.0.1) adapter as I said needed to be done back on the very first post. If you don't do that you have absolutely no chance of getting mail from outside of your machine. I think I also changed your "MASQUERADE" settings. At any rate it's nearly identical to mine but I only made like 2 or 3 changes total. It definitely should work right now though.

EDIT: I still can't "telnet ddp.servehttp.com 25" which means mail will not get through. Is the IP address on your ethernet interface on your server currently 82.196.123.118?

Code: Select all
/sbin/ifconfig


Sendmail is listening on port 25?

Code: Select all
# netstat -anp | grep :25


iptables is not blocking it?

Code: Select all
# iptables -L


It's not behind a firewall?
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Thu May 31, 2007 4:09 pm

Void Main wrote:...but understand that root and basher52 are two different accounts....


This I do know :)

Void Main wrote:...redirect all of root's mail to my xxx account. You can do that by putting this in the /etc/aliases file:

Code: Select all
root:    basher52


and then running the "newaliases" command.


I know I read this somewhere and was thinking of using it, but didn't care much about it since I can't even get it to work at all



Void Main wrote:Is the IP address on your ethernet interface on your server currently 82.196.123.118?

Yes

Code: Select all
eth0      Link encap:Ethernet  HWaddr 00:60:08:28:3A:FA 
          inet addr:82.196.123.118  Bcast:82.196.123.255  Mask:255.255.254.0
          inet6 addr: fe80::260:8ff:fe28:3afa/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:473857 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4665 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35841570 (34.1 MiB)  TX bytes:796885 (778.2 KiB)
          Interrupt:169 Base address:0xec00



Void Main wrote:Sendmail is listening on port 25?

Code: Select all
# netstat -anp | grep :25



Yes

Code: Select all
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      11793/sendmail: acc


iptables is not blocking it?

Nope, when I couldn't telnet from work I even removed everything in the iptables script just to be sure and later when I found the problem from wifes client and that worked, I added the iptables script again and it still worked, here's the lines of the script:

Code: Select all
#       Chain: SENDMAIL
iptables -N SENDMAIL
iptables -t filter -A INPUT -i eth0 -p tcp --dport 25 -j SENDMAIL
#iptables -A SENDMAIL -j ULOG  --ulog-nlgroup 1 --ulog-prefix "SENDMAIL - OK "  --ulog-qthreshold 1
iptables -t filter -A SENDMAIL -j ACCEPT



Void Main wrote:It's not behind a firewall?


Nope, eth0 is connected straight out
I even ripped out the cable to eth1 which is a LAN NIC, even though I ifdown'd it. Just to be sure I tested it again and I can still telnet to port 25.

btw.. As wifeys firewall blockes the attempt to telnet into the server, I was thinking... does yours too?
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Thu May 31, 2007 4:56 pm

Basher52 wrote:btw.. As wifeys firewall blockes the attempt to telnet into the server, I was thinking... does yours too?


Nope, I don't run that Windows garbage. :) If I couldn't telnet to your port 25 (which I can't) then I couldn't send you email (which I can't). In fact my mail servers wouldn't be able to send any mail (which they can). I can telnet to port 25 on every other SMTP server out there. So if it's not at your side and your server has a default route set and has no problem connecting to other resources on the internet then your service provider must be blocking port 25. According to what you have shown me everything looks good. The only other thing I can suggest is just to rule out iptables you could temporarily turn it off to test (service iptables stop). I can't even ping your address. I'm really starting to believe it is an iptables issue on your side though. This is what I get when I nmap you:

Code: Select all
$ nmap -P0 ddp.servehttp.com

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2007-05-31 17:53 CDT
Interesting ports on v-603-kalfb-23-10-118.bitnet.nu (82.196.123.118):
Not shown: 1679 filtered ports
PORT    STATE  SERVICE
113/tcp closed auth

Nmap finished: 1 IP address (1 host up) scanned in 56.566 seconds


It does see the auth port and that port only. If it's not an iptables issue then it's definitely your provider blocking port 25 and you'll be out of luck until you move the server to a provder that doesn't block, or call your provider and ask them what your options are.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Sun Jun 03, 2007 1:16 pm

Now I've installed CentOS 4.4 and it works :)
I have no idea why you couldn't telnet to the server before, but now it must work since I'm getting old mail that I tested some days ago, but I have'nt got yours yet.

I've installed dovecot and I can connect to it and I see all mail I've got sofarm but trying to send through the mailclient won't work, this is what I get:


The message could not be sent because one of the recipients was rejected by the server.
The rejected e-mail address was 'xx.xx@xx.se'.
Subject 'test', Account: 'ddp.servehttp.com',
Server: 'ddp.servehttp.com',
Protocol: SMTP, Server Response: '550 5.7.1 <xx.xx@xx.se>...
Relaying denied', Port: 25, Secure(SSL): No, Server Error: 550,
Error Number: 0x800CCC79

And then there is the thing with setting up SSL in dovecot for the mail too and I think I need help with that too cos there are way to many paramters for me to understand :P
The dovecot version I got when I installed it is Dovecot 1.0
I got this through yum
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Sun Jun 03, 2007 7:31 pm

Basher52 wrote:Now I've installed CentOS 4.4 and it works :)
I have no idea why you couldn't telnet to the server before, but now it must work since I'm getting old mail that I tested some days ago, but I have'nt got yours yet.


Eggsellent...

I've installed dovecot and I can connect to it and I see all mail I've got sofarm but trying to send through the mailclient won't work, this is what I get:

The message could not be sent because one of the recipients was rejected by the server.
The rejected e-mail address was 'xx.xx@xx.se'.
Subject 'test', Account: 'ddp.servehttp.com',
Server: 'ddp.servehttp.com',
Protocol: SMTP, Server Response: '550 5.7.1 <xx.xx@xx.se>...
Relaying denied', Port: 25, Secure(SSL): No, Server Error: 550,
Error Number: 0x800CCC79


Yes, this is actually good. Allowing relaying by just anyone is not good. Your server is expecting mail that is sent through it to be from someone@ddp.servehttp.com. You can allow mail to be sent from other domains and from specific addresses and networks by adding entries in your /etc/mail/access file. After you modify this you'll want to restart sendmail for it to take effect. Be carefull that you do not allow relaying by just anyone or you'll have spammers bouncing mail off of your server in no time flat.

What I do is add my internal network ranges that I will sending mail from. Allow entries might look like this:

Code: Select all
localhost.localdomain           RELAY
localhost                       RELAY
127.0.0.1                       RELAY
192.168.0                       RELAY
192.168.2                       RELAY
172.16.1                      RELAY


As you can guess the server will allow mail being sent through it from itself and 3 other networks. You can also add specific reject messages in there:

Code: Select all
# Spammers
#xx.xx.xx               550 We do not accept mail from spammers
205.158.154             550 We do not accept mail from spammers
205.158.155             550 We do not accept mail from spammers


And then there is the thing with setting up SSL in dovecot for the mail too and I think I need help with that too cos there are way to many paramters for me to understand :P
The dovecot version I got when I installed it is Dovecot 1.0
I got this through yum


To be honest with you it shouldn't need any configuring at all. I use secure pop and imap on my server running dovecot. The only thing you might want to do is change your certificate but it should work just fine with the included default certificate. iptables could be preventing you from connecting to the secure pop and imap ports or your client may not be configured properly. Make sure ports 110 and 995 are open for pop3 and pop3s and ports 143 and 993 for imap and imaps. You should be able to telnet to those ports like you did port 25 to test sendmail.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Sun Jun 03, 2007 11:35 pm

relaying..DOH i should have thought of that.

and about the SSL, I made some changes in the conf for dovecot.
just to be able to connect to the server through a client.
alot of the config's was remarked, but you think I should have changed anything? Think I'll try that later.

and what should I use, POP3 or IMAP?
which one is better?
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Mon Jun 04, 2007 8:30 am

Basher52 wrote:and about the SSL, I made some changes in the conf for dovecot. just to be able to connect to the server through a client.
alot of the config's was remarked, but you think I should have changed anything? Think I'll try that later.


Like I said, I didn't have to change anything in the default config, I would think CentOS would have the same defaults.

and what should I use, POP3 or IMAP?
which one is better?


Neither one is better, they are two different protocols providing two different sets of functionality. I prefer IMAP personally because all my mail and mail folders are stored on the server and accessible by the mail client. I can connect from anywhere using any client and have access to my mail folders. With pop you usually just download the mail to your local machine and optionally leave a copy on the server. Your mail folders would reside locally. So, you only have access to that saved mail from that one local machine (unless you leave a copy on the server).
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Calum » Mon Jun 04, 2007 9:59 am

my 2 pence worth: i don't like pop all that much, because if you access your mail on more than one machine you'll inevitably end up with a client that downloads some mail and then automatically deletes it from the server before you remember to do anything to stop it. On the other hand i prefer it to webmail, which is what my ISP replaced their pop3 service with a year or so ago. On the other hand, with their webmail it stays on the server till i delete it, which is a bonus.

I haven't used IMAP but i suspect it has the best features of both pop and webmail.
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby Basher52 » Mon Jun 04, 2007 4:00 pm

I can get pop3 to work, but not pop3s, imap or imaps
with pop3s i get this:
Code: Select all
The connection to the server has failed. Account: 'ddp.servehttp.com', Server: 'ddp.servehttp.com', Protocol: POP3, Port: 995, Secure(SSL): Yes, Socket Error: 10061, Error Number: 0x800CCC0E


with imap i get this:
Code: Select all
Configuration:
   Account: ddp.servehttp.com
   Server: ddp.servehttp.com
   User name: basher52
   Protocol: IMAP
   Port: 143
   Secure(SSL): 0
   Code: 800ccc0e


and with imaps i get this:

Code: Select all
Configuration:
   Account: ddp.servehttp.com
   Server: ddp.servehttp.com
   User name: basher52
   Protocol: IMAP
   Port: 993
   Secure(SSL): 1
   Code: 800ccc0e


since I'm now using CentOS 4(.4) I can now use ulogd and with this I see that the posts are open.
[/code]

UPDATE: I fonally found the problem myself :)
It's no-ip that only give pop3 for free otherwise you'll have to pay up
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Mon Jun 04, 2007 4:44 pm

Basher52 wrote:UPDATE: I fonally found the problem myself :)
It's no-ip that only give pop3 for free otherwise you'll have to pay up


Huh? I thought you wanted to do pop/imap on *your* server. no-ip has absolutely no control over *your* server. You should have no problem doing what you want to do. What email client are you using and what settings are you giving it?
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Mon Jun 04, 2007 4:48 pm

The result I showed here was thruogh ... YUK... OutlookXpress.
I reinstalled dovecot and this time I didn't do any changes in the conf
The setting I can't remember right now, but I guess they were "normal" :P
to get thing working... I'll have to check more later
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Basher52 » Wed Jun 06, 2007 10:46 am

The imap setting I tried both the home directory and the mail/.imap/INBOX
but they both give the same error

Code: Select all
[basher52@ddp ~]$ ls -al
drwx------  14 basher52 basher52 4096 Jun  3 20:56 .
drwxr-xr-x   3 root     root     4096 Jun  2 00:29 ..
-rw-------   1 basher52 basher52    0 Jun  2 00:30 .autorun.lck
-rw-------   1 basher52 basher52  739 Jun  5 00:38 .bash_history
-rw-r--r--   1 basher52 basher52   24 Jun  2 00:29 .bash_logout
-rw-r--r--   1 basher52 basher52  191 Jun  2 00:29 .bash_profile
-rw-r--r--   1 basher52 basher52  124 Jun  2 00:29 .bashrc
drwx------   3 basher52 basher52 4096 Jun  2 00:30 Desktop
-rw-------   1 basher52 basher52   22 Jun  2 00:29 .dmrc
drwxr-x---   2 basher52 basher52 4096 Jun  2 00:30 .eggcups
-rw-r--r--   1 basher52 basher52  383 Jun  2 00:29 .emacs
drwx------   2 basher52 basher52 4096 Jun  2 00:30 .gconf
drwx------   2 basher52 basher52 4096 Jun  2 01:34 .gconfd
drwx------   2 basher52 basher52 4096 Jun  2 00:30 .gnome
drwx------   3 basher52 basher52 4096 Jun  2 00:30 .gnome2
drwx------   2 basher52 basher52 4096 Jun  2 00:30 .gnome2_private
-rw-r--r--   1 basher52 basher52  120 Jun  2 00:29 .gtkrc
-rw-------   1 basher52 basher52    0 Jun  2 01:34 .ICEauthority
drwxr-xr-x   4 basher52 basher52 4096 Jun  2 00:29 .kde
drwx------   3 basher52 basher52 4096 Jun  3 20:56 mail
-rw-------   1 basher52 basher52 9870 Jun  3 20:46 mbox
drwxr-xr-x   3 basher52 basher52 4096 Jun  2 00:30 .mcop
drwxrwxr-x   2 basher52 basher52 4096 Jun  2 01:07 .qt
drwx------   2 basher52 basher52 4096 Jun  2 00:30 .rhn-applet
-rw-------   1 basher52 basher52  554 Jun  2 01:30 .rhn-applet.conf
-rw-------   1 basher52 basher52  757 Jun  3 20:51 .viminfo
-rw-r--r--   1 basher52 basher52  658 Jun  2 00:29 .zshrc

[basher52@ddp ~]$ ls mail/.imap/INBOX/ -al
total 64
drwx------  2 basher52 basher52  4096 Jun  3 21:56 .
drwx------  3 basher52 basher52  4096 Jun  3 20:56 ..
-rw-------  1 basher52 basher52     5 Jun  3 20:56 .customflags
-rw-------  1 basher52 basher52  1608 Jun  3 21:56 .imap.index
-rw-------  1 basher52 basher52 10264 Jun  3 20:56 .imap.index.data
-rw-------  1 basher52 basher52  2576 Jun  3 20:56 .imap.index.log
-rw-------  1 basher52 basher52  1556 Jun  3 20:56 .imap.index.tree
[/code]
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Wed Jun 06, 2007 1:47 pm

You shouldn't have to put any directory in although I have used just "mail/" for the mail folder path in the past (maybe that's what you need for OE). Your imap folders will go in ~/mail in this case. I don't have Windows so I don't recall what all the questions for settings are. That's why I was asking for every setting you put in that wasn't default. I tell you what, why don't you first try to get imap working with evolution which is something I can give you exact settings for and once you know that works then work on OE.

Basher52 wrote:The imap setting I tried both the home directory and the mail/.imap/INBOX
but they both give the same error


EDIT: I just did a google search and realized what that error was. It's an SMTP message, not a pop/imap message. It is basically telling you you can't relay (meaning you need to modify your /etc/mail/access file as I mentioned earlier). I thought you were having trouble accessing your folders on your server but this indicates you are having trouble "sending" a message through your server:

http://www.google.com/search?hl=en&q=0x800CCC79

Also, check this out:

http://wiki.dovecot.org/Clients

And firstly (which is odd being at the end) make sure dovecot is listening on all interfaces on all the key pop and imap ports ("netstat -anp" as root) and make sure iptables isn't blocking them from your client.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Wed Jun 06, 2007 2:12 pm

Was thinking of trying Evolution but it seems it uses gnome nd i only got KDE
installed, I have to get back to you

UPDATE: Evolution installed :)
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Wed Jun 06, 2007 3:11 pm

Ok, just go in and create an IMAP account (I would first try an imap and not imaps). So in Evolution just click Edit->Preferences and on the first screen put in your name and email address and click FORWARD. Now do server type of "imap", put in your server name and your username on that server and click FORWARD twice where you should be on the "Sending Mail" page. Put your server name in press FORWARD twice then APPLY. That should be all you have to do to make it work. But you won't be able to send any mail for the same reason you can't in OE until until you fix your /etc/mail/access as I mentioned in the last message. You should be able to read your incoming mail.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

PreviousNext

Return to Applications

Who is online

Users browsing this forum: No registered users and 1 guest