setup sendmail

Discuss Applications

Postby Void Main » Thu Feb 05, 2009 5:16 pm

I may still be missing something in your setup but in order for what you were trying to do to work the bahnhof.se mail server would have to be configured to allow mail to be relayed from tpetest.servehttp.com. I think it may just be something getting lost in our communication though and I'm still not fully understanding your setup and exactly what you are trying to do.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Fri Feb 06, 2009 10:49 am

well what I'm trying to do is just to test my mail server.
I'm trying try to send my server an email and see if that gets through.

These logs are when I used gmail to send an email to admin@tpetest.servehttp.com from basher52@gmail.com
tpetest.servehttp.com is a no-ip free account for my tests and I pointed out my IP address on this DNS address and the same IP address to the MX Record(I wonder if I missed something here, but it looks like I can only set an IP address for the MX record)

/etc/var/maillog
Code: Select all
Feb  6 17:46:21 localhost sendmail[15559]: n16GkKj0015559: ruleset=check_rcpt, arg1=<admin@tpetest.servehttp.com>, relay=mail-fx0-f13.google.com [209.85.220.13], reject=550 5.7.1 <admin@tpetest.servehttp.com>... Relaying denied
Feb  6 17:46:21 localhost sendmail[15559]: n16GkKj0015559: from=<basher52@gmail.com>, size=0, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=mail-fx0-f13.google.com [209.85.220.13]


the returned email in gmail:
Code: Select all
This is an automatically generated Delivery Status Notification

Delivery to the following recipient failed permanently:

    admin@tpetest.servehttp.com

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 5.7.1 <admin@tpetest.servehttp.com>... Relaying denied (state 14).

  ----- Original message -----

MIME-Version: 1.0
Received: by 10.181.33.18 with SMTP id l18mr147281bkj.192.1233938511072; Fri,
       06 Feb 2009 08:41:51 -0800 (PST)
Date: Fri, 6 Feb 2009 17:41:51 +0100
Message-ID: <5e61c94f0902060841q5688a737iafbc6383439da498@mail.gmail.com>
Subject: test
From: Basher52 B52 <basher52@gmail.com>
To: admin@tpetest.servehttp.com
Content-Type: multipart/alternative; boundary=0016e6de0373a08c5d046242b246

--0016e6de0373a08c5d046242b246
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

testtttttttttttttttttt

--0016e6de0373a08c5d046242b246
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit


  ----- Message truncated -----


and the mail user: admin I added by using this:
adduser -s /sbin/nologin admin; passwd admin


PS. Is the character ';' some sort of character to separate two different commands?
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Fri Feb 06, 2009 11:28 am

Ok, I'm with ya now. Add "tpetest.servehttp.com" to your /etc/mail/local-hostnames file and restart sendmail. Let me know if you still have the problem.

P.S. Yes, the ";" separates commands. It will run as many commands as you stack up on the command line using the ";" sequentially.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Fri Feb 06, 2009 1:02 pm

nope still ain't working, am I bad at this or what lol

maillog:
Code: Select all
Feb  6 20:03:14 localhost sendmail[15668]: n16J3Eph015668: ruleset=check_rcpt, arg1=<admin@tpetest.servehttp.com>, relay=mail-bw0-f164.google.com [209.85.218.164], reject=550 5.7.1 <admin@tpetest.servehttp.com>... Relaying denied
Feb  6 20:03:14 localhost sendmail[15668]: n16J3Eph015668: from=<basher52@gmail.com>, size=0, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=mail-bw0-f164.google.com [209.85.218.164]


from gmail, the returned error mail:
Code: Select all
This is an automatically generated Delivery Status Notification

Delivery to the following recipient failed permanently:

    admin@tpetest.servehttp.com

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 5.7.1 <admin@tpetest.servehttp.com>... Relaying denied (state 14).

  ----- Original message -----

MIME-Version: 1.0
Received: by 10.181.197.6 with SMTP id z6mr77048bkp.119.1233946788651; Fri, 06
       Feb 2009 10:59:48 -0800 (PST)
Date: Fri, 6 Feb 2009 19:59:48 +0100
Message-ID: <5e61c94f0902061059s189037b0k2daf09c2b2402378@mail.gmail.com>
Subject: tttttttttest
From: Basher52 B52 <basher52@gmail.com>
To: admin@tpetest.servehttp.com
Content-Type: multipart/alternative; boundary=00504502cd720264ed046244a07e

--00504502cd720264ed046244a07e
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

ttttttttttttest

--00504502cd720264ed046244a07e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit


  ----- Message truncated -----



the look of my local-host-name (I got no local-hostname file)
Code: Select all
# local-host-names - include all aliases for your machine here.
xenonlyse.se tpetest.servehttp.com


I put them on the same line as all other files seems to use that type

PS. I wonder what I do wring this time from the time that this post originally started, then it just started to work, but I still were in the same type of network.
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Fri Feb 06, 2009 1:26 pm

They shouldn't be on the same line, they should each be on a separate line.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Fri Feb 06, 2009 2:26 pm

I still don't know what the difference is since that last time I took this thing up, like a year ago, and I read it all.
but you still are "DA MAN" :) Just got it working.
I tested to send a mail from gmail and that worked, then I tried from my home-mail and that worked too, so...


once again, thanks again, my true saviour

I gotta send this dude a toaster... I just gotta
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Basher52 » Fri Feb 06, 2009 6:32 pm

