1

I played with /etc/aliases and received the email of a coworker. I would like to put it back on his mailbox. Is there a way to do that cleanly ? I don't want to transfer the email, and if possible if all the mail info could be kept (the header, ip routes etc in the complete mail body) it would be great.

I used gmail as a client. There are just 3 emails so I can do things by hand if necessary

P.S : I have root access to the mail server

7
  • What mail client do you use? ALPINE, for example, makes this trivial (though an additional informational header is added).
    – MadHatter
    Aug 11, 2014 at 7:08
  • @MadHatter I use gmail
    – Thomas
    Aug 11, 2014 at 7:08
  • Hang on, you said postfix/dovecot. When did gmail come into this? Gmail is not a client; gmail is a complete, separate, very large (and highly-privacy-intrusive) mail provider.
    – MadHatter
    Aug 11, 2014 at 7:09
  • @MadHatter dovecot receives the emails, postfix is the pop3 server and gmail read that. And I need to push again to dovecot what gmail pumped out, stripping up gmail information
    – Thomas
    Aug 11, 2014 at 7:11
  • Firstly, postfix will receive the emails and dovecot will allow them to be read; you have accidentally inverted MTA and IMAP/POP server. Secondly, are you saying that in addition to its own mailstore you've given gmail access to your pop/imap server? In any case I'm afraid I wouldn't use gmail in a month of Sundays, so if that really is your mail client I can't help, as I have no idea if it can do an SMTP resend.
    – MadHatter
    Aug 11, 2014 at 7:13

2 Answers 2

1

If you are prepared to go to the trouble of setting up ALPINE as a mail client, to talk to your existing dovecot IMAP server and postfix SMTP server, you can perform mail redelivery by selecting the email then using the B command ("Bounce"; I don't know why they call it that).

You will be asked for the address to which you wish to bounce the message; enter your desired recipient's address, press return, and confirm the operation with Y.

The message will appear in his INBOX with addittional headers similar to these:

Resent-Date: Mon, 11 Aug 2014 08:22:13 +0100 (BST)
Resent-From: Your Name <[email protected]>
Resent-To: [email protected]
Resent-Subject: Re: Original Subject Line Here

There will also be additional Received: from headers arising from this new SMTP transaction, but all the original header information, including routing, date, subject and so on, should be preserved.

Please note that questions about the gory details of setting up ALPINE, getting it to authenticate against your existing mail server for reading and sending, and so on, are probably off-topic for Server Fault.

It is likely that some other mail clients can do a similar operation, but I can't say how they can be told to do it, nor whether gmail is one of them.

3
  • so the person will see that it bounced from me, there is no other way ?
    – Thomas
    Aug 11, 2014 at 13:05
  • Only if they read the headers. If you want this to be completely transparent, you'll need root access on the mail server.
    – MadHatter
    Aug 11, 2014 at 13:12
  • I have root access
    – Thomas
    Aug 11, 2014 at 14:21
1

If you have access to the mail storage at file system level, you could just move the files over to the other inbox with mv. works best with maildir as storage layout/system.

1
  • The files are not there anymore as my gmail read the content of the mailbox
    – Thomas
    Aug 11, 2014 at 18:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .