| 1 | .TH qmail-inject 8 |
| 2 | .SH NAME |
| 3 | qmail-inject \- preprocess and send a mail message |
| 4 | .SH SYNOPSIS |
| 5 | .B qmail-inject |
| 6 | [ |
| 7 | .B \-nNaAhH |
| 8 | ] [ |
| 9 | .B \-f\fIsender |
| 10 | ] [ |
| 11 | .I recip ... |
| 12 | ] |
| 13 | .SH DESCRIPTION |
| 14 | .B qmail-inject |
| 15 | reads a mail message from its standard input, |
| 16 | adds appropriate information to the message header, |
| 17 | and invokes |
| 18 | .B qmail-queue |
| 19 | to send the message |
| 20 | to one or more recipients. |
| 21 | |
| 22 | See |
| 23 | .B qmail-header(5) |
| 24 | for information on how |
| 25 | .B qmail-inject |
| 26 | rewrites header fields. |
| 27 | |
| 28 | .B qmail-inject |
| 29 | normally exits 0. |
| 30 | It exits 100 if it was invoked improperly |
| 31 | or if there is a severe syntax error in the message. |
| 32 | It exits 111 for temporary errors. |
| 33 | .SH "ENVIRONMENT VARIABLES" |
| 34 | For the convenience of users who do not run |
| 35 | .B qmail-inject |
| 36 | directly, |
| 37 | .B qmail-inject |
| 38 | takes many options through environment variables. |
| 39 | |
| 40 | The user name in the |
| 41 | .B From |
| 42 | header field is set by |
| 43 | .BR QMAILUSER , |
| 44 | .BR MAILUSER , |
| 45 | .BR USER , |
| 46 | or |
| 47 | .BR LOGNAME , |
| 48 | whichever comes first. |
| 49 | |
| 50 | The host name is normally set by the |
| 51 | .I defaulthost |
| 52 | control |
| 53 | but can be overridden with |
| 54 | .B QMAILHOST |
| 55 | or |
| 56 | .BR MAILHOST . |
| 57 | |
| 58 | The personal name is |
| 59 | .BR QMAILNAME , |
| 60 | .BR MAILNAME , |
| 61 | or |
| 62 | .BR NAME . |
| 63 | |
| 64 | The default envelope sender address is the same as the |
| 65 | default |
| 66 | .B From |
| 67 | address, |
| 68 | but it can be overridden with |
| 69 | .B QMAILSUSER |
| 70 | and |
| 71 | .BR QMAILSHOST . |
| 72 | It may also be modified by the |
| 73 | .B r |
| 74 | and |
| 75 | .B m |
| 76 | letters described below. |
| 77 | Bounces will be sent to this address. |
| 78 | |
| 79 | The |
| 80 | .B QMAILINJECT |
| 81 | environment variable |
| 82 | can contain any of the following letters: |
| 83 | .TP |
| 84 | .B c |
| 85 | Use address-comment style for the |
| 86 | .B From |
| 87 | field. |
| 88 | Normally |
| 89 | .B qmail-inject |
| 90 | uses name-address style. |
| 91 | .TP |
| 92 | .B s |
| 93 | Do not look at any incoming |
| 94 | .B Return-Path |
| 95 | field. |
| 96 | Normally, if |
| 97 | .B Return-Path |
| 98 | is supplied, it sets the envelope sender address, |
| 99 | overriding all environment variables. |
| 100 | .B Return-Path |
| 101 | is deleted in any case. |
| 102 | .TP |
| 103 | .B f |
| 104 | Delete any incoming |
| 105 | .B From |
| 106 | field. |
| 107 | Normally, if |
| 108 | .B From |
| 109 | is supplied, it overrides the usual |
| 110 | .B From |
| 111 | field created by |
| 112 | .BR qmail-inject . |
| 113 | .TP |
| 114 | .B i |
| 115 | Delete any incoming |
| 116 | .B Message-ID |
| 117 | field. |
| 118 | Normally, if |
| 119 | .B Message-ID |
| 120 | is supplied, it overrides the usual |
| 121 | .B Message-ID |
| 122 | field created by |
| 123 | .BR qmail-inject . |
| 124 | .TP |
| 125 | .B r |
| 126 | Use a per-recipient VERP. |
| 127 | .B qmail-inject |
| 128 | will append each recipient address to the envelope sender |
| 129 | of the copy going to that recipient. |
| 130 | .TP |
| 131 | .B m |
| 132 | Use a per-message VERP. |
| 133 | .B qmail-inject |
| 134 | will append the current date and process ID to the envelope sender. |
| 135 | .SH OPTIONS |
| 136 | .TP |
| 137 | .B \-a |
| 138 | Send the message to all addresses given as |
| 139 | .I recip |
| 140 | arguments; |
| 141 | do not use header recipient addresses. |
| 142 | .TP |
| 143 | .B \-h |
| 144 | Send the message to all header recipient addresses. |
| 145 | For non-forwarded messages, this means |
| 146 | the addresses listed under |
| 147 | .BR To , |
| 148 | .BR Cc , |
| 149 | .BR Bcc , |
| 150 | .BR Apparently-To . |
| 151 | For forwarded messages, this means |
| 152 | the addresses listed under |
| 153 | .BR Resent-To , |
| 154 | .BR Resent-Cc , |
| 155 | .BR Resent-Bcc . |
| 156 | Do not use any |
| 157 | .I recip |
| 158 | arguments. |
| 159 | .TP |
| 160 | .B \-A |
| 161 | (Default.) |
| 162 | Send the message to all addresses given as |
| 163 | .I recip |
| 164 | arguments. |
| 165 | If no |
| 166 | .I recip |
| 167 | arguments are supplied, |
| 168 | send the message to all header recipient addresses. |
| 169 | .TP |
| 170 | .B \-H |
| 171 | Send the message to all header recipient addresses, |
| 172 | and to all addresses given as |
| 173 | .I recip |
| 174 | arguments. |
| 175 | .TP |
| 176 | .B \-f\fIsender |
| 177 | Pass |
| 178 | .I sender |
| 179 | to |
| 180 | .B qmail-queue |
| 181 | as the envelope sender address. |
| 182 | This overrides |
| 183 | .B Return-Path |
| 184 | and all environment variables. |
| 185 | .TP |
| 186 | .B \-N |
| 187 | (Default.) |
| 188 | Feed the resulting message to |
| 189 | .BR qmail-queue . |
| 190 | .TP |
| 191 | .B \-n |
| 192 | Print the message rather than feeding it to |
| 193 | .BR qmail-queue . |
| 194 | .SH "CONTROL FILES" |
| 195 | .TP 5 |
| 196 | .I defaultdomain |
| 197 | Default domain name. |
| 198 | Default: |
| 199 | .IR me , |
| 200 | if that is supplied; |
| 201 | otherwise the literal name |
| 202 | .BR defaultdomain , |
| 203 | which is probably not what you want. |
| 204 | .B qmail-inject |
| 205 | adds this name to any host name without dots, |
| 206 | including |
| 207 | .I defaulthost |
| 208 | if |
| 209 | .I defaulthost |
| 210 | does not have dots. |
| 211 | (Exception: see |
| 212 | .IR plusdomain .) |
| 213 | |
| 214 | The |
| 215 | .B QMAILDEFAULTDOMAIN |
| 216 | environment variable |
| 217 | overrides |
| 218 | .IR defaultdomain . |
| 219 | .TP 5 |
| 220 | .I defaulthost |
| 221 | Default host name. |
| 222 | Default: |
| 223 | .IR me , |
| 224 | if that is supplied; |
| 225 | otherwise the literal name |
| 226 | .BR defaulthost , |
| 227 | which is probably not what you want. |
| 228 | .B qmail-inject |
| 229 | adds this name to any address without a host name. |
| 230 | .I defaulthost |
| 231 | need not be the current host's name. |
| 232 | For example, |
| 233 | you may prefer that outgoing mail show |
| 234 | just your domain name. |
| 235 | |
| 236 | The |
| 237 | .B QMAILDEFAULTHOST |
| 238 | environment variable overrides |
| 239 | .IR defaulthost . |
| 240 | .TP 5 |
| 241 | .I idhost |
| 242 | Host name for Message-IDs. |
| 243 | Default: |
| 244 | .IR me , |
| 245 | if that is supplied; |
| 246 | otherwise the literal name |
| 247 | .BR idhost , |
| 248 | which is certainly not what you want. |
| 249 | .I idhost |
| 250 | need not be the current host's name. |
| 251 | For example, you may prefer to use fake |
| 252 | host names in Message-IDs. |
| 253 | However, |
| 254 | .I idhost |
| 255 | must be a fully-qualified name within your domain, |
| 256 | and each host in your domain should use a different |
| 257 | .IR idhost . |
| 258 | |
| 259 | The |
| 260 | .B QMAILIDHOST |
| 261 | environment variable overrides |
| 262 | .IR idhost . |
| 263 | .TP 5 |
| 264 | .I plusdomain |
| 265 | Plus domain name. |
| 266 | Default: |
| 267 | .IR me , |
| 268 | if that is supplied; |
| 269 | otherwise the literal name |
| 270 | .BR plusdomain , |
| 271 | which is probably not what you want. |
| 272 | .B qmail-inject |
| 273 | adds this name to any host name that ends with a plus sign, |
| 274 | including |
| 275 | .I defaulthost |
| 276 | if |
| 277 | .I defaulthost |
| 278 | ends with a plus sign. |
| 279 | If a host name does not have dots but ends with a plus sign, |
| 280 | .B qmail-inject |
| 281 | uses |
| 282 | .IR plusdomain , |
| 283 | not |
| 284 | .IR defaultdomain . |
| 285 | |
| 286 | The |
| 287 | .B QMAILPLUSDOMAIN |
| 288 | environment variable overrides |
| 289 | .IR plusdomain . |
| 290 | .SH "SEE ALSO" |
| 291 | addresses(5), |
| 292 | qmail-control(5), |
| 293 | qmail-header(5), |
| 294 | qmail-queue(8) |