Hopefully this will be the last thing regarding this thing, but who knows :P

If I set the server up and have different email accounts for like support, accounting or whatever and if I just can't take care of all the email accounts, then how do I just "truncate" all these to one email account, even if it ain't on the server itself?
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Fri Feb 06, 2009 9:56 pm

Not sure exactly what you are asking. Do you want all email for any user on your domain (real or not) to go to one single account? If so add this to your /etc/mail/virtusertable:

@yourdomain.se someusername

Then restart sendmail. If you then want the mail for that username to be forwarded to an email address on some other domain on some other server you could add an alias to /etc/aliases:

someusername: someotheruser@someotherdomain.se

Then run the "newaliases" command.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Sat Feb 07, 2009 2:06 pm

I'm starting to get tired of this :P

Since the DNS shopping ain't done yet, they cut this domain down and I've changed every place I can find to my test domain, serverhttp.com.
i just tried a mass mail from the VirtueMart system and I got this

Code: Select all
Feb  7 21:04:29 localhost sendmail[17635]: n17K4SjQ017635: from=apache, size=415, class=0, nrcpts=3, msgid=<b7cbb1c92ee1b11f17a18873f76dd0a0@tpetest.servehttp.com>, relay=apache@localhost
Feb  7 21:04:29 localhost sendmail[17637]: n17K4TPX017637: from=<apache@localhost.localdomain>, size=469, class=0, nrcpts=3, msgid=<b7cbb1c92ee1b11f17a18873f76dd0a0@tpetest.servehttp.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb  7 21:04:29 localhost sendmail[17635]: n17K4SjQ017635: to=home@email.net,xx.xx@bahnhof.se,noreply@servehttp.com, ctladdr=apache (48/48), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=90415, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n17K4TPX017637 Message accepted for delivery)
Feb  7 21:04:30 localhost sendmail[17639]: n17K4TPX017637: to=<xx.xx@bahnhof.se>, ctladdr=<apache@localhost.localdomain> (48/48), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=180469, relay=mail.bahnhof.se. [213.136.33.1], dsn=4.1.8, stat=Deferred: 450 4.1.8 <apache@xenonlyse.se>: Sender address rejected: Domain not found


so where did THIS come from?
I have not added a user named apache so it have to be the system itself, right, but where does the domain name come from?
Last edited by Basher52 on Tue Feb 17, 2009 9:59 am, edited 1 time in total.
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Sat Feb 07, 2009 4:42 pm

The from address on your email is apache@localhost.localdomain. Most people are not going to accept that. It has to be from a valid domain with an MX record in the public DNS. Add this to your sendmail.mc and restart sendmail:

Code: Select all
FEATURE('always_add_domain')dnl
FEATURE(`masquerade_entire_domain')
FEATURE(`masquerade_envelope')
FEATURE(`allmasquerade')
MASQUERADE_AS(`yourdomain.se.')
MASQUERADE_DOMAIN(`yourdomain.se.')


Make sure you keep that trailing '.' on the domain names. In addition to that you probably have some place in your application that you are sending mail from where you need to configure your "from" address.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Sat Feb 07, 2009 4:47 pm

do you mean some of these?

Code: Select all
MASQUERADE_AS(`servehttp.com')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
FEATURE(masquerade_envelope)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl 
dnl MAILER(cyrusv2)dnl


as u see I changes the first line in this code example and now I'm gonna try it.

UPDATE: yep that worked :)


can you like transfer your knowledge into a USB device and send that to me so I can plug it into my brain so me too can have all that :P
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Basher52 » Wed Feb 11, 2009 5:36 am

Is there a way to list all sendmail users?
Haven't found anything on sendmail.org or even google about that.
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Wed Feb 11, 2009 7:14 am

I don't know what you mean by "sendmail users".
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Basher52 » Wed Feb 11, 2009 10:25 am

well users that I add that can send and/or get mail.

For the web server there is supposed be these:

noreply@... an account that you can reply to(how this is supposed to be done :P)
admin@... or something else that will fit a web server mail address

and maybe some more that the true name of my sis and her man.

I know I added some test users when doing all the tests, but now I can't remember what they were so I want to list them all.
Don't know if they really are connected with sendmail or just plain mail users, that's why I said "sendmail users"
User avatar
Basher52
guru
guru
 
Posts: 881
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Postby Void Main » Wed Feb 11, 2009 11:42 am

I think you are mixing up the term "user" with the term "email address". They really are two different things. Sendmail is just a traffic cop for email and it can deliver email to a user or send it on down the line to let someone else deal with it, or do nothing with it. It's up to you how you want to configure it.

For example you can configure your sendmail to have all mail for a domain delivered to one specific user on your system (or forward it to some outside email address, or drop/reject it, etc). You can configure sendmail to forward email sent to a specific address to a specific user or some other outside address, etc.

If I understand your situation you want people to be send a message to admin@yourdomain.se but have that mail end up in your "basher" user's inbox on that mail server. You already have sendmail configured to receive email for yourdomain.se so the easiest thing to do would be to add an entry to /etc/aliases that looks like this:

Code: Select all
admin:   basher


Then run the "newaliases" command to have the new entry take effect. Now any mail sent to admin@yourdomain.se will go to the basher user's inbox on that server.

If you just want to see what users are on your system:

Code: Select all
cat /etc/passwd
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

cron