-2

I run my own sendmail mail server at my office which has been functioning perfectly for years.

I recently noticed that when travelling, my emails to friends are sometimes bounced - often due to the fact that IP address I am using is part of a range that are dynamically allocated by whichever ISP I happen to be using. These addresses often end up for one reason or another on a blacklist.

My question is, does anyone know how I can get sendmail to rewrite the header information so that anything (especially from me using my email address) can be rewritten to look like it was sent from my own network (we have our own C class range). Effectively I want all my outgoing mail that goes through my mail server to look like it was sent physically from my office.

Apologies - I should explained more clearly. When I am travelling, I am using my own email account which uses my own mail server as the SMTP host. It appears that when I am connected to the net via a dynamically allocated IP address and send email via my SMTP server, it gets rejected by the destination host. I was pretty sure I was using authentication to my server - I'll check when I'm able in a few hours.

Addendum:

Here are the headers for a typical rejection from gmail.com after I sent an email from my current location to my Google account via my SMTP server. Th e problem is being caused by the original "Received From" header.

----- Transcript of session follows ----- ... while talking to gmail-smtp-in.l.google.com.:

>>> DATA
<<< 550-5.7.1 [203.217.18.80      12] Our system has detected that this message is
<<< 550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail,
<<< 550-5.7.1 this message has been blocked. Please visit
<<< 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for
<<< 550 5.7.1 more information. pp2si5211798pbb.61 - gsmtp
554 5.0.0 Service unavailable

>--t157o6hX029609.1423122606/edrs.com.au
>Content-Type: message/delivery-status
>
>Reporting-MTA: dns; edrs.com.au
>Received-From-MTA: DNS; 58-6-171-5.dyn.iinet.net.au
>Arrival-Date: Thu, 5 Feb 2015 18:49:51 +1100
>
>Final-Recipient: RFC822; edrs.com.au@gmail.com
>Action: failed
>Status: 5.7.1
>Remote-MTA: DNS; gmail-smtp-in.l.google.com
>Diagnostic-Code: SMTP; 550-5.7.1 [203.217.18.80      12] Our system has detected that this >message is
>Last-Attempt-Date: Thu, 5 Feb 2015 18:50:06 +1100

>--t157o6hX029609.1423122606/edrs.com.au
>Content-Type: message/rfc822
>Content-Transfer-Encoding: binary

>Return-Path: <dna@edrs.com.au>
>Received: from [192.168.0.166] (58-6-171-5.dyn.iinet.net.au [58.6.171.5])
    (authenticated bits=0)
    by edrs.com.au (8.13.8/8.13.8) with ESMTP id t157nohY029604
    (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO)
    for <edrs.com.au@gmail.com>; Thu, 5 Feb 2015 18:49:51 +1100
>Message-ID: <54D3209E.6050702@edrs.com.au>
>Date: Thu, 05 Feb 2015 17:49:50 +1000
>From: Nigel Allen <dna@edrs.com.au>
>User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
>MIME-Version: 1.0
>To: Nigel Allen <edrs.com.au@gmail.com>
>Subject: {SPAM?} Fwd: Re: Listener Issue: App installation or download
>References: <54d1192bdcc4e_4688829e981572fd@help.tunein.com>
>In-Reply-To: <54d1192bdcc4e_4688829e981572fd@help.tunein.com>
>X-Forwarded-Message-Id: <54d1192bdcc4e_4688829e981572fd@help.tunein.com>
>Content-Type: multipart/mixed; boundary="----------=_1423122599-19274-10"
>X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (edrs.com.au [203.32.74.10]); Thu, 05 Feb 2015 18:49:52 +1100 (AEDT)
>X-Spam-Score: 6.618 (******) >AWL,BAYES_00,DNS_FROM_AHBL_RHSBL,HTML_MESSAGE,RCVD_IN_PBL,RCVD_IN_RP_RNBL,RDNS_DYNAMIC
>Content-Transfer-Encoding: binary
>X-Scanned-By: MIMEDefang 2.70 on 203.32.74.10
bummi
  • 162
  • 2
  • 2
  • 9
prosmart
  • 1
  • 3

1 Answers1

1

If you are talking about Received-From header, then this is not possible. Because Received-From is added by each server in the chain after the letter was received. So unless you have another your server in the loop, closer to the destination relay, which, I suppose, you don't - you cannot rewrite the headers, because you don't have a possibility to do this.

You can, however, use other techniques to send mail:

  • you can send mail via VPN to your office, using your office MTA as a relay
  • you can register another e-mail, for example on gmail/yahoo/whetever and use it
  • you can set up the webmail in your office (like Roundcube) and send mail using it, thus you will be sening mail via your office MTA
  • you can set up a SMTP authentication in your office MTA and send mail via it, but without VPN, webmail or anything else.
drookie
  • 8,051
  • 1
  • 17
  • 27
  • Sending mail through the SMTP server is the way to go here. – Michael Hampton Feb 04 '15 at 13:28
  • Apologies - I should explained more clearly. When I am travelling, I am using my own email account which uses my own mail server as the SMTP host. It appears that when I am connected to the net via a dynamically allocated IP address and send email via my SMTP server, it gets rejected by the destination host. – prosmart Feb 05 '15 at 07:55
  • How do you accomplish this, exactly ? You have your office SMTP configured as the SMTP server in your laptop (or whatever) MUA ? If yes - this is weird (plus, it raises the question "do you have an open relay or how do you distinguish valid clients from spammers at your office ?"). If it still is so, then posting headers will probably shine more light on it. – drookie Feb 05 '15 at 08:52