Loading ...
Sorry, an error occurred while loading the content.
 

Changing address in "From:" header

Expand Messages
  • adambeneschan@aol.com
    Hi, I m trying to set up Postfix on one of our hosts to handle (among other things) outgoing mail. We have several hosts in our domain (which I ll call
    Message 1 of 4 , Jan 3, 2011


      Hi,
       
      I'm trying to set up Postfix on one of our hosts to handle (among other things) outgoing mail.  We have several hosts in our domain (which I'll call domain.com).
       
      The problem I'm trying to solve is that when I send a message, either to another user in our domain or to an outside address, the From: header of the message appears as
       
      From: Adam Beneschan < adam@host1 >
       
      (no spaces inside the angle brackets, I've added them to foil AOL), but I need it to appear as
       
      From: Adam Beneschan < adam@... >
       
      main.cf currently contains
       
      mydomain = domain.com
      myorigin = $mydomain
       
      and most recently I tried
       
      sender_canonical_maps = hash:/etc/postfix/sender_canonical
       
      where the last file was postmap'ed from a file that looks like
       
      adam              adam@...
       
      (with other host and user names).  It didn't help.
       
      What parameter do I need to get this to work?
       
      (Postfix version is 2.2.10, on Fedora.  I set up the installation some years ago planning to finish it if a certain other machine ever died, which is what happened; if I can't solve the problem without upgrading, I'll do so.) 
       
      Sorry if this is a trivial question, but the answer wasn't obvious to me from the FAQs or address rewriting documentation.
       
      Thanks for any help,
                                          -- Adam
       
       
    • Wietse Venema
      ... You need to fix the mail sending application. Postfix does not use main.cf:myorigin when the address already has a domain. Wietse
      Message 2 of 4 , Jan 3, 2011
        adambeneschan@...:
        >
        >
        >
        > Hi,
        >
        > I'm trying to set up Postfix on one of our hosts to handle (among other things) outgoing mail. We have several hosts in our domain (which I'll call domain.com).
        >
        > The problem I'm trying to solve is that when I send a message, either to another user in our domain or to an outside address, the From: header of the message appears as
        >
        > From: Adam Beneschan < adam@host1 >
        >
        > (no spaces inside the angle brackets, I've added them to foil AOL), but I need it to appear as
        >
        > From: Adam Beneschan < adam@... >

        You need to fix the mail sending application. Postfix does not use
        main.cf:myorigin when the address already has a domain.

        Wietse
      • adambeneschan@aol.com
        Wietse, OK, thanks. That explains everything. I m using NMH and was able to fix the problem by editing localname in mts.conf. Our previous system (on the
        Message 3 of 4 , Jan 3, 2011
          Wietse,
           
          OK, thanks.  That explains everything.  I'm using NMH and was able to fix the problem by editing localname in mts.conf.
           
          Our previous system (on the machine that died) used sendmail, which I'm guessing had the ability to fix the "From:" header the way I needed it, but I haven't looked into it closely and don't care enough to.
           
          Thanks,
                                  -- Adam


          -----Original Message-----
          From: Wietse Venema <wietse@...>
          To: Postfix users <postfix-users@...>
          Sent: Mon, Jan 3, 2011 11:31 am
          Subject: Re: Changing address in "From:" header

          adambeneschan@...:
          
          > > > > Hi, > > I'm trying to set up Postfix on one of our hosts to handle (among other
          things) outgoing mail. We have several hosts in our domain (which I'll call domain.com).
          > > The problem I'm trying to solve is that when I send a message, either to
          another user in our domain or to an outside address, the From: header of the message appears as
          > > From: Adam Beneschan < adam@host1 > > > (no spaces inside the angle brackets, I've added them to foil AOL), but I need
          it to appear as
          > > From: Adam Beneschan < adam@... >
          You need to fix the mail sending application. Postfix does not use main.cf:myorigin when the address already has a domain. Wietse
        • Wietse Venema
          ... Postfix can replace domains, but it is better to fix the problem at the source than somewhere in the middle. More opportunity for mistake. Wietse
          Message 4 of 4 , Jan 3, 2011
            adambeneschan@...:
            >
            > Wietse,
            >
            > OK, thanks. That explains everything. I'm using NMH and was able
            > to fix the problem by editing localname in mts.conf.
            >
            > Our previous system (on the machine that died) used sendmail,
            > which I'm guessing had the ability to fix the "From:" header the
            > way I needed it, but I haven't looked into it closely and don't
            > care enough to.
            >

            Postfix can replace domains, but it is better to fix the problem
            at the source than somewhere in the middle. More opportunity for
            mistake.

            Wietse
          Your message has been successfully submitted and would be delivered to recipients shortly.