sendmail recipient address rewriting with local_relay or mail_hub


 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications sendmail recipient address rewriting with local_relay or mail_hub
# 1  
Old 10-19-2009
Data sendmail recipient address rewriting with local_relay or mail_hub

I'm trying to make this work with a variety of different sendmail versions (all 8.8 or better) and different OS's.

I have to configure all my unix workstations to deliver all email through a relay 'smtp.mydomain.com'. This includes unqualified names as well as qualified names and remote addresses.

The host 'smtp.mydomain.com' does not accept mail addressed to @smtp.mydomain.com and it isn't in my control to change that.

I've played around with MAIL_HUB, SMART_HOST, LOCAL_RELAY, always_add_domain, allmasquerade, masquerade_entire_domain, masquerade_envelop and pretty much every feature or setting related to address rewriting.

FROM addresses are correctly re-written with @mycomain.com, however I need unqualified recipient addresses to be rewritten with @mydomain.com and NOT @smtp.mydomain.com, which is what seems to be happening.

I tried passing the optional argument of 'mydomain.com' to the always_add_domain feature however sendmail is still tryign to deliver the maili to "user@smtp.mydomain.com" which gets rejected.

Although I need this to work on AIX, Solaris (8,9 & 10) and RHEL (3,4,5) I'm currently working with RHEL5.2 and Sendmail 8.13.8. I'm using m4 for configuration and created a stripped down sendmail.mc file:
(This is the hacked to pieces version which probably contains plenty of errors at this point)

------------------
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`RHEL5 2009/10/19')dnl
OSTYPE(`linux')dnl
define(`SMART_HOST', `smtp.mydomain.com')dnl
define(`MAIL_HUB', `smtp.mydomain.com')dnl
define(`LOCAL_RELAY', `smtp.mydomain.com')dnl
MASQUERADE_AS(`mydomain.com.')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(allmasquerade)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain, `mydomain.com')dnl
EXPOSED_USER(`root')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
FEATURE(`accept_unresolvable_domains')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(smtp)dnl
# 2  
Old 10-26-2009
sendmail stickyhost

had a similar problem just now, hope this helps

FEATURE(`stickyhost')
Sendmail cf/README - Features

used with mail_hub, the message keeps its enveloped address, ie. not changed to @mail_hub
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Sendmail has these errors--Domain of sender address <root@time.com> does not exist

Does anyone has a clue of what is going on here? It was working few days ago. /etc/hosts looks ok, sendmail does restart without any errors, telnet is successful. I will be happy to send you guys any output required. Diagnostic-Code: SMTP; 553 #5.1.8 Domain of sender address... (1 Reply)
Discussion started by: lovesaikrishna
1 Replies

2. Solaris

How to force Sendmail to Rewrite Sender Address?

Need to change sender email id from applmgr@<hostname>.<domain-name> to applmgr@domain-name. Understand we can change in the sendmail.cf where $j is the hostname.domain-name.. can anyone show the exact value to change? Thank you. (8 Replies)
Discussion started by: KhawHL
8 Replies

3. Shell Programming and Scripting

sendmail script throwing an error "No recipient addresses found in header"

Hi, I am using following code to send an e-mail with attachment and body. echo "To: user1@mail.com,user2@mail.com" > mail.tmp echo "Cc: user3@mail.com,user4@mail.com" >> mail.tmp echo "From: group@mail.com" >> mail.tmp echo "Subject: my report" >> mail.tmp echo "please see as attached"... (6 Replies)
Discussion started by: vivek_damodaran
6 Replies

4. Shell Programming and Scripting

Help with grep (reWriting it in another way.)

Hello everyone!! Nice do be apart of your forum. I am not very good at unix and thats why i need your help i have this project where i have to simulate a grep command without using grep thought. I have to simulate grep <parameters> <file> grep <parameters> <file> grep <parameters> <file>... (6 Replies)
Discussion started by: kenshin88
6 Replies

5. Solaris

Sendmail 8.13.8 malformed address

Sending email produces malformed address error. The domain name appears as the active directory name which is not a valid Internet domain thus the malfomred address error. I have: divert(0)dnl VERSIONID(`@(#)sendmail.mc 1.11 (Sun) 06/21/04') OSTYPE(`solaris8')dnl... (0 Replies)
Discussion started by: crowman
0 Replies

6. UNIX for Advanced & Expert Users

postfix sender address rewriting

Hi, I have a postfix server that relays to an exchange server. All of my unix/linux systems send to this server, the problem is the form the mail is sent with, the sender address is username@hostname.domain.local I need to rewrite every sender address to unix@maildomain.com for... (0 Replies)
Discussion started by: funksen
0 Replies

7. Shell Programming and Scripting

Help rewriting my KSH-script...

Hi! I'm a beginner at scripting, but have managed to complete a working KSH-script.. :D But since this is going to production i a few weeks, I would like to optimize it and make it better structured! The idéa of the script is to collect data from the database, put it in a file, and then... (2 Replies)
Discussion started by: linsto
2 Replies

8. UNIX for Dummies Questions & Answers

Rewriting a word from location

I am using: ..to get the word that is being searched. What I am looking to do, is to rewrite the word and us it in css: Sort of like this javascript: Hopefully I am making myself clear. Any ideas how I could do this? (1 Reply)
Discussion started by: marringi
1 Replies

9. Solaris

sendmail "root... User address required." error

I'm running sendmail (8.13.8+Sun/8.13.8/Submit) solaris 10. When I send mail to root at the command line (whether I use a full-qualified address or just root), I get the error message root... User address required. Sending mail to root (either at the command line or in a cron job),... (10 Replies)
Discussion started by: csgonan
10 Replies

10. UNIX for Dummies Questions & Answers

sendmail recipient issue

I can send external emails from one of my unix boxes but can no longer send internal emails, i have used mailx -v to see what's going on and it seems there is a problem with the RCPT TO part of the log It seems to add name@nsmail1.mydmn.gov.uk When it should be just name@mydmn.gov.uk The... (1 Reply)
Discussion started by: supadid
1 Replies
Login or Register to Ask a Question