View previous topic :: View next topic |
Author |
Message |
rbonthond Apprentice
Joined: 24 Jun 2002 Posts: 190
|
Posted: Sun Mar 16, 2003 7:43 pm Post subject: sendmail |
|
|
Hello,
I am having problems with sendmail...
first of all, I only want to use sendmail for outgoing email.
i want to change the domain from localhost.localdomain to mydomain.com, and change the username also to something else
eg: root@localhost.localdomain should be send as robbin.bonthond@mydomain.com,
robbin@localhost.localdomain should be send as robbin.bonthond@mydomain.com
and simone@localhost.localdomain should be send as simone.bonthond@mydomain.com
(lets assume that mydomain.com is valid, and that the emails addresses are also valid)
i have figured out how to change my domain name with the following settings in /etc/mail/sendmail.mc
Code: |
MASQUERADE_AS(mydomain.com)
FEATURE(masquerade_entire_domain)
FEATURE(masquerade_envelop)
Cwmydomain.com
Djmydomain.com
|
but i am unable to figure out how to change the usernames.
does anyone know how to do this ? |
|
Back to top |
|
|
tgoodaire Tux's lil' helper
Joined: 31 Jan 2003 Posts: 145 Location: Dartmouth, Nova Scotia, Canada
|
Posted: Mon Mar 17, 2003 12:34 am Post subject: /etc/aliases |
|
|
I believe that this can be solved by putting the relevant entries in your /etc/aliases file and running newaliases
Code: |
root: robbin.bonthond@mydomain.com
|
_________________ I bent my wookie. |
|
Back to top |
|
|
rbonthond Apprentice
Joined: 24 Jun 2002 Posts: 190
|
Posted: Mon Mar 17, 2003 12:48 am Post subject: |
|
|
modify /etc/aliases works !
however, the problems continue....
the provider i am using is smtp.xs4all.nl, one of the emails is aliased at xs4all to another email adress (which i do not know in all cases), and when ever i try so send an email to it, sendmail bounces back with "user unknown"
so i have robbin@localhost.localdomain aliased to robbin.bonthond@domain1.nl
xs4all has robbin.bonthond@domain1.nl aliased to rbonthond@domain2.nl
using sendmail to send an email to robbin.bonthond@domain1.nl returns "user unknown"
using sendmail to send an email to rbonthond@domain2.nl works....
anyone know why ? |
|
Back to top |
|
|
tgoodaire Tux's lil' helper
Joined: 31 Jan 2003 Posts: 145 Location: Dartmouth, Nova Scotia, Canada
|
Posted: Mon Mar 17, 2003 6:17 am Post subject: sendmail |
|
|
Does robbin.bonthond@domain1.nl exist? Or should it be a different username? _________________ I bent my wookie. |
|
Back to top |
|
|
rbonthond Apprentice
Joined: 24 Jun 2002 Posts: 190
|
Posted: Mon Mar 17, 2003 7:38 am Post subject: Re: sendmail |
|
|
tgoodaire wrote: | Does robbin.bonthond@domain1.nl exist? Or should it be a different username? |
xs4all has robbin.bonthond@domain1.nl aliased to rbonthond@domain2.nl |
|
Back to top |
|
|
tgoodaire Tux's lil' helper
Joined: 31 Jan 2003 Posts: 145 Location: Dartmouth, Nova Scotia, Canada
|
Posted: Mon Mar 17, 2003 1:15 pm Post subject: Sendmail |
|
|
I'm not quite sure what's going on here. Could you take a look at the headers in the email, and confirm that it's actually going to domain1.nl, and that it is the server there that is returning user unknown? _________________ I bent my wookie. |
|
Back to top |
|
|
zhenlin Veteran
Joined: 09 Nov 2002 Posts: 1361
|
Posted: Mon Mar 17, 2003 1:30 pm Post subject: |
|
|
Aliases only mean that jdoe is also john.doe, it doesn't alter the message so that it is addressed to john.doe. |
|
Back to top |
|
|
rbonthond Apprentice
Joined: 24 Jun 2002 Posts: 190
|
Posted: Tue Mar 18, 2003 1:18 am Post subject: |
|
|
oke,
my /etc/hosts contains only this line:
Code: |
127.0.0.1 localhost localhost.localdomain
|
this is an working sendmail.mc (@localdomain -> @domain2.nl):
Code: |
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`sendmail')dnl
OSTYPE(`linux')dnl
define(`SMART_HOST',`smtp.xs4all.nl')
define(`confDEF_USER_ID',``8:12'')dnl
define(`confTRUSTED_USER', `smmsp')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
define(`confTO_IDENT', `0')dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
FEATURE(`accept_unresolvable_domains')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MASQUERADE_AS(domain2.nl)dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(masquerade_envelope)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
|
with this /etc/aliases:
so email from robbin@localhost is send to rbonthond@domain2.nl (which is a real email)
this change to sendmail.mc does not work (@localdomain -> @domain1.nl):
Code: |
MASQUERADE_AS(domain1.nl)dnl
|
with this /etc/aliases:
Code: |
robbin: robbin.bonthond
|
this should send an email from robbin@localhost to robbin.bonthond@domain1.nl which is aliased at the provider to rbonthond@domain2.nl
so if i take the working sendmail and issue:
Code: |
echo "test" | sendmail robbin.bonthond@domain1.nl
|
this is the output:
Code: |
Mar 17 16:40:55 localhost sendmail[1156]: h2HFet6l001156: from=robbin, size=5, class=0, nrcpts=1, msgid=<200303171540.h2HFet6l001156@localhost.localdomain>, relay=robbin@localhost
Mar 17 16:40:55 localhost sendmail[1158]: h2HFetOU001158: from=<robbin@localhost.localdomain>, size=338, class=0, nrcpts=1, msgid=<200303171540.h2HFet6l001156@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Mar 17 16:40:55 localhost sendmail[1156]: h2HFet6l001156: to=robbin.bonthond@domain1.nl, ctladdr=robbin (500/500), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30005, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (h2HFetOU001158 Message accepted for delivery)
Mar 17 16:40:57 localhost sendmail[1160]: h2HFetOU001158: to=<robbin.bonthond@domain1.nl>, ctladdr=<robbin@localhost.localdomain> (500/500), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30333, relay=smtp.xs4all.nl. [194.109.6.51], dsn=2.0.0, stat=Sent (h2I0b3fK000279 Message accepted for delivery)
|
this is recieved at rbonthond@domain2.nl (but the from address states robbin@domain2.nl, wrong username )
so now i switch to the wrong sendmail, and issue the same test command, i get the following errors:
Code: |
Mar 17 16:50:14 localhost sendmail[1322]: h2HFoEc9001322: from=robbin, size=5, class=0, nrcpts=1, msgid=<200303171550.h2HFoEc9001322@localhost.localdomain>, relay=robbin@localhost
Mar 17 16:50:14 localhost sendmail[1324]: h2HFoEER001324: from=<robbin@localhost.localdomain>, size=338, class=0, nrcpts=1, msgid=<200303171550.h2HFoEc9001322@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Mar 17 16:50:14 localhost sendmail[1322]: h2HFoEc9001322: to=robbin.bonthond@domain1.nl, ctladdr=robbin (500/500), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30005, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (h2HFoEER001324 Message accepted for delivery)
Mar 17 16:50:14 localhost sendmail[1326]: h2HFoEER001324: to=<robbin.bonthond@domain1.nl>, ctladdr=<robbin@localhost.localdomain> (500/500), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30333, relay=smtp.xs4all.nl. [194.109.6.51], dsn=5.6.0, stat=Data format error
Mar 17 16:50:14 localhost sendmail[1326]: h2HFoEER001324: to=robbin.bonthond, ctladdr=<robbin@localhost.localdomain> (8/0), delay=00:00:00, mailer=local, pri=30333, dsn=5.1.1, stat=User unknown
Mar 17 16:50:14 localhost sendmail[1326]: h2HFoEER001324: h2HFoEER001326: postmaster notify: User unknown
Mar 17 16:50:14 localhost sendmail[1326]: h2HFoEER001326: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31362, dsn=2.0.0, stat=Sent
|
any clue what i am doing wrong ???
now, for most of my users i do not know where their emails are aliased to, should not make any difference anyway.
domain1.nl is a owned domain by me, hosted by xs4all.
domain1.nl is taekwondo-nijmegen.nl
domain2.nl is hotmail.com
(trying to avoid spambots finding the real email addresses)
however, i also want to run sql-ledger, which is installed on a home linux server. sql-ledger requires sendmail.
what i want is:
* that email from root@localhost is send to administrator@domain1.nl
* email from user sql-ledger@localhost should have info@domain1.nl in the "from:" line.
* the rest of the emails send by users should have firstname.lastname@domain1.nl in the "from:" line. |
|
Back to top |
|
|
rbonthond Apprentice
Joined: 24 Jun 2002 Posts: 190
|
Posted: Tue Mar 18, 2003 11:49 pm Post subject: |
|
|
anyone ??? i am losing sleep over this... for the last 3 days... |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|