I am on a mac using terminal. I am trying to redirect email from a work email to gmail (the work email only allows IMAP and gmail can only fetch from POP - hence the workaround).
I have successfully configured fetchmail to fetch the mail from the work email.
I would now like to REDIRECT it to gmail, such that when it arrives it appears to arrive from (and I can reply to) the original sender.
I have tried both procmail and ssmtp with following configurations. For BOTH, the email does arrive in my gmail inbox however it appears to come from ME myusername@gmail.com rather than the original sender.
Any suggestions? I am very new at this. Welcome suggestions using procmail or ssmtp (or if it will work anything else!)
procmail set up
.fetchmailrc file:
set no bouncemail
poll outlook.office365.com with protocol imap
port 993
auth password
user user@domain.com password password
ssl
sslfingerprint "<Correct Fingerprint - not sure if I should copy this here>"
sslcertpath /Users/myuser/.certs
keep
no rewrite
mda "/usr/local/bin/procmail -f %F -d %T";
.procmailrc file
VERBOSE=yes
:0
! myusername@gmail.com
(with sendmail configured to send from my gmail, as per my answer here: Using procmail to forward to gmail)
ssmtp set up
/opt/local/etc/ssmtp/ssmtp.conf file
root=FIXME@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=
hostname=localhost
UseTLS=Yes
UseSTARTTLS=Yes
AuthUser=FIXME@gmail.com
AuthPass=Hunter2
FromLineOverride=yes
(have also tried without root line, and with rewriteDomain=gmail.com)
.fetchmailrc file, same as above except mda line is now:
mda "/opt/local/sbin/ssmtp FIXME@gmail.com"